Package: debian-cd
Version: 3.1.12

I've noticed that BDIR is not respected. For example if I change it in the Makefile (I prefer $CODENAME-$ARCH), the build fails when it gets to tools/start_new_disc as that script has it's own hard coded value for BDIR instead of using the one exported by Makefile.

To make things even more interesting the use of the build directory cd variable is inconsistent across the some of the scripts that set it.

Makefile:78:BDIR=$(TDIR)/$(CODENAME)
tools/add-bin-doc:6:BDIR=$TDIR/$CODENAME
tools/create_control:28:BDIR=$TDIR/$CODENAME-$ARCH
tools/make_disc_trees.pl:85:my $bdir = "$tdir/$codename";
tools/make_disc_trees.pl:866: open(AP_LOG, ">> $tdir/$codename/add_packages.log")
tools/sort_deps:34:my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
tools/sort_deps_edu:36:my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
tools/start_new_disc:20:BDIR=$TDIR/$CODENAME

As a side issue, what was SDIR ever used for? I can't find it referenced anywhere.

tools/add-bin-doc:7:SDIR=$TDIR/$CODENAME

Removed it.

I haven't changed tools/create_control as update-cd seems to be the only script that uses it and update-cd does not set BDIR.

Bonus, the following error message gets fixed as the path was wrong:

tools/make_disc_trees.pl:867: || die "Can't write in $tdir/add_packages.log!\n";

I hope the attached patch file is satisfactory.

--
Robert Spencer
--- tools/add-bin-doc~	2013-01-29 18:22:44.000000000 +0000
+++ tools/add-bin-doc	2013-04-25 10:01:02.000000000 +0000
@@ -3,8 +3,9 @@
 #set -x
 set -e
 
-BDIR=$TDIR/$CODENAME
-SDIR=$TDIR/$CODENAME
+if [ -z "$BDIR" ]; then
+	BDIR=$TDIR/$CODENAME
+fi
 DISK=$1
 ARCHES="$2"
 
--- tools/make_disc_trees.pl~	2013-01-22 23:45:23.000000000 +0000
+++ tools/make_disc_trees.pl	2013-04-24 14:41:47.000000000 +0000
@@ -82,7 +82,7 @@
 $use_local = read_env('LOCAL', 0);
 	
 my $list = "$tdir/list";
-my $bdir = "$tdir/$codename";
+my $bdir = "$ENV{'BDIR'}";
 my $log = "$bdir/make_disc_tree.log";
 open(LOG, ">> $log") or die ("Can't open logfile $log for writing: $!\n");
 
@@ -863,8 +863,8 @@
 sub msg_ap {
     my $level = shift;
     if (!$log_opened) {
-        open(AP_LOG, ">> $tdir/$codename/add_packages.log")
-            || die "Can't write in $tdir/add_packages.log!\n";
+        open(AP_LOG, ">> $bdir/add_packages.log")
+            || die "Can't write in $bdir/add_packages.log!\n";
     }
     print AP_LOG @_;
 }
--- tools/sort_deps~	2013-01-24 10:26:30.000000000 +0000
+++ tools/sort_deps	2013-04-24 14:16:29.000000000 +0000
@@ -31,7 +31,7 @@
 my $apt = "$ENV{'BASEDIR'}/tools/apt-selection";
 my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
 my $arch = "$ENV{'ARCH'}";
-my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
+my $dir = "$ENV{'BDIR'}";
 
 my $force_unstable_tasks = read_env('FORCE_SID_TASKSEL', 0);
 my $tasks_packages = read_env('TASKS_PACKAGES',
--- tools/sort_deps_edu~	2012-06-05 13:56:51.000000000 +0000
+++ tools/sort_deps_edu	2013-04-25 10:30:13.000000000 +0000
@@ -33,7 +33,7 @@
 my $apt = "$ENV{'BASEDIR'}/tools/apt-selection";
 my $adir = "$ENV{'APTTMP'}/$ENV{'CODENAME'}-$ENV{'ARCH'}";
 my $arch = "$ENV{'ARCH'}";
-my $dir = "$ENV{'TDIR'}/$ENV{'CODENAME'}";
+my $dir = "$ENV{'BDIR'}";
 
 my @output;
 
--- tools/start_new_disc~	2013-04-01 01:26:54.000000000 +0000
+++ tools/start_new_disc	2013-04-25 09:52:42.000000000 +0000
@@ -17,7 +17,9 @@
 SOURCEDISK=0
 BINARYDISK=0
 
-BDIR=$TDIR/$CODENAME
+if [ -z "$BDIR" ]; then
+    BDIR=$TDIR/$CODENAME
+fi
 CDDIR=$BDIR/CD${DISKNUM}
 DATE=`cat $BDIR/DATE`
 DI_DATA_DIR=$BASEDIR/data/$DI_CODENAME

Reply via email to