Преглед изворни кода

* scripts/update-alternatives.pl: Do not exit with an error on
'--remove' with a non-existing link group file for now, to be
consistent with the case when trying to remove an non-existing path.

Guillem Jover пре 19 година
родитељ
комит
3d6e3c334b
2 измењених фајлова са 15 додато и 3 уклоњено
  1. 6 0
      ChangeLog
  2. 9 3
      scripts/update-alternatives.pl

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-05-08  Guillem Jover  <guillem@debian.org>
+
+	* scripts/update-alternatives.pl: Do not exit with an error on
+	'--remove' with a non-existing link group file for now, to be
+	consistent with the case when trying to remove an non-existing path.
+
 2007-05-08  Guillem Jover  <guillem@debian.org>
 
 	* scripts/update-alternatives.pl: Fix warning when executed w/o any

+ 9 - 3
scripts/update-alternatives.pl

@@ -294,9 +294,15 @@ if ($mode eq 'all') {
     exit 0;
 }
 
-if (read_link_group() && $mode ne 'install') {
-    pr(sprintf(_g("No alternatives for %s."), $name));
-    exit 1;
+if (read_link_group()) {
+    if ($mode eq 'remove') {
+	# FIXME: Be consistent for now with the case when we try to remove a
+	# non-existing path from an existing link group file.
+	exit 0;
+    } elsif ($mode ne 'install') {
+	pr(sprintf(_g("No alternatives for %s."), $name));
+	exit 1;
+    }
 }
 
 if ($mode eq 'display') {