From 273eaa85a7685cc1af2687398b27c277bfecfc4a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 1 May 2007 21:42:53 +0000 Subject: [PATCH] * 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. --- ChangeLog | 6 ++++++ scripts/update-alternatives.pl | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 872eaf75..c64bec04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-02 Guillem Jover + + * 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 * scripts/dpkg-shlibdeps.pl (unique_libfiles): New variable. Do not diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index ae7eba0b..47b15ada 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -530,10 +530,10 @@ if ($manual eq 'auto') { &quit(sprintf(_g("unable to remove %s: %s"), "$admindir/$name", $!)); exit(0); } 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". " (or nonexistent); however, readlink failed: %s"), $link, "$altdir/$name", $!)) - if $verbosemode > 0; + if $! != ENOENT && $verbosemode > 0; } elsif ($linkname ne "$altdir/$name") { unlink("$link.dpkg-tmp") || $! == &ENOENT || &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++) { $sname= $slavenames[$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". " %s, or nonexistent; however, readlink failed: %s"), $slink, "$altdir/$sname", $!)) - if $verbosemode > 0; + if $! != ENOENT && $verbosemode > 0; } elsif ($linkname ne "$altdir/$sname") { unlink("$slink.dpkg-tmp") || $! == &ENOENT || &quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$slink.dpkg-tmp", $!)); -- 2.39.5