r3510 - in jhalfs/branches/experimental: . common/libs

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


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

Modified:
   jhalfs/branches/experimental/common/libs/func_custom_pkgs
   jhalfs/branches/experimental/jhalfs
Log:
Updated CUSTOM_TOOLS code

Modified: jhalfs/branches/experimental/common/libs/func_custom_pkgs
===================================================================
--- jhalfs/branches/experimental/common/libs/func_custom_pkgs	2007-09-29 18:38:16 UTC (rev 3509)
+++ jhalfs/branches/experimental/common/libs/func_custom_pkgs	2007-09-29 18:57:23 UTC (rev 3510)
@@ -7,112 +7,58 @@
 #----------------------------------#
   PREV=""
 
-  echo "  Adding custom packages... ${BOLD}START${OFF}"
+  echo "${tab_}${GREEN}Processing... ${L_arrow}CUSTOM_TOOLS ${R_arrow}"
 
-  # Create the custom_tools scripts directory
-  mkdir -p custom-tools
+  for file in custom-tools/* ; do
+    # Keep the script file name
+    this_script=`basename $file`
 
-  for file in $JHALFSDIR/custom-commands/*; do
-    if [[ `basename ${file}` = "*" ]]; then
-      break
-    fi
-    source $file
-    this_script=$(basename ${file})
-    echo "$tab_${GREEN}Adding${OFF} ${this_script}"
+    # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
+    name=`grep "^PKG_PHASE=" ${file} | sed -e 's at PKG_PHASE=@@'`
+    # Grab also the package version
+    pkg_ver=`grep "^VERSION=" ${file} | sed -e 's at VERSION=@@'`
 
-      # Create a Makefile entry
-    if [[ "x${PKG}" = "x" ]]; then
-    # Create an entry for a self contained cmd script that does not
-    # reference a package tarball
-      case $PROGNAME in
-        clfs2 | clfs3 )
-          LUSER_wrt_target "${this_script}" "$PREV"
-          LUSER_wrt_RunAsUser "custom-tools/${this_script}"
-          ;;
-        *)
-          CHROOT_wrt_target "${this_script}" "$PREV"
-          CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
-          ;;
-      esac
-      wrt_touch
+    # Append each name of the script files to a list (this will become
+    # the names of the targets in the Makefile)
+    custom_list="$custom_list ${this_script}"
 
-    # Create the build script file
-( cat <<- xEOFx
-#!/bin/bash
-set -e
+    #--------------------------------------------------------------------#
+    #         >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<<          #
+    #--------------------------------------------------------------------#
+    #
+    # Drop in the name of the target on a new line, and the previous target
+    # as a dependency. Also call the echo_message function.
+    wrt_target "${this_script}" "$PREV"
 
-`cat tmp`
-exit
-xEOFx
-) > custom-tools/${this_script}
+    # Touch timestamp file if installed files logs will be created.
+    if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
+      wrt_TouchTimestamp
+    fi
 
-    else
-    # Create an entry for package
-      case $PROGNAME in
-        clfs2 | clfs3 )
-          LUSER_wrt_target "${this_script}" "$PREV"
-          LUSER_wrt_unpack "${PKG_FILE}"
-          LUSER_wrt_RunAsUser "custom-tools/${this_script}"
-          LUSER_RemoveBuildDirs "${PKG}"
-          echo -e "\t at touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >>  $MKFILE.tmp
-          ;;
-        *)
-          CHROOT_wrt_target "${this_script}" "$PREV"
-          CHROOT_Unpack "${PKG_FILE}"
-          CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
-          CHROOT_wrt_RemoveBuildDirs "${PKG}"
-          echo -e "\t at touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >>  $MKFILE.tmp
-          ;;
-      esac
-      wrt_touch
+    # Run the script.
+    wrt_RunScript "$file"
 
-    # Create the build script file
-( cat <<- xEOFx
-#!/bin/bash
-set -e
-
-cd \$PKGDIR
-`cat tmp`
-exit
-xEOFx
-) > custom-tools/$this_script
+    # Write installed files log
+    if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
+      wrt_LogNewFiles "$name"
     fi
 
-    rm -f tmp
-    PREV=$this_script
-    custom_list="${custom_list} ${this_script}"
-  done
-
-  # Make the scripts executable.
-  chmod +x custom-tools/*
-
-  echo "  Adding custom packages... ${BOLD}DONE${OFF}"
-}
-
-
-#----------------------------------#
-add_CustomToolsURLS() {            # Add any users supplied scripts URL information
-#----------------------------------#
-  local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
-  local this_script
-  local URL PKG PKG_VERSION PKG_FILE MD5
-
-  > urls.lst.tmp
-  for this_script in $JHALFSDIR/custom-commands/*; do
-    if [[ `basename ${this_script}` = "*" ]]; then
-      CUSTOM_TOOLS="n"
-      break
+    # Touch the tracking file.
+    if [ "$PROGNAME" = "clfs2" ]; then
+      echo -e "\t at touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >>  $MKFILE.tmp
+    else
+      echo -e "\t at touch $TRACKING_DIR/${name}-${pkg_ver}" >>  $MKFILE.tmp
     fi
-    source $this_script
-      # A cmd only script had no PKG defined
-    [[ "x${PKG}" = "x" ]] && continue
 
-    echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
-     # Add any patches..
-    for PATCH in PATCH{1..10}; do
-      [[ -n ${!PATCH} ]] && echo "dummy-url ${!PATCH}" >> urls.lst.tmp
-    done
+    # Include a touch of the target name so make can check
+    # if it's already been made.
+    wrt_touch
+    #
+    #--------------------------------------------------------------------#
+    #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
+    #--------------------------------------------------------------------#
+
+    # Keep the script file name for Makefile dependencies.
+    PREV=${this_script}
   done
-  cat  urls.lst.tmp >> $BUILDDIR/sources/urls.lst
-  rm urls.lst.tmp
 }

Modified: jhalfs/branches/experimental/jhalfs
===================================================================
--- jhalfs/branches/experimental/jhalfs	2007-09-29 18:38:16 UTC (rev 3509)
+++ jhalfs/branches/experimental/jhalfs	2007-09-29 18:57:23 UTC (rev 3510)
@@ -337,13 +337,6 @@
   fi
   #
 
-  # Copy custom tools config files, if requested
-  if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
-    echo "Copying custom tool scripts to $JHALFSDIR"
-    mkdir -p $JHALFSDIR/custom-commands
-    cp -f custom/config/* $JHALFSDIR/custom-commands
-  fi
-  #
   # Install blfs-tool, if requested.
   if [[ "${BLFS_TOOL}" = "y" ]] ; then
     # Install the files




More information about the alfs-log mailing list