changeset 13:95b1518a8975

Resync download_functions.sh with aboriginal. (Makes ALLOW_PATCH_FAILURE work, among other things.)
author Rob Landley <rob@landley.net>
date Sat, 29 Oct 2011 12:45:32 -0500
parents afc6248ee1d6
children 1da81fbd78a8
files common/download_functions.sh
diffstat 1 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/common/download_functions.sh	Sat Oct 29 12:42:27 2011 -0500
+++ b/common/download_functions.sh	Sat Oct 29 12:45:32 2011 -0500
@@ -22,7 +22,10 @@
       (cd "${SRCTREE}/${PACKAGE}" &&
        patch -p1 -i "$i" &&
        sha1file "$i" >> "$SHA1FILE") ||
-        ([ -z "$ALLOW_PATCH_FAILURE" ] && dienow)
+        if [ -z "$ALLOW_PATCH_FAILURE" ]
+        then
+          dienow
+        fi
     fi
   done
 }
@@ -54,10 +57,10 @@
 {
   mkdir -p "$SRCTREE" || dienow
 
-  # Figure out whether we're using an unstable package.
+  # Figure out whether we're using an alternative version of a package.
 
   PACKAGE="$1"
-  is_in_list "$PACKAGE" $USE_UNSTABLE && PACKAGE=alt-"$PACKAGE"
+  is_in_list "$PACKAGE" $USE_ALT && PACKAGE=alt-"$PACKAGE"
 
   # Announce to the world that we're cracking open a new package
 
@@ -194,8 +197,8 @@
 
   echo -ne "checking $FILENAME\r"
 
-  # Update timestamps on both stable and unstable tarballs (if any)
-  # so cleanup_oldfiles doesn't delete stable when we're building unstable
+  # Update timestamps on both stable and alternative tarballs (if any)
+  # so cleanup_oldfiles doesn't delete stable when we're building alt
   # or vice versa
 
   touch -c "$SRCDIR"/{"$FILENAME","$ALTFILENAME"} 2>/dev/null
@@ -203,13 +206,17 @@
   # Give package name, minus file's version number and archive extension.
   BASENAME="$(noversion "$FILENAME")"
 
-  # If unstable version selected, try from listed location, and fall back
-  # to PREFERRED_MIRROR.  Do not try normal mirror locations for unstable.
+  # If alternative version selected, try from listed location, and fall back
+  # to PREFERRED_MIRROR.  Do not try normal mirror locations for alt packages.
 
-  if is_in_list "$BASENAME" $USE_UNSTABLE
+  if is_in_list "$BASENAME" $USE_ALT
   then
     # If extracted source directory exists, don't download alt-tarball.
-    [ -e "$SRCTREE/alt-$BASENAME" ] && return 0
+    if [ -e "$SRCTREE/alt-$BASENAME" ]
+    then
+      echo "Using $SRCTREE/$PACKAGE"
+      return 0
+    fi
 
     # Download new one as alt-packagename.tar.ext
     FILENAME="$ALTFILENAME"
@@ -217,7 +224,7 @@
 
     ([ ! -z "$PREFERRED_MIRROR" ] &&
       download_from "$PREFERRED_MIRROR/$ALTFILENAME") ||
-      download_from "$UNSTABLE"
+      download_from "$ALT"
     return $?
   fi