Add support for coping with packages that are too large to fit. If we

have to remove packages and their dependencies, list them in
README.excluded in the root of disc 1.
This commit is contained in:
Steve McIntyre 2009-11-21 00:14:26 +00:00
parent d961fb7e0e
commit 9590c06ddd
5 changed files with 73 additions and 19 deletions

View File

@ -49,6 +49,7 @@ unset SPLASHPNG || true
unset OMIT_MANUAL || true unset OMIT_MANUAL || true
unset OMIT_RELEASE_NOTES || true unset OMIT_RELEASE_NOTES || true
unset OMIT_DOC_TOOLS || true unset OMIT_DOC_TOOLS || true
unset MAX_PKG_SIZE || true
# The debian-cd dir # The debian-cd dir
# Where I am (hoping I'm in the debian-cd dir) # Where I am (hoping I'm in the debian-cd dir)
@ -166,6 +167,12 @@ export ISOLINUX=1
# uncomment this to if you want to see more of what the Makefile is doing # uncomment this to if you want to see more of what the Makefile is doing
#export VERBOSE_MAKE=1 #export VERBOSE_MAKE=1
# The maximum size allowed for an individual package, in bytes; if
# larger than this, it will be excluded (and all dependents, of
# course). We'll create a README.excluded in the root of CD1 listing
# them too
export MAX_PKG_SIZE=600000000
# uncoment this to make build_all.sh try to build a simple CD image if # uncoment this to make build_all.sh try to build a simple CD image if
# the proper official CD run does not work # the proper official CD run does not work
ATTEMPT_FALLBACK=yes ATTEMPT_FALLBACK=yes

10
debian/CONF.sh vendored
View File

@ -49,6 +49,7 @@ unset SPLASHPNG || true
unset OMIT_MANUAL || true unset OMIT_MANUAL || true
unset OMIT_RELEASE_NOTES || true unset OMIT_RELEASE_NOTES || true
unset OMIT_DOC_TOOLS || true unset OMIT_DOC_TOOLS || true
unset MAX_PKG_SIZE || true
# The debian-cd dir # The debian-cd dir
# Where I am (hoping I'm in the debian-cd dir) # Where I am (hoping I'm in the debian-cd dir)
@ -166,6 +167,12 @@ export ISOLINUX=1
# uncomment this to if you want to see more of what the Makefile is doing # uncomment this to if you want to see more of what the Makefile is doing
#export VERBOSE_MAKE=1 #export VERBOSE_MAKE=1
# The maximum size allowed for an individual package, in bytes; if
# larger than this, it will be excluded (and all dependents, of
# course). We'll create a README.excluded in the root of CD1 listing
# them too
export MAX_PKG_SIZE=600000000
# uncoment this to make build_all.sh try to build a simple CD image if # uncoment this to make build_all.sh try to build a simple CD image if
# the proper official CD run does not work # the proper official CD run does not work
ATTEMPT_FALLBACK=yes ATTEMPT_FALLBACK=yes
@ -189,6 +196,9 @@ export DISKTYPE=CD
# included. See tasks/README.tasksel for further info. # included. See tasks/README.tasksel for further info.
export TASK_LANGLIST=tasksel_d-i.languages export TASK_LANGLIST=tasksel_d-i.languages
# Extra variants to enable. See docs/README.variants for more information.
export VARIANTS=
# We don't want certain packages to take up space on CD1... # We don't want certain packages to take up space on CD1...
#export EXCLUDE1=exclude #export EXCLUDE1=exclude
# ...but they are okay for other CDs (UNEXCLUDEx == may be included # ...but they are okay for other CDs (UNEXCLUDEx == may be included

5
debian/changelog vendored
View File

@ -46,6 +46,11 @@ debian-cd (3.1.3) UNRELEASED; urgency=low
from CD. Change is based on SuSE's CD boot. Many thanks to Adam Thornton, from CD. Change is based on SuSE's CD boot. Many thanks to Adam Thornton,
Mark Post and Bastian Blank for providing the pointers to the missing bits. Mark Post and Bastian Blank for providing the pointers to the missing bits.
[ Steve McIntyre ]
* Add support for coping with packages that are too large to fit. If we
have to remove packages and their dependencies, list them in
README.excluded in the root of disc 1.
-- 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

@ -28,6 +28,7 @@ my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
my $arch = "$ENV{'ARCH'}"; my $arch = "$ENV{'ARCH'}";
my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}"; my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
my $verbose = $ENV{'VERBOSE'} || 0; my $verbose = $ENV{'VERBOSE'} || 0;
my $max_pkg_size = $ENV{'MAX_PKG_SIZE'} || 9999999999999;
my @output; my @output;
@ -424,6 +425,7 @@ sub add_package {
my $p = shift; my $p = shift;
my $add_rec = shift; # Do we look for recommends my $add_rec = shift; # Do we look for recommends
my $add_sug = shift; # Do we look for suggests my $add_sug = shift; # Do we look for suggests
my ($ok, $reasons);
msg(2, "+ Trying to add $p...\n"); msg(2, "+ Trying to add $p...\n");
if ($included{$p}) { if ($included{$p}) {
@ -440,12 +442,19 @@ sub add_package {
return; return;
} }
if ($packages{$p}{"Size"} > $max_pkg_size) {
msg(2, "Can't add $p ... too big!\n");
$excluded{$p} = 'toobig';
return;
}
msg(3, " \@dep before checklist = @dep\n"); msg(3, " \@dep before checklist = @dep\n");
# Check if all packages are allowed (fail if one cannot) # Check if all packages are allowed (fail if one cannot)
if (not check_list (\@dep, 1)) { ($ok, $reasons) = check_list (\@dep, 1);
msg(2, "Can't add $p ... one of the package needed has " . if (not $ok) {
"been refused.\n"); msg(2, "Can't add $p ... one of the packages needed has " .
"been refused. Reasons: $reasons\n");
return; return;
} }
@ -456,7 +465,8 @@ sub add_package {
add_recommends (\@dep); add_recommends (\@dep);
# Check again but doesn't fail if one of the package cannot be # Check again but doesn't fail if one of the package cannot be
# installed, just ignore it (it will be removed from @dep) # installed, just ignore it (it will be removed from @dep)
if (not check_list (\@dep, 0)) { ($ok, $reasons) = check_list (\@dep, 0);
if (not $ok) {
msg(0, "UNEXPECTED: It shouldn't fail here !\n"); msg(0, "UNEXPECTED: It shouldn't fail here !\n");
return; return;
} }
@ -468,7 +478,8 @@ sub add_package {
add_suggests (\@dep); add_suggests (\@dep);
# Check again but doesn't fail if one of the package cannot be # Check again but doesn't fail if one of the package cannot be
# installed, just ignore it (it will be removed from @dep) # installed, just ignore it (it will be removed from @dep)
if (not check_list (\@dep, 0)) { ($ok, $reasons) = check_list (\@dep, 0);
if (not $ok) {
msg(0, "UNEXPECTED: It shouldn't fail here !\n"); msg(0, "UNEXPECTED: It shouldn't fail here !\n");
return; return;
} }
@ -658,31 +669,35 @@ sub check_list {
my $fail = shift; my $fail = shift;
my $ok = 1; my $ok = 1;
my @to_remove = (); my @to_remove = ();
my $reasons = "";
foreach (@{$ref}) { foreach (@{$ref}) {
if (not exists $excluded{$_}) { if (not exists $excluded{$_}) {
msg(1," $_ has been refused because it doesn't exist ...\n"); msg(1," $_ has been refused because it doesn't exist ...\n");
$ok = 0; $ok = 0;
push @to_remove, $_; push @to_remove, $_;
$reasons = $reasons . " noexist";
next; next;
} }
if (not accepted($_)) { if (not accepted($_)) {
msg(1," $_ has been refused because of $excluded{$_} ...\n"); msg(1," $_ has been refused because of $excluded{$_} ...\n");
$ok = 0; $ok = 0;
push @to_remove, $_; push @to_remove, $_;
$reasons = $reasons . " " . $excluded{$_};
next; next;
} }
if ($included{$_}) { if ($included{$_}) {
msg(1, msg(1,
" $_ has already been included in CD $included{$_}.\n"); " $_ has already been included in CD $included{$_}.\n");
push @to_remove, $_; push @to_remove, $_;
$reasons = $reasons . " alreadyinc";
next; next;
} }
} }
foreach my $removed (@to_remove) { foreach my $removed (@to_remove) {
msg(2, " Removing $removed ...\n"); msg(2, " Removing $removed ... ($reasons )\n");
@{$ref} = grep { $_ ne $removed } @{$ref}; @{$ref} = grep { $_ ne $removed } @{$ref};
} }
return ($fail ? $ok : 1); return ($fail ? $ok : 1, $reasons);
} }
# Add packages to the output list # Add packages to the output list

View File

@ -253,6 +253,23 @@ if [ $DISKNUM = 1 ] ; then
fi fi
fi fi
done done
# See if we had to remove anything because it was too big. Warn the user.
grep "refused because of toobig" $BDIR/log.sort_deps* | sort -u | awk '{print $1}' > $BDIR/toobig
if [ -s $BDIR/toobig ] ; then
echo " Adding README.excluded (some files were too big)"
echo "For size reasons, the following packages were excluded from this disc set:" > $CDDIR/README.excluded
echo >> $CDDIR/README.excluded
cat $BDIR/toobig >> $CDDIR/README.excluded
grep "Can't add.*toobig" $BDIR/log.sort_deps* | sort -u | awk '{print $3}' > $BDIR/toobig-deps
if [ -s $BDIR/toobig-deps ] ; then
echo >> $CDDIR/README.excluded
echo "and that caused the following packages to be also excluded because" >> $CDDIR/README.excluded
echo "of dependencies:" >> $CDDIR/README.excluded
echo >> $CDDIR/README.excluded
cat $BDIR/toobig-deps >> $CDDIR/README.excluded
fi
fi
fi fi
# Create an empty dirs file; will be appended to later if needed # Create an empty dirs file; will be appended to later if needed