Author: pierre
Date: Wed Mar 15 14:06:17 2017
New Revision: 3919

Log:
Merge new_features rev 3918

Modified:
   jhalfs/trunk/BLFS/envars.conf
   jhalfs/trunk/BLFS/xsl/scripts.xsl
   jhalfs/trunk/Config.in
   jhalfs/trunk/install-blfs-tools.sh

Modified: jhalfs/trunk/BLFS/envars.conf
==============================================================================
--- jhalfs/trunk/BLFS/envars.conf       Wed Mar 15 14:00:31 2017        (r3918)
+++ jhalfs/trunk/BLFS/envars.conf       Wed Mar 15 14:06:17 2017        (r3919)
@@ -10,15 +10,23 @@
 
 #======== Common envars ==========
 
-#--- The sources directory.
-#    This directory contains sub directories (one for each package), where
-#    packages are stored, unpacked, and compiled.
-export SRC_DIR=/sources
-
-#--- The local repository for packages/file
-#    Any missing file will be downloaded and archived here,
-#    if the user has the right priviledges. Can be the same as SRC_DIR
+#--- The build directory:
+#    - If BUILD_SUBDIRS is set, this directory contains sub directories
+#      (one for each package), where packages are unpacked, and compiled.
+#    - If BUILD_SUBDIRS is unset, packages are unpacked, and compiled directly
+#      in $BUILD_ROOT.
+export BUILD_ROOT=/sources
+export BUILD_SUBDIRS=1
+
+#--- The local repository for packages/file:
+#    Any missing file will be downloaded and archived either:
+#    - into a subdirectory (one for each page of the book) fo this directory,
+#      if SRC_SUBDIRS is set.
+#    - directly into this directory if SRC_SUBDIRS is unset.
+#    This directory can be the same as $BUILD_ROOT, provided BUILD_SUBDIRS
+#    and SRC_SUBDIRS are different.
 export SRC_ARCHIVE=/sources
+unset  SRC_SUBDIRS
 
 #--- Set a well-known working locale when building software
 # Note that an UTF-8 locale may be needed for some packages,
@@ -27,7 +35,7 @@
 # sourced at the end of this file.
 export LC_ALL=C
 
-#--- Server used if the file isn't found in SRC_ARCHIVE or SRC_DIR,
+#--- Server used if the file isn't found in SRC_DIR,
 # and cannot be downloaded from upstream.
 #
 # The server path MUST be set as listed in
@@ -35,6 +43,12 @@
 # Note that despite the name of the variable, it can be an http url.
 export FTP_SERVER=http://ftp.osuosl.org/pub/blfs/
 
+#--- Keep the buid directory to examine it:
+#    If KEEP_FILES is unset, the extracted tarball is removed after build.
+#    Otherwise, the build tree is kept for later study.
+#export KEEP_FILES=1
+unset KEEP_FILES
+
 ### Currently not used in scripts ###
 # Use a server close to you for Xorg (see http://wiki.x.org/wiki/Mirrors)
 # export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/

Modified: jhalfs/trunk/BLFS/xsl/scripts.xsl
==============================================================================
--- jhalfs/trunk/BLFS/xsl/scripts.xsl   Wed Mar 15 14:00:31 2017        (r3918)
+++ jhalfs/trunk/BLFS/xsl/scripts.xsl   Wed Mar 15 14:06:17 2017        (r3919)
@@ -72,11 +72,18 @@
             <!-- We build in a subdirectory -->
             <xsl:text>PKG_DIR=</xsl:text>
             <xsl:value-of select="$filename"/>
-            <xsl:text>&#xA;</xsl:text>
+            <xsl:text>
+SRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${PKG_DIR}}
+BUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${PKG_DIR}}
+mkdir -p $SRC_DIR
+mkdir -p $BUILD_DIR
+
+</xsl:text>
             <!-- Download code and build commands -->
             <xsl:apply-templates select="sect2"/>
             <!-- Clean-up -->
-            <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
+            <xsl:text>cd $BUILD_DIR
+[[ -n "$KEEP_FILES" ]] || </xsl:text>
             <!-- In some case, some files in the build tree are owned
                  by root -->
             <xsl:if test="$sudo='y'">
@@ -99,8 +106,8 @@
   <xsl:template match="sect2">
     <xsl:choose>
       <xsl:when test="@role = 'package'">
-        <xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
-        <xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
+        <xsl:text>cd $SRC_DIR
+</xsl:text>
         <!-- Download information is in bridgehead tags -->
         <xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
         <xsl:text>&#xA;</xsl:text>
@@ -110,6 +117,7 @@
       </xsl:when>
       <xsl:when test="@role = 'installation'">
         <xsl:text>
+cd $BUILD_DIR
 find . -maxdepth 1 -mindepth 1 -type d | xargs </xsl:text>
         <xsl:if test="$sudo='y'">
           <xsl:text>sudo </xsl:text>
@@ -117,21 +125,21 @@
         <xsl:text>rm -rf
 case $PACKAGE in
   *.tar.gz|*.tar.bz2|*.tar.xz|*.tgz|*.tar.lzma)
-     tar -xvf $PACKAGE &gt; unpacked
+     tar -xvf $SRC_DIR/$PACKAGE &gt; unpacked
      UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^\./@@;s@/.*@@'`
      ;;
   *.tar.lz)
-     bsdtar -xvf $PACKAGE 2&gt; unpacked
+     bsdtar -xvf $SRC_DIR/$PACKAGE 2&gt; unpacked
      UNPACKDIR=`head -n1 unpacked | cut  -d" " -f2 | sed 's@^\./@@;s@/.*@@'`
      ;;
   *.zip)
-     zipinfo -1 $PACKAGE &gt; unpacked
+     zipinfo -1 $SRC_DIR/$PACKAGE &gt; unpacked
      UNPACKDIR="$(sed 's@/.*@@' unpacked | uniq )"
      if test $(wc -w &lt;&lt;&lt; $UNPACKDIR) -eq 1; then
-       unzip $PACKAGE
+       unzip $SRC_DIR/$PACKAGE
      else
        UNPACKDIR=${PACKAGE%.zip}
-       unzip -d $UNPACKDIR $PACKAGE
+       unzip -d $UNPACKDIR $SRC_DIR/$PACKAGE
      fi
      ;;
   *)
@@ -214,7 +222,9 @@
     <xsl:text>&#xA;if [[ ! -f $</xsl:text>
     <xsl:value-of select="$varname"/>
     <xsl:text> ]] ; then&#xA;</xsl:text>
-    <!-- SRC_ARCHIVE may have subdirectories or not -->
+    <!-- This whole code becomes obsolete because now, it is there or we
+         download; keeping for now, and we may want to grab it from
+         SRC_ARCHIVE when SRC_SUBDIRS is set...
     <xsl:text>  if [[ -f $SRC_ARCHIVE/$PKG_DIR/$</xsl:text>
     <xsl:value-of select="$varname"/>
     <xsl:text> ]] ; then&#xA;</xsl:text>
@@ -230,29 +240,29 @@
     <xsl:value-of select="$varname"/>
     <xsl:text> $</xsl:text>
     <xsl:value-of select="$varname"/>
-    <xsl:text>&#xA;  else&#xA;</xsl:text>
+    <xsl:text>&#xA;  else&#xA;</xsl:text> -->
     <!-- Download from upstream http -->
     <xsl:if test="string-length($httpurl) &gt; 10">
-      <xsl:text>    wget -T 30 -t 5 </xsl:text>
+      <xsl:text>  wget -T 30 -t 5 </xsl:text>
       <xsl:value-of select="$httpurl"/>
       <xsl:text> ||&#xA;</xsl:text>
     </xsl:if>
     <!-- Download from upstream ftp -->
     <xsl:if test="string-length($ftpurl) &gt; 10">
-      <xsl:text>    wget -T 30 -t 5 </xsl:text>
+      <xsl:text>  wget -T 30 -t 5 </xsl:text>
       <xsl:value-of select="$ftpurl"/>
       <xsl:text> ||&#xA;</xsl:text>
     </xsl:if>
     <!-- The FTP_SERVER mirror as a last resort -->
-    <xsl:text>    wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
+    <xsl:text>  wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text>
     <xsl:value-of select="$first_letter"/>
     <xsl:text>/$</xsl:text>
     <xsl:value-of select="$varname"/>
     <xsl:text>
-    cp $</xsl:text>
+<!--    cp $</xsl:text>
     <xsl:value-of select="$varname"/>
     <xsl:text> $SRC_ARCHIVE
-  fi
+  fi-->
 fi
 </xsl:text>
     <xsl:if test="string-length($md5) &gt; 10">
@@ -263,6 +273,15 @@
       <xsl:text>" | md5sum -c -
 </xsl:text>
     </xsl:if>
+<!-- link additional packages into $BUILD_DIR, because they are supposed to
+     be there-->
+    <xsl:if test="string($varname) != 'PACKAGE'">
+      <xsl:text>
+[[ "$SRC_DIR" != "$BUILD_DIR" ]] &amp;&amp; ln -sf $SRC_DIR/$</xsl:text>
+      <xsl:value-of select="$varname"/>
+      <xsl:text> $BUILD_DIR
+</xsl:text>
+    </xsl:if>
   </xsl:template>
 
   <!-- Extract the MD5 sum information -->

Modified: jhalfs/trunk/Config.in
==============================================================================
--- jhalfs/trunk/Config.in      Wed Mar 15 14:00:31 2017        (r3918)
+++ jhalfs/trunk/Config.in      Wed Mar 15 14:06:17 2017        (r3919)
@@ -39,10 +39,26 @@
                 to build BLFS packages.
     endchoice
 
+    choice
+    depends BOOK_BLFS
+    prompt "Init system"
+
+        config BLFS_SYSV
+        bool "BLFS Sys V"
+        help
+            Extract the Sys V flavour of the BLFS book
+
+        config BLFS_SYSD
+        bool "BLFS systemd"
+        help
+            Extract the systemd flavour of the BLFS book
+
+    endchoice
+
     config    INITSYS
         string
-        default "sysv"         if BOOK_LFS
-        default "systemd"      if BOOK_LFS_SYSD
+        default "sysv"         if BOOK_LFS || BLFS_SYSV
+        default "systemd"      if BOOK_LFS_SYSD || BLFS_SYSD
 
     config    PROGNAME
         string

Modified: jhalfs/trunk/install-blfs-tools.sh
==============================================================================
--- jhalfs/trunk/install-blfs-tools.sh  Wed Mar 15 14:00:31 2017        (r3918)
+++ jhalfs/trunk/install-blfs-tools.sh  Wed Mar 15 14:06:17 2017        (r3919)
@@ -11,12 +11,12 @@
                 Must start with a '/' (default /blfs_root)
 BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag)
                 (default development)
-INIT_SYSTEM   : which book do you want? 'sysv' or 'systemd' (default sysv)
+INITSYS   : which book do you want? 'sysv' or 'systemd' (default sysv)
 Examples:
 1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
 use jhalfs, or forgot to include the jhalfs-blfs tools:
 (as root) mkdir -p /var/lib/jhalfs/BLFS && chown -R <user> /var/lib/jhalfs
-(as user) INIT_SYSTEM=<your system> ./install-blfs-tools.sh
+(as user) INITSYS=<your system> ./install-blfs-tools.sh
 2 - To install with only user privileges (default to sysv):
 TRACKING_DIR=$HOME/blfs_root/trackdir ./install-blfs-tools.sh
 
@@ -80,12 +80,12 @@
 BUILDDIR=$(cd ~;pwd)
 BLFS_ROOT="${BLFS_ROOT:=/blfs_root}"
 TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}"
-INIT_SYSTEM="${INIT_SYSTEM:=sysv}"
+INITSYS="${INITSYS:=sysv}"
 BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
 BLFS_XML=${BLFS_XML:=blfs-xml}
 
 # Validate the configuration:
-PARAMS="BLFS_ROOT TRACKING_DIR INIT_SYSTEM BLFS_XML"
+PARAMS="BLFS_ROOT TRACKING_DIR INITSYS BLFS_XML"
 if [ "$WORKING_COPY" = y ]; then
   PARAMS="$PARAMS WORKING_COPY BOOK"
 else
@@ -167,7 +167,7 @@
 
 make -j1 -C $BUILDDIR$BLFS_ROOT \
      TRACKING_DIR=$TRACKING_DIR \
-     REV=$INIT_SYSTEM            \
+     REV=$INITSYS            \
      BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML      \
      SVN=svn://svn.linuxfromscratch.org/BLFS/$BLFS_TREE \
      $BUILDDIR$BLFS_ROOT/packages.xml
-- 
http://lists.linuxfromscratch.org/listinfo/alfs-log
Unsubscribe: See the above information page

Reply via email to