From 796a419bd1af73483564b9dd2b31af6cc545339d Mon Sep 17 00:00:00 2001 From: Wookey Date: Wed, 25 Jan 2017 03:36:41 +0000 Subject: [PATCH] Ensure that foreign-arch multiarch multistraps work force_unpack was not considering architecture when de-duping the package list (This manifested when doing a foreign-arch multistrap which was also multiarch - i.e. two foreign arches relative to the build arch). --- multistrap | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/multistrap b/multistrap index d7955cd..4b4db50 100755 --- a/multistrap +++ b/multistrap @@ -572,16 +572,17 @@ sub force_unpack { my $escaped_path = shellescape("${dir}${cachedir}archives/$deb"); my $version = `LC_ALL=C dpkg -f $escaped_path Version`; my $package = `LC_ALL=C dpkg -f $escaped_path Package`; + my $arch = `LC_ALL=C dpkg -f $escaped_path Architecture`; chomp ($version); chomp ($package); if (exists $unpack{$package}) { - my $test=system("dpkg --compare-versions ". shellescape($unpack{$package}) . " '<<' " . shellescape($version)); + my $test=system("dpkg --compare-versions ". shellescape($unpack{$package.$arch}) . " '<<' " . shellescape($version)); $test >>= 8; # unlink version in $unpack if 0 # unlink $deb (current one) if 1 if ($test == 0) { my $old = $deb; - $old =~ s/$version/$unpack{$package}/; + $old =~ s/$version/$unpack{$package.$arch}/; printf (_g("I: Removing %s\n"), $old); unlink "${dir}${cachedir}archives/$old"; next; @@ -590,7 +591,7 @@ sub force_unpack { unlink "${dir}${cachedir}archives/$deb"; } } - $unpack{$package}=$version; + $unpack{$package.$arch}=$version; } if (not @limits) { open (LOCK, ">${dir}${libdir}lists/lock");