r3192 - in jhalfs/trunk: . common

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Mon Oct 16 15:59:46 PDT 2006


Author: georgeb
Date: 2006-10-16 16:59:45 -0600 (Mon, 16 Oct 2006)
New Revision: 3192

Modified:
   jhalfs/trunk/README.CUSTOM
   jhalfs/trunk/common/custom_pkgs
Log:
Added the ability to create custom scripts that do not reference tarballs.. self contained bash scripts

Modified: jhalfs/trunk/README.CUSTOM
===================================================================
--- jhalfs/trunk/README.CUSTOM	2006-10-16 18:17:01 UTC (rev 3191)
+++ jhalfs/trunk/README.CUSTOM	2006-10-16 22:59:45 UTC (rev 3192)
@@ -17,8 +17,9 @@
 configuration file which enables/disables the inclusion of personal scripts.
 
     custom
-      /config  <-- where to put your scripts.
-      template <-- ALL scripts MUST look like this
+      /config   <-- where to put your scripts.
+      /examples <-- a few example scripts
+      template  <-- ALL scripts MUST look like this
 
 
 
@@ -112,6 +113,8 @@
 URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
 MD5="2c63e827d755527950d9d13fe3d87692"
 
+  # MD5SUM is not absolutely necessary but JHALFS whines and complains 
+  # Add the MD5SUM if you can
 PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
 PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
 
@@ -144,3 +147,27 @@
 xEOFx
 ) > tmp
 
+
+#--------- CMDS ONLY example -----------
+  # This is an example of a self contained cmd script
+  # There are no referenced to a package or package dir.
+  # This method is useful for creating user files/profiles/etc
+  # at build time.
+   
+
+PKG=""
+PKG_VERSION=""
+PKG_FILE=""
+URL=""
+MD5=""
+
+PATCH1=""
+
+
+( cat << "xEOFx"
+
+echo "JUST A USELESS TRACE"
+
+xEOFx
+) > tmp
+

Modified: jhalfs/trunk/common/custom_pkgs
===================================================================
--- jhalfs/trunk/common/custom_pkgs	2006-10-16 18:17:01 UTC (rev 3191)
+++ jhalfs/trunk/common/custom_pkgs	2006-10-16 22:59:45 UTC (rev 3192)
@@ -37,11 +37,37 @@
     THIS_SCRIPT=$(basename ${this_script})
     echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
 
+      # 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
 ( cat << EOF
 
 ${THIS_SCRIPT}: ${PREV_SCRIPT}
 	@\$(call echo_message, Building)
 	@./progress_bar.sh \$@ \$\$PPID &
+	@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
+	@touch \$@
+	@\$(call housekeeping)
+EOF
+) >> ${MKFILE}.tmp2
+
+    # Create the build script file
+( cat <<- xEOFx
+#!/bin/bash
+set -e
+
+`cat tmp`
+exit
+xEOFx
+) > custom-commands/scripts/$THIS_SCRIPT
+    
+    else
+    # Create an entry for package
+( cat << EOF
+
+${THIS_SCRIPT}: ${PREV_SCRIPT}
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ \$\$PPID &
 	@\$(call remove_existing_dirs2,${PKG_FILE})
 	@\$(call unpack3,${PKG_FILE})
 	@\$(call get_pkg_root2)
@@ -63,9 +89,10 @@
 exit
 xEOFx
 ) > custom-commands/scripts/$THIS_SCRIPT
+    fi
+   
     chmod 755 custom-commands/scripts/$THIS_SCRIPT
     rm -f tmp
-
     PREV_SCRIPT=$THIS_SCRIPT
     CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
   done
@@ -93,6 +120,9 @@
       break
     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




More information about the alfs-log mailing list