diff sources/functions.sh @ 581:9dffdd74c186

More changes for initramfs and hw- targets with a base architecture. The $BASE_ARCH approach didn't work because targets need to override things like KERNEL_PATH, so they need to source the relevant details file themselves. Shuffle things around so they can do that: move $CROSS into cross-compiler.sh, add cross compiler to $PATH independently of that, remove $ARCH from CONFIG_DIR and change users to add it, have getconfig check $ARCH_NAME directory first, redo qemu_defaults to chop out initramfs options less uncleanly...
author Rob Landley <rob@landley.net>
date Mon, 12 Jan 2009 02:47:32 -0600
parents 5619a7375b74
children d66eae57a344
line wrap: on
line diff
--- a/sources/functions.sh	Sun Jan 11 14:24:22 2009 -0600
+++ b/sources/functions.sh	Mon Jan 12 02:47:32 2009 -0600
@@ -11,13 +11,18 @@
 
 function getconfig()
 {
-  if unstable "$1" && [ -f "$CONFIG_DIR/miniconfig-alt-$1" ]
-  then
-    echo "$CONFIG_DIR/miniconfig-alt-$1"
-    return
-  fi
+  for i in $(unstable $1 && echo {$ARCH_NAME,$ARCH}/miniconfig-alt-$1) \
+    {$ARCH_NAME,$ARCH}/miniconfig-$1
+  do
+    if [ -f "$CONFIG_DIR/$i" ]
+    then
+      echo "$CONFIG_DIR/$i"
+      return
+    fi
+  done
 
-  echo "$CONFIG_DIR/miniconfig-$1"
+  echo "getconfig $1 failed" >&2
+  dienow
 }
 
 # Strip the version number off a tarball
@@ -188,8 +193,8 @@
   FILENAME=`echo "$URL" | sed 's .*/  '`
   ALTFILENAME=alt-"$(noversion "$FILENAME" -0)"
 
-  # Is there an unstable version to download, and is it selected?
-  if [ ! -z "$UNSTABLE" ] && unstable "$(basename "$FILENAME")"
+  # Is the unstable version selected?
+  if unstable "$(basename "$FILENAME")"
   then
     # Keep old version around, if present.
     touch -c "$SRCDIR/$FILENAME" 2>/dev/null