r2271 - jhalfs/trunk

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Mon Jan 9 19:40:18 PST 2006


Author: jhuntwork
Date: 2006-01-09 20:40:18 -0700 (Mon, 09 Jan 2006)
New Revision: 2271

Modified:
   jhalfs/trunk/jhalfs
Log:
Fix handling of groff's special patch format. Also, only find the md5sum of the exact package we're downloading, not a spurious copy that has, say, a '.1' or '.2' at the end of the file.

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2006-01-07 13:32:13 UTC (rev 2270)
+++ jhalfs/trunk/jhalfs	2006-01-10 03:40:18 UTC (rev 2271)
@@ -232,6 +232,11 @@
   echo `grep "glibc" packages | sed 's at glibc@glibc-libidn@'` >> packages
   grep "ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
 
+  # Needed for Groff patchlevel patch
+  GROFFLEVEL=`grep "groff-patchlevel" $BOOK/general.ent | sed -e 's/groff-patchlevel //' -e 's/"//g' \
+    -e 's@<!ENTITY @@' -e 's|>||' `
+  sed -i 's|&groff-patchlevel;|'$GROFFLEVEL'|' patches
+
   # Done. Moving on...
   echo -ne "done\n"
   get_sources
@@ -248,7 +253,7 @@
   DIR=`echo $1 | sed 's at -doc@@;s at -libidn@@'`
 
   # Find the md5 sum for this package.
-  if [ $2 != MD5SUMS ] ; then MD5=`grep "  $2" MD5SUMS` ; fi
+  if [ $2 != MD5SUMS ] ; then MD5=`grep "  $2$" MD5SUMS` ; fi
 
   if [ ! -f $2 ] ; then
     case $DL in
@@ -306,34 +311,34 @@
     # Iterate through each package and grab it, along with any patches it needs.
     for i in `cat $JHALFSDIR/packages` ; do
       PKG=`echo $i | sed -e 's/-version.*//' -e 's/-file.*//'`
-      # Needed for Groff patchlevel patch
-      GROFFLEVEL=`grep "groff-patchlevel" $JHALFSDIR/packages | sed -e 's/groff-patchlevel //' -e 's/"//g'`
 
       # There are some entities that aren't valid packages.
       if [ "$PKG" = "expect-lib" -o "$PKG" = "linux-dl" -o "$PKG" = "groff-patchlevel" ] ; then continue ; fi
 
       VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
-      if [ "$PKG" = "tcl" ] ; then
-        FILE="$PKG$VRS-src.tar.bz2"
-      elif [ "$PKG" = "vim-lang" ] ; then
-        PKG="vim"
-        FILE="vim-$VRS-lang.tar.bz2"
-      elif [ "$PKG" = "udev-config" ] ; then
-        PKG="udev"
-        FILE="$VRS"
-      else
-        FILE="$PKG-$VRS.tar.bz2"
-      fi
+      case $PKG in 
+	tcl)
+	       FILE="$PKG$VRS-src.tar.bz2"
+	       ;;
+        vim-lang)
+	       PKG="vim"
+	       FILE="vim-$VRS-lang.tar.bz2"
+	       ;;
+      	udev-config)
+	       PKG="udev"
+	       FILE="$VRS"
+	       ;;
+      	*)
+	       FILE="$PKG-$VRS.tar.bz2"
+	       ;;
+      esac
       download $PKG $FILE
-      for patch in `grep "$PKG-&$PKG" $JHALFSDIR/patches` ; do
+
+      # Download any associated patches
+      for patch in `grep "&$PKG-version" $JHALFSDIR/patches` ; do
         PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
         download $PKG $PATCH
       done
-      # Needed for Groff patchlevel patch
-      for patch in `grep "patchlevel" $JHALFSDIR/patches` ; do
-        PATCH=`echo $patch | sed 's@&'$PKG'-version;-&'$PKG'-patchlevel;@'$VRS'-'$GROFFLEVEL'@'`
-        download $PKG $PATCH
-      done
     done
   fi
 }




More information about the alfs-log mailing list