r2950 - jhalfs/branches/experimental/BLFS

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Mon Aug 14 18:33:40 PDT 2006


Author: georgeb
Date: 2006-08-14 19:33:40 -0600 (Mon, 14 Aug 2006)
New Revision: 2950

Modified:
   jhalfs/branches/experimental/BLFS/gen-makefile.sh
Log:
BLFS: Add pkg version (if available) to tracking file name

Modified: jhalfs/branches/experimental/BLFS/gen-makefile.sh
===================================================================
--- jhalfs/branches/experimental/BLFS/gen-makefile.sh	2006-08-14 20:59:05 UTC (rev 2949)
+++ jhalfs/branches/experimental/BLFS/gen-makefile.sh	2006-08-15 01:33:40 UTC (rev 2950)
@@ -49,10 +49,11 @@
 __wrt_touch() {                    #
 #----------------------------------#
   local pkg_name=$1
+  local pkg_ver=$2
 (
 cat << EOF
 	@touch  \$@ && \\
-	touch \$(TRACKING_DIR)/${pkg_name#*-?-} && \\
+	touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver} && \\
 	sleep .25 && \\
 	echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
 	echo --------------------------------------------------------------------------------\$(WHITE)
@@ -65,7 +66,8 @@
 __write_entry() {            #
 #----------------------------#
   local script_name=$1
-
+  local pkg_ver=$2
+  
   echo -n "${tab_}${tab_} entry for <$script_name>"
 
   #--------------------------------------------------------------------#
@@ -79,7 +81,7 @@
 
   # Include a touch of the target name so make can check
   # if it's already been made.
-  __wrt_touch "${script_name}"
+  __wrt_touch "${script_name}" "${pkg_ver}"
   #
   #--------------------------------------------------------------------#
   #              >>>>>>>> END OF Makefile ENTRY <<<<<<<<               #
@@ -101,9 +103,13 @@
 
   for package_script in scripts/* ; do
     this_script=`basename $package_script`
-    if [ ! -e $TRACKING_DIR/${this_script#*-} ]; then
+    script_ver=$(xmllint --noent ../blfs-xml/book/bookinfo.xml 2>/dev/null | \
+    		grep -i " ${this_script#*-?-}-version " | \
+		cut -d "\"" -f2 )
+    echo "${this_script} ... ${this_script#*-?-} .. ver ${script_ver}"
+    if [ ! -e $TRACKING_DIR/${this_script#*-?-}-$script_ver ]; then
       pkg_list="$pkg_list ${this_script}"
-      __write_entry $this_script
+     __write_entry "${this_script}" "${script_ver}"
       PREV_PACKAGE=${this_script}
     fi
   done




More information about the alfs-log mailing list