From 0db7484988266c8d37ee12c5a53150d337fa992e Mon Sep 17 00:00:00 2001 From: Frans Pop Date: Sat, 5 Jan 2008 23:50:48 +0000 Subject: [PATCH] * During installation debootstrap will complain about an invalid Release file if there is no Packages file for the local section. Create an empty Packages file if one is missing. --- debian/changelog | 5 ++++- tools/make_disc_trees.pl | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 28cc8870..82be08d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -68,8 +68,11 @@ debian-cd (3.0.4) UNRELEASED; urgency=low are now added in generate_di+k_list. Reduces impact of #410418. * exclude-udebs: exclude any libdirectfb udeb instead of particular version. * exclude-udebs: exclude kbd-udeb and console-setup udebs (not yet used). + * During installation debootstrap will complain about an invalid Release file + if there is no Packages file for the local section. Create an empty Packages + file if one is missing. - -- Frans Pop Mon, 17 Dec 2007 21:54:11 +0100 + -- Frans Pop Sun, 06 Jan 2008 00:44:19 +0100 debian-cd (3.0.3) unstable; urgency=low diff --git a/tools/make_disc_trees.pl b/tools/make_disc_trees.pl index 6f0b3b71..0843f95c 100755 --- a/tools/make_disc_trees.pl +++ b/tools/make_disc_trees.pl @@ -347,6 +347,24 @@ sub check_base_installable { return $ok; } +# If missing, create an empty local Packages file for an architecture. +# Only create an uncompressed Packages file; the call to recompress will +# create the compressed version. +sub add_missing_Packages { + my ($filename); + + $filename = $File::Find::name; + + if ((-d "$_") && ($filename =~ m/\/main\/binary-[^\/]*$/)) { + if ((-f "$_/Packages") && (! -d "../local/$_/")) { + mkdir "../local/$_/" || die "Error creating directory local/$_: $!\n"; + open(LPFILE, ">../local/$_/Packages") or die "Error creating local/$_/Packages: $!\n"; + close LPFILE; + print " Created empty Packages file for local/$_\n"; + } + } +} + sub md5_file { my $filename = shift; my ($md5, $st); @@ -532,6 +550,15 @@ sub finish_disc { chdir $cddir; + # If we have a local packages directory, ensure we have a Packages file + # for all included architectures as otherwise the Release file will be + # invalid. This can happen if we do have local udebs but no local + # regular packages, or multiple architectures with not all of them + # having local packages. + if (-d "./dists/$codename/local") { + find (\&add_missing_Packages, "./dists/$codename/main/"); + } + print " Finishing off the Release file\n"; chdir "dists/$codename"; open(RELEASE, ">>Release") || die "Failed to open Release file: $!\n";