Ver código fonte

* scripts/update-alternatives.pl: Move the ENOENT errno check from
the if conditionals to the block body to avoid comparing against an
undef value on the next elsif conditional.

Guillem Jover 19 anos atrás
pai
commit
273eaa85a7
2 arquivos alterados com 10 adições e 4 exclusões
  1. 6 0
      ChangeLog
  2. 4 4
      scripts/update-alternatives.pl

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-05-02  Guillem Jover  <guillem@debian.org>
+
+	* scripts/update-alternatives.pl: Move the ENOENT errno check from
+	the if conditionals to the block body to avoid comparing against an
+	undef value on the next elsif conditional.
+
 2007-04-28  Aaron M. Ucko  <ucko@debian.org>
 2007-04-28  Aaron M. Ucko  <ucko@debian.org>
 
 
 	* scripts/dpkg-shlibdeps.pl (unique_libfiles): New variable. Do not
 	* scripts/dpkg-shlibdeps.pl (unique_libfiles): New variable. Do not

+ 4 - 4
scripts/update-alternatives.pl

@@ -530,10 +530,10 @@ if ($manual eq 'auto') {
             &quit(sprintf(_g("unable to remove %s: %s"), "$admindir/$name", $!));
             &quit(sprintf(_g("unable to remove %s: %s"), "$admindir/$name", $!));
         exit(0);
         exit(0);
     } else {
     } else {
-        if (!defined($linkname= readlink($link)) && $! != &ENOENT) {
+        if (!defined($linkname = readlink($link))) {
             &pr(sprintf(_g("warning: %s is supposed to be a symlink to %s\n".
             &pr(sprintf(_g("warning: %s is supposed to be a symlink to %s\n".
                 " (or nonexistent); however, readlink failed: %s"), $link, "$altdir/$name", $!))
                 " (or nonexistent); however, readlink failed: %s"), $link, "$altdir/$name", $!))
-              if $verbosemode > 0;
+		if  $! != ENOENT && $verbosemode > 0;
         } elsif ($linkname ne "$altdir/$name") {
         } elsif ($linkname ne "$altdir/$name") {
             unlink("$link.dpkg-tmp") || $! == &ENOENT ||
             unlink("$link.dpkg-tmp") || $! == &ENOENT ||
                 &quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$link.dpkg-tmp", $!));
                 &quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$link.dpkg-tmp", $!));
@@ -564,10 +564,10 @@ if ($manual eq 'auto') {
     for (my $j = 0; $j <= $#slavenames; $j++) {
     for (my $j = 0; $j <= $#slavenames; $j++) {
         $sname= $slavenames[$j];
         $sname= $slavenames[$j];
         $slink= $slavelinks[$j];
         $slink= $slavelinks[$j];
-        if (!defined($linkname= readlink($slink)) && $! != &ENOENT) {
+        if (!defined($linkname = readlink($slink))) {
             &pr(sprintf(_g("warning: %s is supposed to be a slave symlink to\n".
             &pr(sprintf(_g("warning: %s is supposed to be a slave symlink to\n".
                 " %s, or nonexistent; however, readlink failed: %s"), $slink, "$altdir/$sname", $!))
                 " %s, or nonexistent; however, readlink failed: %s"), $slink, "$altdir/$sname", $!))
-              if $verbosemode > 0;
+		if  $! != ENOENT && $verbosemode > 0;
         } elsif ($linkname ne "$altdir/$sname") {
         } elsif ($linkname ne "$altdir/$sname") {
             unlink("$slink.dpkg-tmp") || $! == &ENOENT ||
             unlink("$slink.dpkg-tmp") || $! == &ENOENT ||
                 &quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$slink.dpkg-tmp", $!));
                 &quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$slink.dpkg-tmp", $!));