Browse Source

Fill slavepaths undefined entries with an empty string to guarantee
they are always defined. Closes: #423140, #423451, #423544, #423555

Guillem Jover 17 years ago
parent
commit
1b98b82fde
3 changed files with 19 additions and 0 deletions
  1. 6 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 11 0
      scripts/update-alternatives.pl

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2007-05-15  Guillem Jover  <guillem@debian.org>
+
+	* 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  <guillem@debian.org>
 
 	* scripts/dpkg-divert.pl ($divertto, $package): Initialize to undef

+ 2 - 0
debian/changelog

@@ -4,6 +4,8 @@ dpkg (1.14.3) UNRELEASED; urgency=low
   * 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.

+ 11 - 0
scripts/update-alternatives.pl

@@ -170,6 +170,15 @@ sub read_link_group
     }
 }
 
+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 @@ if ($action eq 'install') {
     for (my $j = 0; $j <= $#slavenames; $j++) {
         $slavepath{$i,$j}= $aslavepath{$slavenames[$j]};
     }
+
+    fill_missing_slavepaths();
 }
 
 if ($action eq 'remove') {