From: Guillem Jover Date: Fri, 4 May 2007 00:29:22 +0000 (+0000) Subject: * scripts/update-alternatives.pl: Call read_link_group also in X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f138e13b0ca48a469921c798999bf239103d7fd;p=dpkg * scripts/update-alternatives.pl: Call read_link_group also in 'install' mode, but do not exit nor print an error if the link goup file does not exist. --- diff --git a/ChangeLog b/ChangeLog index c64bec04..166ee4ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-04 Guillem Jover + + * scripts/update-alternatives.pl: Call read_link_group also in + 'install' mode, but do not exit nor print an error if the link goup + file does not exist. + 2007-05-02 Guillem Jover * scripts/update-alternatives.pl: Move the ENOENT errno check from diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index 47b15ada..c8378fd9 100755 --- a/scripts/update-alternatives.pl +++ b/scripts/update-alternatives.pl @@ -162,11 +162,11 @@ sub read_link_group } } close(AF); + return 0; } elsif ($! != ENOENT) { quit(sprintf(_g("unable to open %s: %s"), "$admindir/$name", $!)); } elsif ($! == ENOENT) { - pr(sprintf(_g("No alternatives for %s."), $name)); - exit 1; + return 1; } } @@ -293,8 +293,9 @@ if ($mode eq 'all') { exit 0; } -if ($mode ne 'install') { - read_link_group(); +if (read_link_group() && $mode ne 'install') { + pr(sprintf(_g("No alternatives for %s."), $name)); + exit 1; } if ($mode eq 'display') {