The branch, master has been updated
       via  0aff794d30f17540a76c6b231e783cf2180fe9ef (commit)
       via  9196af928cf0e41c734e1fd8116418ae4184e045 (commit)
      from  04171475eb48bca0361348ab44d9d3c3ba6bb1b2 (commit)


- Shortlog ------------------------------------------------------------
0aff794 Fix regression producing perl warnings on update-alternatives
9196af9 Cleanup second pass parsing of dependency fields

Summary of changes:
 ChangeLog                      |   12 ++++++++++++
 scripts/dpkg-gencontrol.pl     |   18 ++++++------------
 scripts/update-alternatives.pl |    6 ++++--
 3 files changed, 22 insertions(+), 14 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 0aff794d30f17540a76c6b231e783cf2180fe9ef
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Tue Aug 28 05:09:22 2007 +0300

    Fix regression producing perl warnings on update-alternatives
    
    Commit 0fafaf6a2f43c487167a9bfa3f7abc55dcde582c reverted a fix for usage
    of uninitialized variables.

diff --git a/ChangeLog b/ChangeLog
index 143d003..480ad25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-08-28  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/update-alternatives.pl: Fix regression introduced on commit
+       from 2007-08-08, which was producing a warning due to usage of
+       uninitialized variables.
+
+2007-08-28  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/dpkg-gencontrol.pl: Add comments about the second pass
        parsing for dependency fields. Remove handling of uninteresting fields
        in the second pass parsing.
diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl
index f0e7145..12eb2ec 100755
--- a/scripts/update-alternatives.pl
+++ b/scripts/update-alternatives.pl
@@ -595,12 +595,14 @@ if ($mode eq 'auto') {
            unlink("$slink") || $! == &ENOENT ||
                &quit(sprintf(_g("unable to remove %s: %s"), $slink, $!));
         } else {
-           if (!defined($linkname= readlink($slink)) && $! != ENOENT) {
+           $linkname = readlink($slink);
+           if (!defined($linkname) && $! != ENOENT) {
                pr(sprintf(_g("warning: %s is supposed to be a slave symlink 
to\n".
                              " %s, or nonexistent; however, readlink failed: 
%s"),
                           $slink, "$altdir/$sname", $!))
                    if $verbosemode > 0;
-           } elsif ($linkname ne "$altdir/$sname") {
+           } elsif (!defined($linkname) ||
+                   (defined($linkname) && $linkname ne "$altdir/$sname")) {
                unlink("$slink.dpkg-tmp") || $! == ENOENT ||
                    quit(sprintf(_g("unable to ensure %s nonexistent: %s"),
                                 "$slink.dpkg-tmp", $!));

commit 9196af928cf0e41c734e1fd8116418ae4184e045
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Tue Aug 28 04:24:06 2007 +0300

    Cleanup second pass parsing of dependency fields

diff --git a/ChangeLog b/ChangeLog
index aefeb62..143d003 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-28  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * scripts/dpkg-gencontrol.pl: Add comments about the second pass
+       parsing for dependency fields. Remove handling of uninteresting fields
+       in the second pass parsing.
+
 2007-08-24  Guillem Jover  <[EMAIL PROTECTED]>
 
        * scripts/dpkg-gencontrol.pl: Allow a package stanza to override the
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 9a9524b..868d640 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -160,6 +160,7 @@ for $_ (keys %fi) {
         if (m/^(Package|Description|Homepage|Essential|Optional)$/) {
             $f{$_}= $v;
         } elsif (exists($pkg_dep_fields{$_})) {
+           # Delay the parsing until later
         } elsif (m/^Section$|^Priority$/) {
             $spvalue{$_}= $v;
         } elsif (m/^Architecture$/) {
@@ -213,25 +214,18 @@ $f{'Version'} = $forceversion if defined($forceversion);
 &init_substvars;
 init_substvar_arch();
 
+# Process dependency fields in a second pass, now that substvars have been
+# initialized.
+
 for $_ (keys %fi) {
     my $v = $fi{$_};
 
-    if (s/^C //) {
-    } elsif (s/^C$myindex //) {
-        if (m/^(Package|Description|Essential|Optional)$/) {
-        } elsif (exists($pkg_dep_fields{$_})) {
+    if (s/^C$myindex //) {
+        if (exists($pkg_dep_fields{$_})) {
            my $dep = parsedep(substvars($v), 1, 1);
            &error(sprintf(_g("error occurred while parsing %s"), $_)) unless 
defined $dep;
             $f{$_}= showdep($dep, 0);
-        } elsif (m/^Section$|^Priority$/) {
-        } elsif (m/^Architecture$/) {
-        } elsif (s/^X[CS]*B[CS]*-//i) {
-        } elsif (!m/^X[CS]+-/i) {
         }
-    } elsif (m/^C\d+ /) {
-    } elsif (s/^L //) {
-    } elsif (m/o:/) {
-    } else {
     }
 }
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to