diff sources/download_functions.sh @ 1582:6a8114c148d1

Lots of small improvements: check for toybox instead of busybox for host-tools $PATH adjustment, better manifest generation (with toybox in list), make package_cache function to find extracted source (so root-image.sh works when packages contains linux-git snapshot), fix more/record-commands.sh path adjustment.
author Rob Landley <rob@landley.net>
date Sun, 17 Feb 2013 22:25:00 -0600
parents da21ff27331e
children e8d846fb56eb
line wrap: on
line diff
--- a/sources/download_functions.sh	Sun Feb 17 22:19:55 2013 -0600
+++ b/sources/download_functions.sh	Sun Feb 17 22:25:00 2013 -0600
@@ -49,6 +49,21 @@
   done
 }
 
+package_cache()
+{
+  SNAPFROM="$SRCDIR/$1"
+  (is_in_list "$1" "$IGNORE_REPOS" || [ ! -d "$SNAPFROM" ]) &&
+    SNAPFROM="$SRCTREE/$1"
+
+  if [ ! -d "$SNAPFROM" ]
+  then
+    echo "$1 not found.  Did you run download.sh?" >&2
+    dienow
+  fi
+
+  echo "$SNAPFROM"
+}
+
 # Extract tarball named in $1 and apply all relevant patches into
 # "$BUILD/packages/$1".  Record sha1sum of tarball and patch files in
 # sha1-for-source.txt.  Re-extract if tarball or patches change.
@@ -100,7 +115,7 @@
     for i in "$SHA1TAR" $(sha1file "$PATCHDIR/$PACKAGE"-* 2>/dev/null)
     do
       # Is this sha1 in the file?
-      if [ -z "$(echo "$SHALIST" | sed -n "s/$i/$i/p" )" ]
+      if [ -z "$(echo "$SHALIST" | grep "$i")" ]
       then
         SHALIST=missing
         break