The following commit has been merged in the master branch:
commit eae5c880d2e3940de5ea7a41e9fbbe062f8d76b2
Author: Raphael Hertzog <[email protected]>
Date: Fri Feb 27 12:09:32 2009 +0100
update-alternatives: add new sanity check
Add one more sanity check verifying that <link> and <path> are different
(cf #509667 for a sample).
diff --git a/ChangeLog b/ChangeLog
index 77093a6..dfa9472 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-02-27 Raphael Hertzog <[email protected]>
+ * scripts/update-alternatives.pl: Add one more sanity check
+ verifying that <link> and <path> are different (cf #509667 for a
+ sample).
+
+2009-02-27 Raphael Hertzog <[email protected]>
+
* scripts/update-alternatives.pl: Improve output messages
by identifying their origin and by being more consistent.
* scripts/t/900_update_alternatives.t: Adjust test suite
diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl
index 0ace23d..cd9bbab 100755
--- a/scripts/update-alternatives.pl
+++ b/scripts/update-alternatives.pl
@@ -60,6 +60,7 @@ while (@ARGV) {
my $name = shift @ARGV;
my $path = shift @ARGV;
my $priority = shift @ARGV;
+ badusage(_g("<link> and <path> can't be the same")) if $link eq $path;
$priority =~ m/^[-+]?\d+/ || badusage(_g("priority must be an
integer"));
$alternative = Alternative->new($name);
$inst_alt = Alternative->new($name);
@@ -84,6 +85,7 @@ while (@ARGV) {
my $slink = shift @ARGV;
my $sname = shift @ARGV;
my $spath = shift @ARGV;
+ badusage(_g("<link> and <path> can't be the same")) if $slink eq
$spath;
badusage(_g("name %s is both primary and slave"), $inst_alt->name())
if $sname eq $inst_alt->name();
if ($inst_alt->has_slave($sname)) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]