r2804 - jhalfs/trunk/common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Fri Jun 23 11:06:32 PDT 2006


Author: manuel
Date: 2006-06-23 12:06:31 -0600 (Fri, 23 Jun 2006)
New Revision: 2804

Modified:
   jhalfs/trunk/common/common-functions
Log:
Removed obsolete code for packages file creation.
Improved the speed creation of pkg_tarball_list.
Moved the new functions to a more proper location.

Modified: jhalfs/trunk/common/common-functions
===================================================================
--- jhalfs/trunk/common/common-functions	2006-06-23 17:35:28 UTC (rev 2803)
+++ jhalfs/trunk/common/common-functions	2006-06-23 18:06:31 UTC (rev 2804)
@@ -207,7 +207,21 @@
 ) >> $MKFILE.tmp
 }
 
+#----------------------------#
+get_package_tarball_name() { #
+#----------------------------#
+  local script_name=$1
 
+   # The use of 'head' is necessary to limit the return value to the FIRST match..
+   # hopefully this will not cause problems.
+   #
+   case $script_name in
+     tcl)   echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
+     *)     echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
+   esac
+
+}
+
 #----------------------------------#
 wrt_remove_existing_dirs() {       #
 #----------------------------------#
@@ -535,7 +549,7 @@
       echo -ne "Cleaning $BUILDDIR...\n"
       rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,proc,root,sbin,srv,sys,tmp,tools,cross-tools,usr,var}
       echo -ne "Cleaning $JHALFSDIR...\n"
-      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,logs,Makefile,*.xsl,makefile-functions,packages,patches}
+      rm -rf $JHALFSDIR/{0*,1*,envars,sources-dir,*commands,*logs,Makefile,*.xsl,makefile-functions,pkg_tarball_list,*.config,*.sh}
       echo -ne "Cleaning remainig extracted sources in $BUILDDIR/sources...\n"
       rm -rf `find $BUILDDIR/sources/* -maxdepth 0 -type d`
       echo -ne "done\n"
@@ -567,7 +581,7 @@
     if [ -d ${PROGNAME}-$LFSVRS ] ; then
       cd ${PROGNAME}-$LFSVRS
       if LC_ALL=C svn up | grep -q At && test -d $JHALFSDIR/${PROGNAME}-commands && \
-      test -f $JHALFSDIR/packages ; then
+      test -f $JHALFSDIR/pkg_tarball_list ; then
         echo -ne "done\n"
         # Set the canonical book version
         cd $JHALFSDIR
@@ -666,25 +680,44 @@
   chmod -R +x $JHALFSDIR/${PROGNAME}-commands
 
   # Create the packages file. We need it for proper Makefile creation
-  rm -f packages
-  echo -n "Creating <${PROGNAME}> specific packages file"
-  grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
-                                             -e 's@">@"@' > packages
-  echo " ...OK"
+  create_package_list
 
   # Done. Moving on...
   get_sources
 }
 
 #----------------------------#
+create_package_list() {      #
+#----------------------------#
+
+  # Create the packages file. We need it for proper Makefile creation
+  rm -f pkg_tarball_list
+  echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK $ARCH"
+  case ${PROGNAME} in
+    clfs)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+    hlfs)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+    lfs)
+        xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
+                 $BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
+      ;;
+  esac
+  echo " ...OK"
+
+}
+
+
+#----------------------------#
 get_sources() {              # Download file, write name to MISSING_FILES.DMP if an error
 #----------------------------#
   local saveIFS=$IFS
   local IFS line URL1 URL2 FILE BOOKMD5 MD5 HAVEMD5 fromARCHIVE
 
-  # ALWAYS create a list of the full filenames
-  create_package_list
-
     # Test if the packages must be downloaded
   [ ! "$GETPKG" = "1" ] && return
 
@@ -803,29 +836,6 @@
 }
 
 #----------------------------#
-create_package_list() {      #
-#----------------------------#
-
-  # Create the packages file. We need it for proper Makefile creation
-  echo -n "Creating <${PROGNAME}> list of tarball names for $BOOK $ARCH"
-  case ${PROGNAME} in
-    clfs)
-        xsltproc --nonet \
-                 --xinclude \
-                 -o pkg_tarball_list packages.xsl $BOOK/${ARCH}-index.xml
-      ;;
-    hlfs | lfs )
-        xsltproc --nonet \
-                 --xinclude \
-                 -o pkg_tarball_list packages.xsl $BOOK/index.xml
-      ;;
-  esac
-  echo " ...OK"
-
-}
-
-
-#----------------------------#
 create_urls() {              #
 #----------------------------#
   cd $JHALFSDIR
@@ -860,19 +870,3 @@
 
   cd $BUILDDIR/sources
 }
-
-
-#----------------------------#
-get_package_tarball_name() { #
-#----------------------------#
-  local script_name=$1
-
-   # The use of 'head' is necessary to limit the return value to the FIRST match..
-   # hopefully this will not cause problems.
-   #
-   case $script_name in
-     tcl)   echo $(grep "^tcl" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
-     *)     echo $(grep "^$script_name-[[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 ) ;;
-   esac
-
-}
\ No newline at end of file




More information about the alfs-log mailing list