+2007-05-09 Guillem Jover <guillem@debian.org>
+
+ * scripts/update-alternatives.pl: Create the generic name symlinks
+ when there's none, or when it differs to the current one.
+
2007-05-09 Guillem Jover <guillem@debian.org>
* scripts/update-alternatives.pl (config_message): Handle the case
* Handle case in update-alternatives when there's no existing alternative
to configure. Closes: #260987, #353252, #367717, #392431
* Add solaris support to ostable and triplettable. Closes: #361866
+ * Properly create the generic name symlink in update-alternatives for new
+ alternatives. Closes: #422979
-- Guillem Jover <guillem@debian.org> Tue, 08 May 2007 18:48:22 +0300
&quit(sprintf(_g("unable to remove %s: %s"), "$admindir/$name", $!));
exit(0);
} else {
- if (!defined($linkname = readlink($link))) {
+ $linkname = readlink($link);
+ if (!defined($linkname) && $! != ENOENT) {
&pr(sprintf(_g("warning: %s is supposed to be a symlink to %s\n".
" (or nonexistent); however, readlink failed: %s"), $link, "$altdir/$name", $!))
- if $! != ENOENT && $verbosemode > 0;
- } elsif ($linkname ne "$altdir/$name") {
+ if $verbosemode > 0;
+ } elsif (!defined($linkname) ||
+ (defined($linkname) && $linkname ne "$altdir/$name")) {
unlink("$link.dpkg-tmp") || $! == &ENOENT ||
&quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$link.dpkg-tmp", $!));
symlink("$altdir/$name","$link.dpkg-tmp") ||
for (my $j = 0; $j <= $#slavenames; $j++) {
$sname= $slavenames[$j];
$slink= $slavelinks[$j];
- if (!defined($linkname = readlink($slink))) {
+
+ $linkname = readlink($slink);
+ if (!defined($linkname) && $! != ENOENT) {
&pr(sprintf(_g("warning: %s is supposed to be a slave symlink to\n".
" %s, or nonexistent; however, readlink failed: %s"), $slink, "$altdir/$sname", $!))
- if $! != ENOENT && $verbosemode > 0;
- } elsif ($linkname ne "$altdir/$sname") {
+ if $verbosemode > 0;
+ } elsif (!defined($linkname) ||
+ (defined($linkname) && $linkname ne "$altdir/$sname")) {
unlink("$slink.dpkg-tmp") || $! == &ENOENT ||
&quit(sprintf(_g("unable to ensure %s nonexistent: %s"), "$slink.dpkg-tmp", $!));
symlink("$altdir/$sname","$slink.dpkg-tmp") ||