forked from josch/mmdebstrap
Don't rely on Architecture field in indextargets output because it's only filled for non-flat mirrors
This commit is contained in:
parent
bdbe12fec8
commit
7a25de31db
1 changed files with 32 additions and 24 deletions
10
mmdebstrap
10
mmdebstrap
|
@ -715,7 +715,7 @@ sub setup {
|
||||||
# Same if we want to install priority based variants.
|
# Same if we want to install priority based variants.
|
||||||
if ($options->{variant} ne 'apt') {
|
if ($options->{variant} ne 'apt') {
|
||||||
my %ess_pkgs;
|
my %ess_pkgs;
|
||||||
open(my $pipe_apt, '-|', 'apt-get', 'indextargets', '--format', '$(FILENAME)', 'Created-By: Packages', "Architecture: $options->{nativearch}") or die "cannot start apt-get indextargets: $!";
|
open(my $pipe_apt, '-|', 'apt-get', 'indextargets', '--format', '$(FILENAME)', 'Created-By: Packages') or die "cannot start apt-get indextargets: $!";
|
||||||
while (my $fname = <$pipe_apt>) {
|
while (my $fname = <$pipe_apt>) {
|
||||||
chomp $fname;
|
chomp $fname;
|
||||||
open (my $pipe_cat, '-|', '/usr/lib/apt/apt-helper', 'cat-file', $fname) or die "cannot start apt-helper cat-file: $!";
|
open (my $pipe_cat, '-|', '/usr/lib/apt/apt-helper', 'cat-file', $fname) or die "cannot start apt-helper cat-file: $!";
|
||||||
|
@ -723,6 +723,7 @@ sub setup {
|
||||||
my $pkgname;
|
my $pkgname;
|
||||||
my $ess = '';
|
my $ess = '';
|
||||||
my $prio = 'optional';
|
my $prio = 'optional';
|
||||||
|
my $arch = '';
|
||||||
while (my $line = <$pipe_cat>) {
|
while (my $line = <$pipe_cat>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
# Dpkg::Index takes 10 seconds to parse a typical Packages
|
# Dpkg::Index takes 10 seconds to parse a typical Packages
|
||||||
|
@ -735,9 +736,14 @@ sub setup {
|
||||||
$ess = 'yes'
|
$ess = 'yes'
|
||||||
} elsif ($line =~ /^Priority: (.*)/) {
|
} elsif ($line =~ /^Priority: (.*)/) {
|
||||||
$prio = $1;
|
$prio = $1;
|
||||||
|
} elsif ($line =~ /^Architecture: (.*)/) {
|
||||||
|
$arch = $1;
|
||||||
}
|
}
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
# we are only interested of packages of native architecture or
|
||||||
|
# Architecture:all
|
||||||
|
if ($arch eq $options->{nativearch} or $arch eq 'all') {
|
||||||
# the line is empty, thus a package stanza just finished
|
# the line is empty, thus a package stanza just finished
|
||||||
# processing and we can handle it now
|
# processing and we can handle it now
|
||||||
if ($ess eq 'yes') {
|
if ($ess eq 'yes') {
|
||||||
|
@ -766,10 +772,12 @@ sub setup {
|
||||||
} else {
|
} else {
|
||||||
die "unknown variant: $options->{variant}";
|
die "unknown variant: $options->{variant}";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
# reset values
|
# reset values
|
||||||
undef $pkgname;
|
undef $pkgname;
|
||||||
$ess = '';
|
$ess = '';
|
||||||
$prio = 'optional';
|
$prio = 'optional';
|
||||||
|
$arch = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
close $pipe_cat;
|
close $pipe_cat;
|
||||||
|
|
Loading…
Reference in a new issue