r2027 - jhalfs/trunk

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Thu Sep 29 11:50:20 PDT 2005


Author: manuel
Date: 2005-09-29 12:50:18 -0600 (Thu, 29 Sep 2005)
New Revision: 2027

Modified:
   jhalfs/trunk/dump-commands.xsl
   jhalfs/trunk/jhalfs
Log:
Be sure that a clean environmentis used for lfs user in chapter05.

Modified: jhalfs/trunk/dump-commands.xsl
===================================================================
--- jhalfs/trunk/dump-commands.xsl	2005-09-28 20:42:53 UTC (rev 2026)
+++ jhalfs/trunk/dump-commands.xsl	2005-09-29 18:50:18 UTC (rev 2027)
@@ -44,6 +44,10 @@
         <!-- Creating dirs and files -->
       <exsl:document href="{$dirname}/{$order}-{$filename}" method="text">
         <xsl:text>#!/bin/sh&#xA;&#xA;</xsl:text>
+        <xsl:if test="sect2[@role='installation'] and
+            ancestor::chapter[@id='chapter-temporary-tools']">
+          <xsl:text>cd $PKGDIR &&&#xA;</xsl:text>
+        </xsl:if>
         <xsl:apply-templates select=".//para/userinput | .//screen"/>
       </exsl:document>
     </xsl:if>

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2005-09-28 20:42:53 UTC (rev 2026)
+++ jhalfs/trunk/jhalfs	2005-09-29 18:50:18 UTC (rev 2027)
@@ -291,14 +291,26 @@
     # Insert instructions for unpacking the package and changing directories
     echo -e "\t\$(call unpack-lfs,$FILE) && \\" >> $MKFILE.tmp
     echo -e "\tROOT=\`head -n1 /tmp/unpacked | sed 's@/.*@@'\` && \\" >> $MKFILE.tmp
-    echo -e "\tcd \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
+    echo -e "\tchown -R lfs \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
+    echo -e "\techo \"PKGDIR=\$(LFS)\$(SRC)/\$\$ROOT\" > envars && \\" >> $MKFILE.tmp
+    echo -e "\techo \"export PKGDIR\" >> envars && \\" >> $MKFILE.tmp
   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\" && \\" >> $MKFILE.tmp
 
-  # Include a touch of the target name so make can check if it's already been made.
+  # 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.
+  if [ "$vrs" != "" ] ; then
+    echo -e "\trm -r \$(LFS)\$(SRC)/\$\$ROOT && \\" >> $MKFILE.tmp
+    echo -e "\tif [ -e \$(LFS)\$(SRC)/*-build ]; then \\" >> $MKFILE.tmp
+    echo -e "\t\t rm -r \$(LFS)\$(SRC)/*-build; \\" >> $MKFILE.tmp
+    echo -e "\tfi;" >> $MKFILE.tmp
+  fi
+
   done
 
   # Stick a variable and some defines at the top of the real makefile
@@ -318,15 +330,22 @@
   echo -e "chapter5: $chapter5\n" >> $MKFILE
 
   # Clean targets
+  echo "clean:  clean-chapter5 clean-chapter4" >> $MKFILE
+
   echo "clean-chapter4:" >> $MKFILE
   echo -e "\tuserdel lfs && \\" >> $MKFILE
   echo -e "\trm -r /home/lfs && \\" >> $MKFILE
   echo -e "\trm -r \$(LFS)/tools && \\" >> $MKFILE
   echo -e "\trm /tools" >> $MKFILE
-  echo -e "\trm $JHALFSDIR/02*\n" >> $MKFILE
+  echo -e "\trm 02*\n" >> $MKFILE
 
-  # The chapter4 sub-targets are hard-coded to can create the lfs user and
-  # environment, and to make the scripts executables (as part of 021-addinguser).
+  echo "clean-chapter5:" >> $MKFILE
+  echo -e "\trm -r \$(LFS)/tools/* && \\" >> $MKFILE
+  echo -e "\trm -f $chapter5\n" >> $MKFILE
+
+  # The chapter4 sub-targets are hard-coded to can create the lfs user,
+  # 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
@@ -349,7 +368,10 @@
   echo -e "\techo \"LC_ALL=POSIX\" >> /home/lfs/.bashrc && \\" >> $MKFILE
   echo -e "\techo \"PATH=/tools/bin:/bin:/usr/bin\" >> /home/lfs/.bashrc && \\" >> $MKFILE
   echo -e "\techo \"export LFS LC_ALL PATH\" >> /home/lfs/.bashrc && \\" >> $MKFILE
+  # Source the file where we place changing variables.
+  echo -e "\techo \". $JHALFSDIR/envars\" >> /home/lfs/.bashrc && \\" >> $MKFILE
   echo -e "\tchown lfs /home/lfs/.bash* && \\" >> $MKFILE
+  echo -e "\ttouch envars && \\" >> $MKFILE
   echo -e "\ttouch \$@\n" >> $MKFILE
 
 




More information about the alfs-log mailing list