Author: guillem
Date: 2007-05-14 23:57:07 +0000 (Mon, 14 May 2007)
New Revision: 770

Modified:
   trunk/ChangeLog
   trunk/debian/changelog
   trunk/scripts/update-alternatives.pl
Log:
Fill slavepaths undefined entries with an empty string to guarantee
they are always defined. Closes: #423140, #423451, #423544, #423555


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2007-05-14 21:09:10 UTC (rev 769)
+++ trunk/ChangeLog     2007-05-14 23:57:07 UTC (rev 770)
@@ -1,3 +1,9 @@
+2007-05-15  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * scripts/update-alternatives.pl: Call fill_missing_slavepaths at the
+       end of the 'install' conditional.
+       (fill_missing_slavepaths): New function.
+
 2007-05-14  Guillem Jover  <[EMAIL PROTECTED]>
 
        * scripts/dpkg-divert.pl ($divertto, $package): Initialize to undef

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2007-05-14 21:09:10 UTC (rev 769)
+++ trunk/debian/changelog      2007-05-14 23:57:07 UTC (rev 770)
@@ -4,6 +4,8 @@
   * Fix perl warnings:
     - In dpkg-genchanges when called with -S. Closes: #423193
     - In architecture comparison operations. Closes: #423452
+    - Fill slavepaths undefined entries with an empty string to guarantee
+      they are always defined. Closes: #423140, #423451, #423544, #423555
   * Include the new split man pages deb-substvars.5, deb-override.5 and
     deb-shlibs.5 in dpkg-dev.
   * Fix deb-substvars.5 section to match reality.

Modified: trunk/scripts/update-alternatives.pl
===================================================================
--- trunk/scripts/update-alternatives.pl        2007-05-14 21:09:10 UTC (rev 
769)
+++ trunk/scripts/update-alternatives.pl        2007-05-14 23:57:07 UTC (rev 
770)
@@ -170,6 +170,15 @@
     }
 }
 
+sub fill_missing_slavepaths()
+{
+    for (my $j = 0; $j <= $#slavenames; $j++) {
+       for (my $i = 0; $i <= $#versions; $i++) {
+           $slavepath{$i,$j} = '' if !defined $slavepath{$i,$j};
+       }
+    }
+}
+
 sub find_best_version
 {
     $best = '';
@@ -418,6 +427,8 @@
     for (my $j = 0; $j <= $#slavenames; $j++) {
         $slavepath{$i,$j}= $aslavepath{$slavenames[$j]};
     }
+
+    fill_missing_slavepaths();
 }
 
 if ($action eq 'remove') {


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

Reply via email to