Author: guillem
Date: 2007-05-09 18:00:06 +0000 (Wed, 09 May 2007)
New Revision: 748

Modified:
   trunk/ChangeLog
   trunk/debian/changelog
   trunk/scripts/update-alternatives.pl
Log:
Properly create the generic name symlink in update-alternatives for new
alternatives. Closes: #422979


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2007-05-09 04:13:16 UTC (rev 747)
+++ trunk/ChangeLog     2007-05-09 18:00:06 UTC (rev 748)
@@ -1,5 +1,10 @@
 2007-05-09  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * 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  <[EMAIL PROTECTED]>
+
        * scripts/update-alternatives.pl (config_message): Handle the case
        when @versions is empty. Return a negative value if there's nothing to
        do, 0 on success.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2007-05-09 04:13:16 UTC (rev 747)
+++ trunk/debian/changelog      2007-05-09 18:00:06 UTC (rev 748)
@@ -5,6 +5,8 @@
   * 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 <[EMAIL PROTECTED]>  Tue, 08 May 2007 18:48:22 +0300
 

Modified: trunk/scripts/update-alternatives.pl
===================================================================
--- trunk/scripts/update-alternatives.pl        2007-05-09 04:13:16 UTC (rev 
747)
+++ trunk/scripts/update-alternatives.pl        2007-05-09 18:00:06 UTC (rev 
748)
@@ -538,11 +538,13 @@
             &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") ||
@@ -572,11 +574,14 @@
     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") ||


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to