From 5d4ff3914e5175684bf4b266e585b6869cf8737b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Tue, 6 Jun 2000 17:19:27 +0000 Subject: [PATCH] * Added support for EXTRANONFREE. Hope it works :-) --- CONF.sh | 6 ++++- Makefile | 6 +++++ README | 4 +++ debian/CONF.sh | 6 ++++- debian/changelog | 3 +++ tools/add_dirs | 6 +++++ tools/apt-selection | 2 +- tools/cds2src | 49 +++++++++++++++++++++++++++++++++--- tools/list2cds | 60 +++++++++++++++++++++++++++++++++++++++++++++ tools/scanpackages | 2 +- tools/scansources | 2 +- 11 files changed, 138 insertions(+), 8 deletions(-) diff --git a/CONF.sh b/CONF.sh index 1cf9fbb7..91ac429c 100644 --- a/CONF.sh +++ b/CONF.sh @@ -43,9 +43,13 @@ export OUT=/rack/debian-cd # This cannot reside on an NFS mount. export APTTMP=/ftp/tmp/apt -# Do I want to have NONFREE +# Do I want to have NONFREE merged in the CD set # export NONFREE=1 +# Do I want to have NONFREE on a separate CD (the last CD of the CD set) +# WARNING: Don't use NONFREE and EXTRANONFREE at the same time ! +# export EXTRANONFREE=1 + # If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with # local packages that you want to put on the CD set then # uncomment the following line diff --git a/Makefile b/Makefile index 23e3ac59..c2f79703 100755 --- a/Makefile +++ b/Makefile @@ -113,6 +113,12 @@ endif ifndef OUT ok=false endif +# Never use NONFREE and EXTRANONFREE at the same time +ifdef NONFREE +ifdef EXTRANONFREE +ok=false +endif +endif default: @echo "Please refer to the README file for more information" diff --git a/README b/README index 42715807..cae9a021 100644 --- a/README +++ b/README @@ -102,6 +102,10 @@ The process of building a CD is decomposed as follow : if you have one) - if NONFREE is set, then packages from non-free will be allowed (NONFREE must be exported to all sub-shells) + - if EXTRANONFREE is set, then non-free packages will be included + on an extra CD (the last CD in fact). Don't use NONFREE and + EXTRANONFREE at the same time ! + (EXTRANONFREE must be exported to all sub-shells) - if COMPLETE is set, all packages that are not listed in the selected task file will be included at the end - if SIZELIMIT is set, it will be used as the maximum size that diff --git a/debian/CONF.sh b/debian/CONF.sh index 092c8cb8..ba033e0f 100644 --- a/debian/CONF.sh +++ b/debian/CONF.sh @@ -38,9 +38,13 @@ export OUT=/home/ftp/debian-cd # This cannot reside on an NFS mount. export APTTMP=/home/ftp/tmp/apt -# Do I want to have NONFREE +# Do I want to have NONFREE merged in the CD set # export NONFREE=1 +# Do I want to have NONFREE on a separate CD (the last CD of the CD set) +# WARNING: Don't use NONFREE and EXTRANONFREE at the same time ! +# export EXTRANONFREE=1 + # If you have a $MIRROR/dists/$CODENAME/local/binary-$ARCH dir with # local packages that you want to put on the CD set then # uncomment the following line diff --git a/debian/changelog b/debian/changelog index 4843efd7..cac05a31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ debian-cd (2.2.1) frozen unstable; urgency=low * Update for m68k, they should at least build now. * Include upgrade-{i386,sparc,alpha,m68k} dir when available. * Updated README.html.in (new version provided by Anne Bezemer). + * Added EXTRANONFREE support. It allows to generate an extra non-free CD. + The first CDs are totally free and the last(s) CD(s) contains + only non-free and possibly some files from contrib. -- Raphael Hertzog Sat, 20 May 2000 23:42:58 +0200 diff --git a/tools/add_dirs b/tools/add_dirs index 54fa47fc..4f65588f 100755 --- a/tools/add_dirs +++ b/tools/add_dirs @@ -8,6 +8,12 @@ SECTIONS="admin base comm devel doc editors electronics games graphics \ set -e +# There's no difference between NONFREE and EXTRANONFREE for this script +if [ -n "$EXTRANONFREE" ] +then + NONFREE=1 +fi + cd $1 ln -sf . debian diff --git a/tools/apt-selection b/tools/apt-selection index 08ca0c62..d02de485 100755 --- a/tools/apt-selection +++ b/tools/apt-selection @@ -27,7 +27,7 @@ options=" -o Dir::State::status=$APTTMP/$CODENAME-$ARCH/status \ -o Dir::Etc=$APTTMP/$CODENAME-$ARCH/apt/ \ -o APT::Architecture=$ARCH " -if [ -n "$NONFREE" ]; then +if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then sections="main contrib non-free" else sections="main contrib" diff --git a/tools/cds2src b/tools/cds2src index cd1b5d88..2fad438f 100755 --- a/tools/cds2src +++ b/tools/cds2src @@ -14,7 +14,8 @@ use strict; my $deflimit = $ENV{'SRCSIZELIMIT'} || $ENV{'SIZELIMIT'} || shift || 629145600; my $limit = $ENV{'SRCSIZELIMIT1'} || $deflimit; -my $nonfree = $ENV{'NONFREE'}; +my $nonfree = $ENV{'NONFREE'} || 0; +my $extranonfree = $ENV{'EXTRANONFREE'} || 0; my $nonus = $ENV{'NONUS'} || 0; my $complete = $ENV{'COMPLETE'} || 0; my $local = $ENV{'LOCAL'} || 0; @@ -42,6 +43,7 @@ sub msg { my %bin2src; my %sources; my %included; +my %excluded; # Get the information from the good Sources.gz files my @SOURCES = ("$mirror/dists/$codename/main/source/Sources.gz", @@ -52,7 +54,7 @@ if ($nonus and ($codename ne "slink")) { "$nonus/dists/$codename/non-US/main/source/Sources.gz", "$nonus/dists/$codename/non-US/contrib/source/Sources.gz"; } -if ($nonfree) { +if ($nonfree or $extranonfree) { push @SOURCES, "$mirror/dists/$codename/non-free/source/Sources.gz"; if ($nonus and ($codename ne "slink")) { push @SOURCES, @@ -88,6 +90,19 @@ while (defined($_ = )) { (m/^$re: (.*?)\s*$/m and $sources{$p}{$re} = $1) || msg(1, "Header field '$re' missing for source '$p'\n"); } + # Avoid a perl warning for sources packages without section header + if (! exists $sources{$p}{"Section"}) + { + $sources{$p}{"Section"} = "No section"; + } + # Generate the list of non-free source packages to exclude + if ((! $nonfree) and ($sources{$p}{"Section"} =~ /non-free/)) + { + $excluded{$p} = "nonfree"; + } else { + $excluded{$p} = 0; + } + # Match between source & binary packages foreach $bin (split (/,\s+/, $sources{$p}{"Binary"})) { $bin2src{$bin} = $p; } @@ -135,6 +150,7 @@ foreach $p (@list) { msg(0, "ERROR: Source `$src' does not exist ... (ignored)\n"); next; } + next if $excluded{$src}; next if $included{$src}; add_src ($src); } @@ -143,11 +159,38 @@ if ($complete) { msg(0, "Now we'll add the sources not yet included ...\n"); foreach $p (sort { ($sources{$a}{"Section"} cmp $sources{$b}{"Section"}) || ($a cmp $b) } - grep { not $included{$_} } keys %sources) + grep { not ($included{$_} or $excluded{$_}) } keys %sources) { add_src ($p); } +} +msg(0, "CD $cd will only be filled with $cd_size bytes ...\n"); +# Now generate the extra non-free CD +if ($extranonfree and (! $nonfree)) +{ + my ($p, @toinclude); + + # Finally accept non-free packages + foreach $p (grep { $excluded{$p} eq "nonfree" } (keys %sources)) + { + $excluded{$p} = 0; + push @toinclude, $p; + } + + # Start a new CD + $cd++; + $cd_size = 0; + $limit = $ENV{"SRCSIZELIMIT$cd"} || $deflimit; + msg(0, "Limit for non-free source CD $cd is $limit.\n"); + + # Include non-free source packages + foreach $p (@toinclude) + { + add_src ($p); + } + + msg(0, "CD $cd will only be filled with $cd_size bytes ...\n"); } # Now write the lists down diff --git a/tools/list2cds b/tools/list2cds index 2b431445..be115db1 100755 --- a/tools/list2cds +++ b/tools/list2cds @@ -15,6 +15,7 @@ my $deflimit = $ENV{'SIZELIMIT'} || shift || 639631360; my $limit = $ENV{'SIZELIMIT1'} || $deflimit; my $nonfree = $ENV{'NONFREE'} || 0; +my $extranonfree = $ENV{'EXTRANONFREE'} || 0; my $nonus = $ENV{'NONUS'} || 0; my $local = $ENV{'LOCAL'} || 0; my $complete = $ENV{'COMPLETE'} || 0; @@ -210,6 +211,65 @@ if ($complete) { } msg(0, "CD $cd will only be filled with $cd_size bytes ...\n"); +# Now select the non-free packages for an extra CD +if ($extranonfree and (! $nonfree)) +{ + my ($p, @toinclude); + + # Finally accept non-free packages ... + foreach $p (grep { $excluded{$_} eq "nonfree" } (keys %excluded)) + { + $excluded{$p} = 0; + push @toinclude, $p; + } + + # Start a new CD + $cd++; + $cd_size = 0; + $limit = $ENV{"SIZELIMIT$cd"} || $deflimit; + msg(0, "Limit for non-free CD $cd is $limit.\n"); + + # Include non-free packages + foreach $p (@toinclude) + { + add_package($p, 1); + } + + # If a contrib package was listed in the list of packages to + # include and if COMPLETE=0 there's a chance that the package + # will not get included in any CD ... so I'm checking the complete + # list again + open (LIST, "< $list") || die "Can't open $list : $!\n"; + while (defined($_=)) { + chomp; + next if m/^\s*$/; + next if $included{$_}; + next if $excluded{$_}; + if (not exists $packages{$_}) { + msg(1, "WARNING: '$_' does not appear to be available ... " . + "(ignored)\n"); + next; + } + add_package ($_, 1); + } + close LIST; + + # Try to include other packages that could not be included + # before (because they depends on excluded non-free packages) + if ($complete) + { + foreach $p (sort { ($packages{$a}{"Section"} + cmp $packages{$b}{"Section"}) || ($a cmp $b) } + grep { not ($included{$_} or $excluded{$_}) } + keys %packages) + { + add_package ($p, 0); + } + } + + msg(0, "CD $cd will only be filled with $cd_size bytes ...\n"); +} + # Remove old files foreach (glob("$dir/*.packages")) { unlink $_; diff --git a/tools/scanpackages b/tools/scanpackages index 2bd21e35..60383ec4 100755 --- a/tools/scanpackages +++ b/tools/scanpackages @@ -11,7 +11,7 @@ PREFIX=$2 NUM=${PREFIX##$TDIR/$CODENAME-$ARCH/} -if [ -n "$NONFREE" ]; then +if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then SECTIONS="main contrib non-free" else SECTIONS="main contrib" diff --git a/tools/scansources b/tools/scansources index d336c942..9ce8d381 100755 --- a/tools/scansources +++ b/tools/scansources @@ -9,7 +9,7 @@ set -e PREFIX=$1 -if [ -n "$NONFREE" ]; then +if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then SECTIONS="main contrib non-free" else SECTIONS="main contrib"