The following commit has been merged in the master branch:
commit b633f89b56804977a9fbaf9af8d67caa31dd2c94
Author: Raphael Hertzog <[email protected]>
Date: Sun Feb 22 19:20:41 2009 +0100
update-alternatives: --all can be used to restore broken alternatives
Since alternatives are repaired every time they are reconfigured,
the user can use --all to reconfigure them all with the current choice
and repair everything. Document this in the manual pages and ensure
that it really works that way by returning a valid choice.
Closes: #250258, #395556
diff --git a/ChangeLog b/ChangeLog
index c902f86..9f37ceb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-02-22 Raphael Hertzog <[email protected]>
+ * man/update-alternatives.8: Document how --all can be used to
+ repair all alternatives on the system in a single command.
+ * scripts/update-alternatives.pl: Ensure the above explanation
+ is true by ensuring that --config does something sensible when
+ no alternative is currently selected and when the user input is
+ empty: it will auto-select the best alternative.
+
+2009-02-22 Raphael Hertzog <[email protected]>
+
* scripts/update-alternatives.pl: Implement --set-selections.
It's the the counterpart of --get-selections, it reads
configuration on standard input and reconfigures alternatives
diff --git a/debian/changelog b/debian/changelog
index a2422fa..09c6bb7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -168,6 +168,8 @@ dpkg (1.15.0) UNRELEASED; urgency=low
alternatives. Closes: #273406, #392429
- new option --set-selections to reconfigure a set of alternatives in
a single command.
+ * Document in update-alternatives(8) how one can repair all broken
+ alternatives with a single command. Closes: #250258, #395556
[ Pierre Habouzit ]
* Add a --query option to update-alternatives. Closes: #336091, #441904
diff --git a/man/update-alternatives.8 b/man/update-alternatives.8
index 4b8a4b9..daba7f7 100644
--- a/man/update-alternatives.8
+++ b/man/update-alternatives.8
@@ -270,6 +270,8 @@ is a name in the alternatives directory.
Call \fB\-\-config\fP on all alternatives. It can be usefully combined with
\fB\-\-skip\-auto\fP to review and configure all alternatives which are
not configured in automatic mode. Broken alternatives are also displayed.
+Thus a simple way to fix all broken alternatives is to call
+\fByes \[aq]\[aq] | update-alternatives \-\-force \-\-all\fR.
.TP
\fB\-\-auto\fR \fIname\fR
Switch the link group behind the alternative name
diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl
index 18c147d..c6c30d8 100755
--- a/scripts/update-alternatives.pl
+++ b/scripts/update-alternatives.pl
@@ -908,7 +908,7 @@ sub select_choice {
my $selection = <STDIN>;
return undef unless defined($selection);
chomp($selection);
- return $current if $selection eq "";
+ return ($current || $best) if $selection eq "";
if (exists $sel{$selection}) {
$self->set_status(($selection eq "0") ? "auto" : "manual");
return $sel{$selection};
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]