]> err.no Git - dpkg/commitdiff
* scripts/update-alternatives.pl: Call read_link_group also in
authorGuillem Jover <guillem@debian.org>
Fri, 4 May 2007 00:29:22 +0000 (00:29 +0000)
committerGuillem Jover <guillem@debian.org>
Fri, 4 May 2007 00:29:22 +0000 (00:29 +0000)
'install' mode, but do not exit nor print an error if the link goup
file does not exist.

ChangeLog
scripts/update-alternatives.pl

index c64bec04ef1dc58de64eb53f86bb8fed4725f111..166ee4ed1dcfa0ec4d1030775f73d296cb2190da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-04  Guillem Jover  <guillem@debian.org>
+
+       * 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  <guillem@debian.org>
 
        * scripts/update-alternatives.pl: Move the ENOENT errno check from
index 47b15ada1c1701933933b9fe8666015ccbb26983..c8378fd94d0cdf92a3e0a80824c65d7f365726ae 100755 (executable)
@@ -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') {