r3508 - in jhalfs/branches/experimental: XSL common/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Sep 29 11:15:23 PDT 2007


Author: manuel
Date: 2007-09-29 12:15:23 -0600 (Sat, 29 Sep 2007)
New Revision: 3508

Modified:
   jhalfs/branches/experimental/XSL/custom-tools.xsl
   jhalfs/branches/experimental/XSL/user.xsl
   jhalfs/branches/experimental/common/libs/func_blfs_deps
   jhalfs/branches/experimental/common/libs/func_download_pkgs
Log:
Making the new blfs-tool-deps download code generic enought to can be used also on custom-tools and user inserted scripts.

Modified: jhalfs/branches/experimental/XSL/custom-tools.xsl
===================================================================
--- jhalfs/branches/experimental/XSL/custom-tools.xsl	2007-09-29 17:19:31 UTC (rev 3507)
+++ jhalfs/branches/experimental/XSL/custom-tools.xsl	2007-09-29 18:15:23 UTC (rev 3508)
@@ -10,6 +10,7 @@
 
     <!-- Create a custom tools directory containing scripts
          to be run after the base system has been built -->
+    <!-- See blfs-tool.xsl for exsl:document examples -->
   <xsl:template name="custom-tools">
       <!-- Fixed directory and ch_order values -->
     <xsl:variable name="basedir">custom-tools/20_</xsl:variable>
@@ -23,6 +24,11 @@
 PACKAGE=dummy
 VERSION=0.0.0
 TARBALL=dummy-0.0.0.tar.bz2
+DOWNLOAD=http://www.example.com/sources/dummy-0.0.0.tar.bz2
+MD5SUM=b0c2f10c23b1d529725c8f9c693858cf
+
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix1.patch 65c913efccffda4b9dc66e9002e8516e"
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix2.patch fb411aae8d1eb8a733bb1def9266f2ba"
       </xsl:text>
       <xsl:call-template name="disk_usage"/>
       <xsl:call-template name="unpack"/>
@@ -30,7 +36,6 @@
 cd $PKGDIR
 ./configure --prefix=/usr
 make
-make check
 make install
       </xsl:text>
       <xsl:call-template name="disk_usage"/>

Modified: jhalfs/branches/experimental/XSL/user.xsl
===================================================================
--- jhalfs/branches/experimental/XSL/user.xsl	2007-09-29 17:19:31 UTC (rev 3507)
+++ jhalfs/branches/experimental/XSL/user.xsl	2007-09-29 18:15:23 UTC (rev 3508)
@@ -52,6 +52,7 @@
     <xsl:if test="$reference = 'ID_of_selected_sect1'">
         <!-- Add an exsl:document block for each script to be inserted
              at this point of the build. This one is only a dummy example. -->
+        <!-- See blfs-tool.xsl for exsl:document examples -->
       <exsl:document href="{$insert_order}01-dummy" method="text">
         <xsl:call-template name="header"/>
         <xsl:text>
@@ -59,6 +60,11 @@
 PACKAGE=dummy
 VERSION=0.0.0
 TARBALL=dummy-0.0.0.tar.bz2
+DOWNLOAD=http://www.example.com/sources/dummy-0.0.0.tar.bz2
+MD5SUM=b0c2f10c23b1d529725c8f9c693858cf
+
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix1.patch 65c913efccffda4b9dc66e9002e8516e"
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix2.patch fb411aae8d1eb8a733bb1def9266f2ba"
         </xsl:text>
         <xsl:call-template name="disk_usage"/>
         <xsl:call-template name="unpack"/>
@@ -90,6 +96,7 @@
     <xsl:if test="$reference = 'ID_of_selected_sect1'">
         <!-- Add an exsl:document block for each script to be inserted
              at this point of the build. This one is only a dummy example. -->
+        <!-- See blfs-tool.xsl for exsl:document examples -->
       <exsl:document href="{$insert_order}01-dummy" method="text">
         <xsl:call-template name="header"/>
         <xsl:text>
@@ -97,6 +104,11 @@
 PACKAGE=dummy
 VERSION=0.0.0
 TARBALL=dummy-0.0.0.tar.bz2
+DOWNLOAD=http://www.example.com/sources/dummy-0.0.0.tar.bz2
+MD5SUM=b0c2f10c23b1d529725c8f9c693858cf
+
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix1.patch 65c913efccffda4b9dc66e9002e8516e"
+PATCH="http://www.example.com/sources/dummy-0.0.0.fix2.patch fb411aae8d1eb8a733bb1def9266f2ba"
         </xsl:text>
         <xsl:call-template name="disk_usage"/>
         <xsl:call-template name="unpack"/>

Modified: jhalfs/branches/experimental/common/libs/func_blfs_deps
===================================================================
--- jhalfs/branches/experimental/common/libs/func_blfs_deps	2007-09-29 17:19:31 UTC (rev 3507)
+++ jhalfs/branches/experimental/common/libs/func_blfs_deps	2007-09-29 18:15:23 UTC (rev 3508)
@@ -27,43 +27,7 @@
   done
 }
 
-#----------------------------#
-add_blfs_deps_urls() {       #
-#----------------------------#
-  local saveIFS=$IFS
-  local IFS file line package tarball download md5sum patchurl patchname patchmd5
 
-  local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
-
-  for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
-    # Keep the script file name
-    this_script=`basename $file`
-
-    # Grab the package name, tarball, download URL and MD5SUM
-    package=`grep "^PACKAGE=" ${file} | sed -e 's at PACKAGE=@@'`
-    tarball=`grep "^TARBALL=" ${file} | sed -e 's at TARBALL=@@'`
-    download=`grep "^DOWNLOAD=" ${file} | sed -e 's at DOWNLOAD=@@'`
-    md5sum=`grep "^MD5SUM=" ${file} | sed -e 's at MD5SUM=@@'`
-
-    # Write the package entry
-    echo "${download} ${BLFS_SERVER}${package}/${tarball} ${md5sum}" >> ../sources/urls.lst
-
-    # Handle the patches, if any
-    IFS=$'\x0A'
-    for line in `grep "^PATCH=" ${file}` ; do
-      IFS=$saveIFS
-      patchurl=`echo ${line} | sed -e 's at PATCH="@@' -e 's@ .*@@'`
-      patchname=${patchurl##*/}
-      patchmd5=`echo ${line} | sed -e 's at .* @@' -e 's@"@@'`
-
-      # Write the patch entry
-      echo "${patchurl} ${BLFS_SERVER}${package}/${patchname} ${patchmd5}" >> ../sources/urls.lst
-    done
-
-  done
-}
-
-
 #----------------------------------#
 wrt_blfs_tool_targets() {          #
 #----------------------------------#

Modified: jhalfs/branches/experimental/common/libs/func_download_pkgs
===================================================================
--- jhalfs/branches/experimental/common/libs/func_download_pkgs	2007-09-29 17:19:31 UTC (rev 3507)
+++ jhalfs/branches/experimental/common/libs/func_download_pkgs	2007-09-29 18:15:23 UTC (rev 3508)
@@ -139,7 +139,6 @@
                  --stringparam family clfs \
                  -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
-        echo " ...OK"
       ;;
     clfs2)
         echo -n "Creating CLFS2 <${ARCH}> specific URLs file"
@@ -148,7 +147,6 @@
                  --stringparam family clfs \
                  -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
-        echo " ...OK"
       ;;
     clfs3)
         echo -n "Creating CLFS3 <${ARCH}> specific URLs file"
@@ -157,7 +155,6 @@
                  --stringparam family clfs \
                  -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
-        echo " ...OK"
       ;;
     hlfs)
         echo -n "Creating HLFS <${MODEL}> + <${KERNEL}> specific URLs file"
@@ -168,7 +165,6 @@
                  --stringparam kernel $KERNEL \
                  -o $BUILDDIR/sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
-        echo " ...OK"
       ;;
     lfs)
         echo -n "Creating LFS specific URLs file"
@@ -177,19 +173,48 @@
                  --stringparam family lfs \
                  -o ../sources/urls.lst $CODE_DIR/XSL/urls.xsl \
                  $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
-        echo " ...OK"
       ;;
   esac
 
-  if [[ "${BLFS_TOOL}" = "y" ]]; then
-    add_blfs_deps_urls
-  fi
+  add_extra_urls
 
-  if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
-    add_CustomToolsURLS
-  fi
+  echo " ...OK"
 
   cd $BUILDDIR/sources
 
 }
 
+#----------------------------# Add download URLs found in user added scripts,
+add_extra_urls() {           # blfs-tool-deps scripts, and custom-tools scripts
+#----------------------------#
+  local saveIFS=$IFS
+  local IFS file line package tarball download md5sum patchurl patchname patchmd5
+
+  local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
+
+  for file in ${PROGNAME}-commands/*/* ; do
+    # Grab the package name, tarball, download URL and MD5SUM
+    package=`grep "^PACKAGE=" ${file} | sed -e 's at PACKAGE=@@'`
+    tarball=`grep "^TARBALL=" ${file} | sed -e 's at TARBALL=@@'`
+    download=`grep "^DOWNLOAD=" ${file} | sed -e 's at DOWNLOAD=@@'`
+    md5sum=`grep "^MD5SUM=" ${file} | sed -e 's at MD5SUM=@@'`
+
+    # Be sure that we have a download URL and MD5SUM value
+    if [ -n "${download}" ] && [ -n "${md5sum}" ] ; then
+      # Write the package entry
+      echo "${download} ${BLFS_SERVER}${package}/${tarball} ${md5sum}" >> ../sources/urls.lst
+    fi
+
+    # Handle the patches, if any
+    IFS=$'\x0A'
+    for line in `grep "^PATCH=" ${file}` ; do
+      IFS=$saveIFS
+      patchurl=`echo ${line} | sed -e 's at PATCH="@@' -e 's@ .*@@'`
+      patchname=${patchurl##*/}
+      patchmd5=`echo ${line} | sed -e 's at .* @@' -e 's@"@@'`
+
+      # Write the patch entry
+      echo "${patchurl} ${BLFS_SERVER}${package}/${patchname} ${patchmd5}" >> ../sources/urls.lst
+    done
+  done
+}




More information about the alfs-log mailing list