* Cope with errors reported from debootstrap better; don't just treat

the text output as package names. Closes: #570474
This commit is contained in:
Steve McIntyre 2010-02-21 22:38:03 +00:00
parent 38423b9daa
commit 599ee0710b
2 changed files with 29 additions and 12 deletions

4
debian/changelog vendored
View File

@ -63,6 +63,10 @@ debian-cd (3.1.3) UNRELEASED; urgency=low
* Improve the description for MAXCDS in the conf file. (Closes: #570028) * Improve the description for MAXCDS in the conf file. (Closes: #570028)
* Export the CDNAME variable in the conf file. (Closes: #570470) * Export the CDNAME variable in the conf file. (Closes: #570470)
[ Steve McIntyre ]
* Cope with errors reported from debootstrap better; don't just treat
the text output as package names. Closes: #570474
-- Frans Pop <fjp@debian.org> Sun, 23 Aug 2009 08:59:25 +0200 -- Frans Pop <fjp@debian.org> Sun, 23 Aug 2009 08:59:25 +0200
debian-cd (3.1.2) unstable; urgency=low debian-cd (3.1.2) unstable; urgency=low

View File

@ -392,6 +392,8 @@ sub check_base_installable {
my (%on_disc, %exclude); my (%on_disc, %exclude);
my $packages_file = "$cddir/dists/$codename/main/binary-$arch/Packages"; my $packages_file = "$cddir/dists/$codename/main/binary-$arch/Packages";
my $p; my $p;
my $db_error = 0;
my $error_string = "";
open (PLIST, $packages_file) open (PLIST, $packages_file)
|| die "Can't open Packages file $packages_file : $!\n"; || die "Can't open Packages file $packages_file : $!\n";
@ -423,19 +425,30 @@ sub check_base_installable {
open (DLIST, "debootstrap --arch $arch --print-debs $codename $tdir/debootstrap_tmp file:$mirror $debootstrap_script 2>/dev/null | tr ' ' '\n' |") open (DLIST, "debootstrap --arch $arch --print-debs $codename $tdir/debootstrap_tmp file:$mirror $debootstrap_script 2>/dev/null | tr ' ' '\n' |")
|| die "Can't fork debootstrap : $!\n"; || die "Can't fork debootstrap : $!\n";
while (defined($p = <DLIST>)) { while (defined($p = <DLIST>)) {
if ($p =~ m/^E:/) {
$db_error = 1;
}
chomp $p; chomp $p;
if (length $p > 1) { if ($db_error) {
if (!defined($on_disc{$p})) { $error_string = "$error_string $p";
if (defined($exclude{$p})) { } else {
print LOG "Missing debootstrap-required $p but included in $ENV{'BASE_EXCLUDE'}\n"; if (length $p > 1) {
} else { if (!defined($on_disc{$p})) {
$ok++; if (defined($exclude{$p})) {
print LOG "Missing debootstrap-required $p\n"; print LOG "Missing debootstrap-required $p but included in $ENV{'BASE_EXCLUDE'}\n";
} } else {
} $ok++;
} print LOG "Missing debootstrap-required $p\n";
} }
close DLIST; }
}
}
}
close DLIST;
if ($db_error) {
print LOG "Debootstrap reported error: $error_string\n";
die "Debootstrap reported error: $error_string\n";
}
system("rm -rf $tdir/debootstrap_tmp"); system("rm -rf $tdir/debootstrap_tmp");
return $ok; return $ok;
} }