r2036 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sun Oct 2 02:14:03 PDT 2005


Author: manuel
Date: 2005-10-02 03:14:02 -0600 (Sun, 02 Oct 2005)
New Revision: 2036

Modified:
   jhalfs/trunk/dump-commands.xsl
   jhalfs/trunk/jhalfs
Log:
Making the packages dowload and testsuites run optional.
Added a switch to desactivate the automatic run of make.
Fixed some oustanding bugs and chapter05 issues.

Modified: jhalfs/trunk/dump-commands.xsl
===================================================================
--- jhalfs/trunk/dump-commands.xsl	2005-10-01 12:21:30 UTC (rev 2035)
+++ jhalfs/trunk/dump-commands.xsl	2005-10-02 09:14:02 UTC (rev 2036)
@@ -61,7 +61,9 @@
         <xsl:otherwise>
           <xsl:apply-templates select="userinput" mode="screen"/>
           <xsl:if test="position() != last() and
-              not(contains(string(),'EOF'))">
+              not(contains(string(),'EOF')) and
+              not(contains(string(),'check')) and
+              not(ancestor::sect1[@id='ch-tools-stripping'])">
             <xsl:text> &&</xsl:text>
           </xsl:if>
           <xsl:text>&#xA;</xsl:text>
@@ -71,12 +73,12 @@
   </xsl:template>
 
   <xsl:template match="para/userinput">
-    <xsl:if test="$testsuite = '0' and (contains(string(),'test') or
+    <xsl:if test="$testsuite != '0' and (contains(string(),'test') or
         contains(string(),'check'))">
       <xsl:value-of select="substring-before(string(),'make')"/>
       <xsl:text>make -k</xsl:text>
       <xsl:value-of select="substring-after(string(),'make')"/>
-      <xsl:text> &&&#xA;</xsl:text>
+      <xsl:text> &#xA;</xsl:text>
     </xsl:if>
   </xsl:template>
 

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2005-10-01 12:21:30 UTC (rev 2035)
+++ jhalfs/trunk/jhalfs	2005-10-02 09:14:02 UTC (rev 2036)
@@ -22,8 +22,9 @@
                                 DIR/jhalfs
   -D, --download-client=CLIENT  use CLIENT as the program for retrieving
                                 packages
-  -T, --no-testsuites           don't run the package's testsuites
-  -P, --have-packages           don't download the packages
+  -T, --testsuites              run the optional testsuites
+  -P, --get-packages            download the packages
+  -M, --run-make                run make on the generated Makefile
 "
 
 help="\
@@ -79,18 +80,21 @@
       shift
       ;;
 
-    --no-testsuites | -T )
-      shift
+    --testsuites | -T )
       TEST=1
       shift
       ;;
 
-    --have-packages | -P )
-      shift
+    --get-packages | -P )
       HPKG=1
       shift
       ;;
 
+    --run-make | -M )
+      RUNMAKE=1
+      shift
+      ;;
+
     * )
       echo "$usage"
       exit 1
@@ -230,7 +234,7 @@
 get_sources() {
 
   # Test if the packages must be downloaded
-  if [ -z $HPKG ] ; then
+  if [ "$HPKG" = "1" ] ; then
 
     # This variable is necessary to make sure the `cat $JHALFSDIR/packages`
     # separates each iteration by lines.  It is necessary to have the second
@@ -309,8 +313,8 @@
       echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
     fi
 
-    # Dump the path to the Binutils and TCL sources
-    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
+    # Dump the path to the Binutils or TCL sources directory.
+    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" -o "$i" = "036-binutils-pass2" ] ; then
       echo -e "\techo \"\$(LFS)\$(SRC)/\$\$ROOT\" > sources-dir && \\" >> $MKFILE.tmp
     fi
 
@@ -319,7 +323,7 @@
 
     # For the Adjusting phase we must to cd to the binutils-build directory.
     if [ "$i" = "031-adjusting" ] ; then
-      echo -e "\techo \"PKGDIR=\`cat sources-dir\`\" > envars && \\" >> $MKFILE.tmp
+      echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/binutils-build\" > envars && \\" >> $MKFILE.tmp
       echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
     fi
 
@@ -340,33 +344,37 @@
     echo -e "\ttouch \$@" >> $MKFILE.tmp
 
     # Remove the build directory(ies) even if the package build fails, except for
-    # Binutils pass1 and TCL. In that cases the sources directories are removed
+    # Binutils and TCL. In that cases the sources directories are removed
     # only if the build fails.
     if [ "$vrs" != "" ] ; then
-      if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] ; then
+      if [ "$i" != "027-binutils-pass1" ] && [ "$i" != "032-tcl" ] && [ "$i" != "036-binutils-pass2" ] ; then
         echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
         echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
-        echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
-        echo -e "\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
+        echo -e "\tif [ -e \$(LFS)\$(SRC)/$name-build ]; then \\" >> $MKFILE.tmp
+        echo -e "\t\trm -r \$(LFS)\$(SRC)/$name-build; \\" >> $MKFILE.tmp
         echo -e "\tfi;" >> $MKFILE.tmp
       fi
     fi
-    if [ "$i" = "027-binutils-pass1" -o "$i" = "032-tcl" ] ; then
+    if [ "$i" = "027-binutils-pass1" -o "$i" = "036-binutils-pass2" ] ; then
       echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
       echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
       echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
-      echo -e "\t\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
-      echo -e "\t\t\trm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
-      echo -e "\t\tfi;" >> $MKFILE.tmp
+      echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; \\" >> $MKFILE.tmp
       echo -e "\tfi;" >> $MKFILE.tmp
     fi
+    if [ "$i" = "032-tcl" ] ; then
+      echo -e "\tif [ ! -e \$@ ] ; then \\" >> $MKFILE.tmp
+      echo -e "\t\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
+      echo -e "\t\trm -r \$(LFS)\$(SRC)/\$\$ROOT; \\" >> $MKFILE.tmp
+      echo -e "\tfi;" >> $MKFILE.tmp
+    fi
 
-    # Remove the Binutils sources after a sucessfull adjusting phase.
+    # Remove the Binutils pass 1 sources after a sucessfull Adjusting phase.
     if [ "$i" = "031-adjusting" ] ; then
       echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
       echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
-      echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build; && \\" >> $MKFILE.tmp
-      echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
+      echo -e "\t\trm -r \$(LFS)\$(SRC)/binutils-build && \\" >> $MKFILE.tmp
+      echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
       echo -e "\tfi;" >> $MKFILE.tmp
     fi
 
@@ -374,7 +382,7 @@
     if [ "$i" = "033-expect" ] ; then
       echo -e "\tif [ -e \$@ ] ; then \\" >> $MKFILE.tmp
       echo -e "\t\trm -r \`cat sources-dir\` && \\" >> $MKFILE.tmp
-      echo -e "\t\trm sources-dir && \\" >> $MKFILE.tmp
+      echo -e "\t\trm sources-dir; \\" >> $MKFILE.tmp
       echo -e "\tfi;" >> $MKFILE.tmp
     fi
 
@@ -459,11 +467,14 @@
 }
 
 run_make() {
-  # Build the system
-  if [ -e $MKFILE ] ; then
-    echo -ne "Building the LFS system\n"
-    cd $JHALFSDIR && make
-    echo -ne "done\n"
+  # Test if make must be run.
+  if [ "$RUNMAKE" = "1" ] ; then
+    # Build the system
+    if [ -e $MKFILE ] ; then
+      echo -ne "Building the LFS system\n"
+      cd $JHALFSDIR && make
+      echo -ne "done\n"
+    fi
   fi
 }
 




More information about the alfs-log mailing list