Explorar o código

update-alternatives: switch non-existant alternative to auto

* scripts/update-alternatives.pl: Ensure that a non-existant
alternative result in automatic mode configuration.
Raphael Hertzog %!s(int64=17) %!d(string=hai) anos
pai
achega
ed1ab8e968
Modificáronse 2 ficheiros con 6 adicións e 1 borrados
  1. 5 0
      ChangeLog
  2. 1 1
      scripts/update-alternatives.pl

+ 5 - 0
ChangeLog

@@ -3,6 +3,11 @@
 	* lib/dpkg.h (ohshitvb): Remove function prototype.
 	* lib/dpkg.h (ohshitvb): Remove function prototype.
 	* lib/ehandle.c (ohshitvb): Remove function definition.
 	* lib/ehandle.c (ohshitvb): Remove function definition.
 
 
+2009-02-06  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/update-alternatives.pl: Ensure that a non-existant
+	alternative result in automatic mode configuration.
+
 2009-02-06  Raphael Hertzog  <hertzog@debian.org>
 2009-02-06  Raphael Hertzog  <hertzog@debian.org>
 
 
 	* scripts/update-alternatives.pl: Change set_links() to
 	* scripts/update-alternatives.pl: Change set_links() to

+ 1 - 1
scripts/update-alternatives.pl

@@ -465,7 +465,7 @@ if (defined($linkname= readlink("$altdir/$name"))) {
 #   $action      auto, install, remove, remove-all
 #   $action      auto, install, remove, remove-all
 # all independent
 # all independent
 
 
-if ($action eq 'auto') {
+if (($action eq 'auto') || ($state eq 'nonexistent')) {
     pr(sprintf(_g("Setting up automatic selection of %s."), $name))
     pr(sprintf(_g("Setting up automatic selection of %s."), $name))
       if $verbosemode > 0;
       if $verbosemode > 0;
     checked_rm("$altdir/$name.dpkg-tmp");
     checked_rm("$altdir/$name.dpkg-tmp");