Преглед на файлове

* 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.

Guillem Jover преди 19 години
родител
ревизия
8f138e13b0
променени са 2 файла, в които са добавени 11 реда и са изтрити 4 реда
  1. 6 0
      ChangeLog
  2. 5 4
      scripts/update-alternatives.pl

+ 6 - 0
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

+ 5 - 4
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') {