[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[patch] independant local directory



Package: debian-cd
Version: 2.2.0

I needed to put local packages on my CD, but I NFS mount my debian
mirror from elsewhere. It's a company-wide mirror, and screwing around
with it to add a local directory would be wrong. I'm lazy and don't feel
like maintaining a personal mirror just so I can build CD's out of it
(besides, I lack disk space).

So, I patched debian-cd so you can set LOCALDEBS in CONF.sh, and it
will use the directory given there to get local packages from. If
LOCALDEBS isn't set, the behavior doesn't change at all. 

This seems to work fine here, I hope the patch is accepted. The only
really ugly bit is the one line change to add_packages.

diff -ur old/debian-cd-2.2.0/CONF.sh debian-cd-2.2.0/CONF.sh
--- old/debian-cd-2.2.0/CONF.sh	Thu May 18 10:07:28 2000
+++ debian-cd-2.2.0/CONF.sh	Tue Jun 27 12:48:51 2000
@@ -51,6 +51,11 @@
 # 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 -ur old/debian-cd-2.2.0/README debian-cd-2.2.0/README
--- old/debian-cd-2.2.0/README	Thu May 18 10:00:15 2000
+++ debian-cd-2.2.0/README	Tue Jun 27 12:49:31 2000
@@ -180,6 +180,8 @@
 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 -ur old/debian-cd-2.2.0/tools/add_packages debian-cd-2.2.0/tools/add_packages
--- old/debian-cd-2.2.0/tools/add_packages	Fri Jan 21 13:13:23 2000
+++ debian-cd-2.2.0/tools/add_packages	Tue Jun 27 14:44:43 2000
@@ -9,6 +9,7 @@
 }
 
 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";
 
@@ -27,6 +28,9 @@
 	m/^Section: (\S+)/m and $section = $1;
 
 	$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/...
diff -ur old/debian-cd-2.2.0/tools/apt-selection debian-cd-2.2.0/tools/apt-selection
--- old/debian-cd-2.2.0/tools/apt-selection	Tue Mar 14 10:12:18 2000
+++ debian-cd-2.2.0/tools/apt-selection	Tue Jun 27 12:50:11 2000
@@ -59,7 +59,7 @@
 	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 -ur old/debian-cd-2.2.0/tools/cds2src debian-cd-2.2.0/tools/cds2src
--- old/debian-cd-2.2.0/tools/cds2src	Sat Apr  1 11:36:31 2000
+++ debian-cd-2.2.0/tools/cds2src	Tue Jun 27 12:50:11 2000
@@ -25,6 +25,7 @@
 my $verbose = $ENV{'VERBOSE'} || 0;
 
 my $mirror = $ENV{'MIRROR'};
+my $localdebs = $ENV{'LOCALDEBS'} || $mirror;
 my $codename = $ENV{'CODENAME'};
 
 $| = 1;
@@ -65,9 +66,9 @@
 	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 -ur old/debian-cd-2.2.0/tools/scanpackages debian-cd-2.2.0/tools/scanpackages
--- old/debian-cd-2.2.0/tools/scanpackages	Tue Mar  7 09:05:22 2000
+++ debian-cd-2.2.0/tools/scanpackages	Tue Jun 27 12:50:11 2000
@@ -80,8 +80,8 @@
 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 \



Reply to: