r2029 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Thu Sep 29 15:05:02 PDT 2005


Author: manuel
Date: 2005-09-29 16:05:00 -0600 (Thu, 29 Sep 2005)
New Revision: 2029

Modified:
   jhalfs/trunk/jhalfs
Log:
Added logging capabilities.

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2005-09-29 19:14:06 UTC (rev 2028)
+++ jhalfs/trunk/jhalfs	2005-09-29 22:05:00 UTC (rev 2029)
@@ -121,7 +121,8 @@
 HTTP=http://ftp.lfs-matrix.net/pub/lfs/lfs-packages/conglomeration
 if [ -z $BUILDDIR ] ; then BUILDDIR=/mnt/lfs ; fi
 JHALFSDIR=$BUILDDIR/jhalfs
-LOG=build.log
+LOGDIR=$JHALFSDIR/logs
+LOG=000-jhalfs.log
 MKFILE=$JHALFSDIR/Makefile
 XSL=dump-commands.xsl
 if [ -z $TEST ] ; then TEST=0 ; fi
@@ -151,9 +152,9 @@
     fi
   else
     if [ $LFSVRS = development ] ; then
-      svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$JHALFSDIR/$LOG 2>&1
+      svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
     else
-      svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$JHALFSDIR/$LOG 2>&1
+      svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1
     fi
     echo -ne "done\n"
     extract_commands
@@ -172,7 +173,7 @@
 
   # Dump the commands in shell script form from the LFS book.
   xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
-  $XSL lfs-$LFSVRS/index.xml >>$JHALFSDIR/$LOG 2>&1
+  $XSL lfs-$LFSVRS/index.xml >>$LOGDIR/$LOG 2>&1
 
   # Grab the patches and package names.
   cd $JHALFSDIR
@@ -301,7 +302,7 @@
 
     # Insert instructions for unpacking the package and to set
     # the PKGDIR variable.
-    echo -e "\t\$(call unpack-lfs,$FILE) && \\" >> $MKFILE.tmp
+    echo -e "\t\$(call unpack-lfs,$FILE)" >> $MKFILE.tmp
     echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
     echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
@@ -309,13 +310,10 @@
   fi
 
   # Insert the script run
-  echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" && \\" >> $MKFILE.tmp
+  echo -e "\tsu - lfs -c \". /home/lfs/.bashrc && $JHALFSDIR/commands/$file\" >\$(LOGDIR)/$i.log 2>&1 && \\" >> $MKFILE.tmp
 
-  # Include a touch of the target name so make can check
-  # if it's already been made.
-  echo -e "\ttouch \$@" >> $MKFILE.tmp
-
-  # Remove the build directory(ies), including if the build has failed.
+  # Remove the build directory(ies).
+  # (How could it be deleted even if the package build fails?)
   if [ "$vrs" != "" ] ; then
     echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
     echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
@@ -323,11 +321,16 @@
     echo -e "\tfi;" >> $MKFILE.tmp
   fi
 
+  # Include a touch of the target name so make can check
+  # if it's already been made.
+  echo -e "\ttouch \$@" >> $MKFILE.tmp
+
   done
 
-  # Stick a variable and some defines at the top of the real makefile
+  # Stick variables and some defines at the top of the real makefile
   echo "export SRC := /sources" > $MKFILE
   echo "export LFS := $BUILDDIR" >> $MKFILE
+  echo -e "export LOGDIR := $LOGDIR\n" >> $MKFILE
   echo "define unpack-lfs" >> $MKFILE
   echo -e "\t at cd \$(LFS)\$(SRC) ; tar -xvjf \$(1) > /tmp/unpacked" >> $MKFILE
   echo -e "endef\n" >> $MKFILE
@@ -359,8 +362,8 @@
   # to make the scripts executables, and to create a clean environment
   # for the lfs user.
   echo "020-creatingtoolsdir:" >> $MKFILE
-  echo -e "\tmkdir \$(LFS)/tools && \\" >> $MKFILE
-  echo -e "\tln -s \$(LFS)/tools / && \\" >> $MKFILE
+  echo -e "\tmkdir -v \$(LFS)/tools && \\" >> $MKFILE
+  echo -e "\tln -sv \$(LFS)/tools / && \\" >> $MKFILE
   echo -e "\ttouch \$@\n" >> $MKFILE
 
   echo "021-addinguser:" >> $MKFILE
@@ -398,8 +401,12 @@
   mkdir -p $JHALFSDIR
 fi
 
->$JHALFSDIR/$LOG
+if [ ! -d $LOGDIR ] ; then
+  mkdir $LOGDIR
+fi
 
+>$LOGDIR/$LOG
+
 if [ "$PWD" != "$JHALFSDIR" ] ; then
   cp $0 $XSL $JHALFSDIR/
 fi




More information about the alfs-log mailing list