From 898a7e92f8957a9c30d8b3b9ee8ebf0d6ce5a039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Fri, 30 Jun 2000 00:04:03 +0000 Subject: [PATCH] * Patch from Joey Hess for LOCALDEBS. * Patch from Michael Schlueter for a bugfix related to forcenonusoncd1. * Patch from myself : s/*.packages/?.packages/ in tools/scanpackages ! It's a problem that appeared with the use of FORCENONUSONCD1 and LOCAL. --- CONF.sh | 5 +++++ Makefile | 5 ++++- README | 2 ++ debian/CONF.sh | 5 +++++ debian/changelog | 3 +++ tools/add_packages | 4 ++++ tools/apt-selection | 2 +- tools/cds2src | 5 +++-- tools/scanpackages | 8 ++++---- 9 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CONF.sh b/CONF.sh index dec6d72c..97588882 100644 --- a/CONF.sh +++ b/CONF.sh @@ -60,6 +60,11 @@ export APTTMP=/ftp/tmp/apt # uncomment the following line # export LOCAL=1 +# If your local packages are not under $MIRROR, but somewhere else, +# you can uncomment this line and edit to to point to a directory +# containing dists/$CODENAME/local/binary-$ARCH +# export LOCALDEBS=/home/joey/debian/va/debian + # Sparc only : bootdir (location of cd.b and second.b) # export BOOTDIR=/boot diff --git a/Makefile b/Makefile index 82ba60bb..20629a29 100755 --- a/Makefile +++ b/Makefile @@ -78,6 +78,9 @@ SDIR=$(TDIR)/$(CODENAME)-src FIRSTDISKS=CD1 ifdef FORCENONUSONCD1 FIRSTDISKS=CD1 CD1_NONUS +forcenonusoncd1=1 +else +forcenonusoncd1=0 endif ## DEBUG STUFF ## @@ -294,7 +297,7 @@ ifdef FORCENONUSONCD1 endif @perl -npe 's/\@ARCH\@/$(ARCH)/g' $(TASK) | \ cpp -nostdinc -nostdinc++ -P -undef -D ARCH=$(ARCH) -D ARCH_$(ARCH) \ - -DFORCENONUSONCD1=$(FORCENONUSONCD1) \ + -DFORCENONUSONCD1=$(forcenonusoncd1) \ -I $(BASEDIR)/tasks -I $(BDIR) - - >> $(BDIR)/rawlist ## DIRECTORIES && PACKAGES && INFOS ## diff --git a/README b/README index dac40eb3..77d5f355 100644 --- a/README +++ b/README @@ -194,6 +194,8 @@ include sources). To include local packages, the LOCAL environment variable must be set to "1" while building the CDs. +You can also set the LOCALDEBS environment variable, and it will be used +instead of MIRROR when looking for local packages. Additionnal targets =================== diff --git a/debian/CONF.sh b/debian/CONF.sh index ba033e0f..1ac4c4cd 100644 --- a/debian/CONF.sh +++ b/debian/CONF.sh @@ -50,6 +50,11 @@ export APTTMP=/home/ftp/tmp/apt # uncomment the following line # export LOCAL=1 +# If your local packages are not under $MIRROR, but somewhere else, +# you can uncomment this line and edit to to point to a directory +# containing dists/$CODENAME/local/binary-$ARCH +# export LOCALDEBS=/home/joey/debian/va/debian + # Sparc only : bootdir (location of cd.b and second.b) # export BOOTDIR=/boot diff --git a/debian/changelog b/debian/changelog index 90630388..f5ef3d93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ debian-cd (2.2.1) frozen unstable; urgency=low CD#1 of the set. We then make 2 copies of this, one with non-US and one without. Useful for people wanting to create non-US and US-safe CDs without having to spend so much disk space. + * Added patch from Joey Hess for LOCALDEBS support. Closes: #66447 + * Added patch from Michael Schlueter (corrected cpp call when + FORCENONUSONCD1 was not used) -- Raphael Hertzog Sat, 20 May 2000 23:42:58 +0200 diff --git a/tools/add_packages b/tools/add_packages index 10eb38e2..85ae61fd 100755 --- a/tools/add_packages +++ b/tools/add_packages @@ -9,6 +9,7 @@ if (! -d $dir) { } my $mirror = $ENV{'MIRROR'} || die "Set the MIRROR var ...\n"; +my $localdebs = $ENV{'LOCALDEBS'} || $mirror; my $nonus = $ENV{'NONUS'} || ''; my $basedir = $ENV{'BASEDIR'} || die "Set the BASEDIR var ...\n"; @@ -28,6 +29,9 @@ while (defined($_ = )) { $source = ($section =~ /non-US/) ? $nonus : $mirror; + # This is a hack to allow the local debs to be located elsewhere. + $source=$localdebs if $file=~m:local/:; + # If arch=all and filename is a symbolic link # we suppose that the link points to .../binary-all/... # and we reproduce a similar setup on the CD diff --git a/tools/apt-selection b/tools/apt-selection index d02de485..aec84c68 100755 --- a/tools/apt-selection +++ b/tools/apt-selection @@ -59,7 +59,7 @@ if [ ! -e "$APTTMP/$CODENAME-$ARCH/apt/sources.list" ]; then fi # Local packages ... if [ -n "$LOCAL" ]; then - echo "deb file:$MIRROR $CODENAME local" \ + echo "deb file:${LOCALDEBS:-MIRROR} $CODENAME local" \ >> $APTTMP/$CODENAME-$ARCH/apt/sources.list fi fi diff --git a/tools/cds2src b/tools/cds2src index 51cbbe2e..96eed725 100755 --- a/tools/cds2src +++ b/tools/cds2src @@ -27,6 +27,7 @@ my $sdir = "$ENV{'TDIR'}/$ENV{'CODENAME'}-src"; my $verbose = $ENV{'VERBOSE'} || 0; my $mirror = $ENV{'MIRROR'}; +my $localdebs = $ENV{'LOCALDEBS'} || $mirror; my $codename = $ENV{'CODENAME'}; $| = 1; @@ -70,9 +71,9 @@ if ($nonus and ($codename eq "slink")) { push @SOURCES, "$nonus/dists/$codename/non-US/source/Sources.gz"; } -if ($local and -e "$mirror/dists/$codename/local/source/Sources.gz") +if ($local and -e "$localdebs/dists/$codename/local/source/Sources.gz") { - push @SOURCES, "$mirror/dists/$codename/local/source/Sources.gz"; + push @SOURCES, "$localdebs/dists/$codename/local/source/Sources.gz"; } foreach (@SOURCES) { diff --git a/tools/scanpackages b/tools/scanpackages index fbd3f142..fb9c2a72 100755 --- a/tools/scanpackages +++ b/tools/scanpackages @@ -74,7 +74,7 @@ if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then >dists/$CODENAME/non-US/binary-$ARCH/Packages grep -v ^X-Medium $PREFIX.Packages-non-US | gzip --best \ >dists/$CODENAME/non-US/binary-$ARCH/Packages.gz - for i in $TDIR/$CODENAME-$ARCH/*.packages; do + for i in $TDIR/$CODENAME-$ARCH/?.packages; do dir=${i%%.packages} n=${dir##$TDIR/$CODENAME-$ARCH/} if [ $n -le $NUM ]; then @@ -87,8 +87,8 @@ if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then fi if [ -n "$LOCAL" ]; then - if [ -e $MIRROR/dists/$CODNAME/local/binary-$ARCH/Release ]; then - cp $MIRROR/dists/$CODENAME/local/binary-$ARCH/Release \ + if [ -e ${LOCALDEBS:-MIRROR}/dists/$CODNAME/local/binary-$ARCH/Release ]; then + cp ${LOCALDEBS:-MIRROR}/dists/$CODENAME/local/binary-$ARCH/Release \ dists/$CODENAME/local/binary-$ARCH/ fi grep -v ^X-Medium $PREFIX.Packages-local \ @@ -96,7 +96,7 @@ if [ -n "$LOCAL" ]; then grep -v ^X-Medium $PREFIX.Packages-local | gzip --best \ >dists/$CODENAME/local/binary-$ARCH/Packages.gz - for i in $TDIR/$CODENAME-$ARCH/*.packages; do + for i in $TDIR/$CODENAME-$ARCH/?.packages; do dir=${i%%.packages} n=${dir##$TDIR/$CODENAME-$ARCH/} if [ $n -le $NUM ]; then