* Cope with rolling back more than one package in case we go well

over the disc size
  * Use a multiplier of 1.2 for HFS space - overkill, but it fixes
    the multi-arch DVD overflowing. Also log if we're doing HFS.
  * Tweak where we look for s390 boot files to make the weeklies work again.
This commit is contained in:
Steve McIntyre 2007-02-27 20:05:32 +00:00
parent a2d9587f1a
commit 2ca98a7f32
4 changed files with 36 additions and 25 deletions

7
debian/changelog vendored
View File

@ -26,6 +26,13 @@ debian-cd (3.0.1) UNRELEASED; urgency=low
and set_mkisofs_opts.
* Make sure "make mirrorcheck" has been called before "make images".
[ Steve McIntyre ]
* Cope with rolling back more than one package in case we go well
over the disc size
* Use a multiplier of 1.2 for HFS space - overkill, but it fixes
the multi-arch DVD overflowing. Also log if we're doing HFS.
* Tweak where we look for s390 boot files to make the weeklies work again.
-- Raphael Hertzog <hertzog@debian.org> Wed, 21 Feb 2007 12:30:27 +0100
debian-cd (3.0.0) unstable; urgency=medium

View File

@ -347,13 +347,14 @@ sub add_packages {
$total_blocks -= remove_md5_entry($dir, $arch, $_);
foreach my $file (@files) {
my $missing = 0;
# Count how big the file is we're removing, for checking if the disc is full
$realfile = real_file ("$source/$file");
$total_blocks -= get_file_blocks($realfile);
# Remove the link
unlink ("$dir/$file") or die "Failed to remove $dir/$file\n";
msg_ap(0, " Rollback: removing $dir/$file\n");
unlink ("$dir/$file") || msg_ap(0, "Couldn't delete file $dir/$file\n");
msg_ap(0, " Rollback: removed $dir/$file\n");
}
} else {
$total_blocks += add_Packages_entry($dir, $arch, $_);

View File

@ -31,7 +31,7 @@ fi
if [ "$DI_WWW_HOME" = "default" ];then
DI_WWW_HOME="https://lophos.multibuild.org/d-i/images/daily"
if [ -n "$DI_DIR" ];then
if [ -n "$DI_DIR" -a -e "$DI_DIR/~${DI_WWW_HOME#*~}" ] ; then
DI_DIR="$DI_DIR/~${DI_WWW_HOME#*~}"
DI_WWW_HOME=""
fi

View File

@ -12,10 +12,10 @@ use File::Find;
my ($basedir, $mirror, $tdir, $codename, $archlist, $mkisofs, $maxcds);
my $mkisofs_opts = "";
my $mkisofs_dirs = "";
my (@arches, @arches_nosrc, $overflowpkg);
my (@arches, @arches_nosrc, @overflowlist, @pkgs_added);
my (@exclude_packages, @unexclude_packages, @excluded_package_list);
undef $overflowpkg;
undef @pkgs_added;
undef @exclude_packages;
undef @unexclude_packages;
undef @excluded_package_list;
@ -100,8 +100,9 @@ $cddir = "$bdir/CD$disknum";
get_disc_size();
# Space calculation for extra HFS crap
if ($archlist =~ /m68k/ || $archlist =~ /powerpc/) {
$hfs_mult = 1.1;
$hfs_mult = 1.2;
$hfs_extra = int($maxdiskblocks * 8 / $blocksize);
print LOG "arches require HFS hybrid, multiplying sizes by $hfs_mult and marking $hfs_extra blocks for HFS use\n";
}
print "Starting to lay out packages into $disktype ($diskdesc) images: $maxdiskblocks 2K-blocks maximum per image\n";
@ -169,15 +170,14 @@ while (defined (my $pkg = <INLIST>)) {
}
}
}
if (defined($overflowpkg)) {
print LOG "Adding the package that failed on the last disc: $overflowpkg\n";
$guess_size = int($hfs_mult * add_packages($cddir, $overflowpkg));
$size += $guess_size;
print LOG "CD $disknum: GUESS_TOTAL is $size after adding $overflowpkg\n";
undef $overflowpkg;
$pkgs_this_cd++;
$pkgs_done++;
while (scalar @overflowlist) {
my $overflowpkg = pop @overflowlist;
print LOG "Adding a package that failed on the last disc: $overflowpkg\n";
$guess_size = int($hfs_mult * add_packages($cddir, $overflowpkg));
$size += $guess_size;
print LOG "CD $disknum: GUESS_TOTAL is $size after adding $overflowpkg\n";
$pkgs_this_cd++;
$pkgs_done++;
}
}
@ -186,6 +186,7 @@ while (defined (my $pkg = <INLIST>)) {
} else {
$guess_size = int($hfs_mult * add_packages($cddir, $pkg));
$size += $guess_size;
push (@pkgs_added, $pkg);
print LOG "CD $disknum: GUESS_TOTAL is $size after adding $pkg\n";
if (($size > $maxdiskblocks) ||
(($size > $size_swap_check) &&
@ -196,20 +197,22 @@ while (defined (my $pkg = <INLIST>)) {
print LOG "CD $disknum: Real current size is $size blocks after adding $pkg\n";
}
if ($size > $maxdiskblocks) {
print LOG "CD $disknum over-full ($size > $maxdiskblocks). Rollback!\n";
$guess_size = int($hfs_mult * add_packages("--rollback", $cddir, $pkg));
$size=`$size_check $cddir`;
chomp $size;
print LOG "CD $disknum: Real current size is $size blocks after rolling back $pkg\n";
while ($size > $maxdiskblocks) {
$pkg = pop(@pkgs_added);
print LOG "CD $disknum over-full ($size > $maxdiskblocks). Rollback!\n";
$guess_size = int($hfs_mult * add_packages("--rollback", $cddir, $pkg));
$size=`$size_check $cddir`;
chomp $size;
print LOG "CD $disknum: Real current size is $size blocks after rolling back $pkg\n";
# Put this package first on the next disc
push (@overflowlist, $pkg);
}
finish_disc($cddir, "");
# Put this package first on the next disc
$overflowpkg = $pkg;
# And reset, to start the next disc
$size = 0;
$disknum++;
undef(@pkgs_added);
} else {
$pkgs_this_cd++;
$pkgs_done++;
@ -391,7 +394,7 @@ sub get_disc_size {
# How full should we let the disc get before we stop estimating and
# start running mkisofs?
$size_swap_check = $maxdiskblocks - (40 * $MB / $blocksize);
$size_swap_check = $maxdiskblocks - (40 * $MB / $blocksize);
}
sub start_disc {