This new patch, I believe, addresses most of the issues that have been
brought up with my initial patch, and one or two others:
* It eliminates the hard-coded list of arches in which_deb,
update_tasks, and generate_di_lists, in favor of the ARCHES environment
variable, and falls back to (i386, amd64) when the ARCHES variable is
unavailable, or when building a source-only CD
* update_tasks uses which_deb to determine a valid/existing arch
* It does not address the issue of running update_tasks independently
for each arch; I'm afraid I don't fully understand how update_tasks is
used well enough to make this change at the current time
* which_deb and generate_di_list now build the @components array
explicitly, based on whether CONTRIB, NONFREE, and LOCAL variables are
set, rather than just looking for directory names that exist under the
pool/ directory--this in response to some comments Frans made in
relation to another forum thread.
* which_deb now needs to be able to look up 'coreutils', which I
allowed by creating a fall-through mode, effectively making which_deb
work for any existing deb--I hope this approach is sane
Index: tools/update_tasks
===
--- tools/update_tasks(revision 7407)
+++ tools/update_tasks(revision 7522)
@@ -149,10 +149,15 @@
}' | sort -s -n -k1 | cut -d: -f2 >> $file
}
-# We need to gunzip a copy of the appropriate Packages.gz file
-# Assume i386, use the $CODENAME main Packages file
+# Look for the coreutils package (which should exist in all archs, and is
+# a non -all package) to determine a valid arch for the rest of this
+# script
+arch=$(which_deb $MIRROR $CODENAME coreutils binary | sed -e
"s/\.deb//" -e "s/.*_//")
+
+# We need to gunzip a copy of the appropriate Packages.gz file(s)
TMP_PKG=$TDIR/Packages
-zcat $MIRROR/dists/$CODENAME/main/binary-i386/Packages.gz > $TMP_PKG
+zcat $MIRROR/dists/$CODENAME/main/binary-$arch/Packages.gz > $TMP_PKG
+[ -n "$LOCAL" ] && zcat
$MIRROR/dists/$CODENAME/local/binary-$arch/Packages.gz >> $TMP_PKG
# Now grab the appropriate tasksel package
TASKSEL_DEB=$MIRROR/`mawk '
Index: tools/make_disc_trees.pl
===
--- tools/make_disc_trees.pl(revision 7407)
+++ tools/make_disc_trees.pl(revision 7522)
@@ -735,7 +735,7 @@
}
$pdir = "$dir/dists/$codename/$dist";
-if ($section eq "debian-installer") {
+if ($section and $section eq "debian-installer") {
$pdir = "$dir/dists/$codename/$dist/debian-installer";
}
return $pdir;
Index: tools/generate_di_list
===
--- tools/generate_di_list(revision 7407)
+++ tools/generate_di_list(revision 7522)
@@ -5,9 +5,19 @@
die "Missing \$MIRROR variable" unless $ENV{MIRROR};
die "Missing \$DI_CODENAME variable" unless $ENV{DI_CODENAME};
die "Missing \$BASEDIR variable" unless $ENV{BASEDIR};
+die "Missing \$ARCHES variable" unless $ENV{ARCHES};
-my @ARCHES=qw{alpha arm armel hppa hurd-i386 i386 ia64 mips mipsel
- powerpc s390 sparc amd64};
+# Early exit if we're building a source-only CD
+exit 0 if $ENV{ARCHES} =~ /^\s*source\s*$/;
+
+my @ARCHES;
+if ( $ENV{ARCHES} ) {
+push @ARCHES, 'i386' if $ENV{ARCHES} =~ /i386/;
+push @ARCHES, 'amd64' if $ENV{ARCHES} =~ /amd64/;
+push @ARCHES, grep { !/source|i386|amd64/ } split /\s+/, $ENV{ARCHES};
+}
+...@arches = qw{i386 amd64} unless @ARCHES;
+
my $DATE=`date`;
chomp $DATE;
open(OUT, ">debian-installer") || die "write: $!";
@@ -24,32 +34,42 @@
EOF
my @common_excludes = read_exclude("exclude-udebs");
-
+my $mirror_path = "$ENV{MIRROR}/dists/$ENV{DI_CODENAME}";
+my @components = qw(main);
+push @components, 'contrib' if $ENV{CONTRIB};
+push @components, 'non-free' if $ENV{NONFREE};
+push @components, 'local' if $ENV{LOCAL};
foreach my $arch (@ARCHES) {
-my
$packagefile="$ENV{MIRROR}/dists/$ENV{DI_CODENAME}/main/debian-installer/binary-$arch/Packages.gz";
-unless (-f $packagefile) {
-print "Missing package file for arch $arch.\n";
-next;
-}
(my $cpparch = $arch) =~ s/-/_/g;
-print OUT "#ifdef ARCH_$cpparch\n";
-my @exclude = @common_excludes;
-push @exclude, read_exclude("exclude-udebs-$arch")
-if -e exclude_path("exclude-udebs-$arch");
-UDEB:foreach my $udeb (map { chomp; $_ } `zcat $packagefile | awk
'/^Package:/ {print \$2}'`) {
-foreach my $pattern (@exclude) {
-if ($udeb =~ /^$pattern$/) {
-next UDEB;
-}
+my $output = '';
+for my $component ( @components ) {
+my
$packagefile="$mirror_path/$component/debian-installer/binary-$arch/Packages.gz";
+if ( $component eq 'local' and $ENV{LOCALDEBS} ) {
+
$packagefile="$ENV{LOCALDEBS}/dists/$ENV{DI_CODENAME}/local/debian-installer/binary-$arch/Packages.gz";
}
-print OUT "$udeb\n";