From: Guillem Jover Date: Mon, 14 May 2007 23:57:07 +0000 (+0000) Subject: Fill slavepaths undefined entries with an empty string to guarantee X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b98b82fde72c67fb32cd83d20f8b351418475ce;p=dpkg Fill slavepaths undefined entries with an empty string to guarantee they are always defined. Closes: #423140, #423451, #423544, #423555 --- diff --git a/ChangeLog b/ChangeLog index 73f9a47f..bcf0c6dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-15 Guillem Jover + + * 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 * scripts/dpkg-divert.pl ($divertto, $package): Initialize to undef diff --git a/debian/changelog b/debian/changelog index f166c97f..5a68beea 100644 --- a/debian/changelog +++ b/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. diff --git a/scripts/update-alternatives.pl b/scripts/update-alternatives.pl index 0658ba05..0cd589c1 100755 --- a/scripts/update-alternatives.pl +++ b/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') {