summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWookey <wookey@debian.org>2017-01-25 03:36:41 +0000
committerWookey <wookey@debian.org>2017-01-25 03:36:41 +0000
commit1c8e4eb252fe922df6557b45760fee9a925071cb (patch)
treee08a9053bf5b60a692f4d1a952f9306df560cb12
parent41c3692dc5c3e560111ac96c7dd9d51ff55bfb6c (diff)
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).
-rwxr-xr-xmultistrap7
1 files 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");