From e12ab9e51878f6e72f146f3a07a25d6787909d73 Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Wed, 23 Feb 2011 17:30:27 +0000 Subject: [PATCH] Special-case builds of source-only discs: if we think we've overflowed the disc size, try to carry on for a few more packages to get closer to actually filling the disc. Closes: #613751. --- debian/changelog | 6 +++++- tools/make_disc_trees.pl | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index d9a86f32..2f2bfe33 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,7 +11,11 @@ debian-cd (3.1.6) UNRELEASED; urgency=low squeeze release builds. * Add disk size definitions for 1/2/4/8 GB USB sticks. * Extend the size-override code to allow to override an individual disc - in the set (e.g. to make the first DVD fit on a 4GB USB stick). + in the set (e.g. to make the first DVD fit on a 4GB USB + stick). Closes: #612074 + * Special-case builds of source-only discs: if we think we've + overflowed the disc size, try to carry on for a few more packages + to get closer to actually filling the disc. Closes: #613751. [ Otavio Salvador ] * Add btrfs-tools on required packages by installer. Closes: #612007. diff --git a/tools/make_disc_trees.pl b/tools/make_disc_trees.pl index aad3aa94..23e56226 100755 --- a/tools/make_disc_trees.pl +++ b/tools/make_disc_trees.pl @@ -292,12 +292,20 @@ while (defined (my $pkg = )) { # Put this package first on the next disc push (@overflowlist, $pkg); } - finish_disc($cddir, ""); - - # And reset, to start the next disc - $size = 0; - $disknum++; - undef(@pkgs_added); + # Special-case for source-only discs where we don't care + # about the ordering. If we're doing a source-only build + # and we've overflowed, allow us to carry on down the list + # for a while to fill more space. Stop when we've skipped + # 5 packages (arbitrary choice of number!) #613751 + if (!($archlist eq "source") or (scalar @overflowlist >= 5)) { + finish_disc($cddir, ""); + # And reset, to start the next disc + $size = 0; + $disknum++; + undef(@pkgs_added); + } else { + print LOG "SOURCE DISC: continuing on to see if anything else will fit, " . scalar @overflowlist . " packages on the overflow list at this point\n"; + } } else { $pkgs_this_cd++; $pkgs_done++;