diff sources/include.sh @ 1510:8e98296410f3

Another attempt to make more/record-commands.sh and host-tools.sh play together.
author Rob Landley <rob@landley.net>
date Wed, 21 Mar 2012 17:47:20 -0500
parents c8fac8498b66
children e2f722cc97a6
line wrap: on
line diff
--- a/sources/include.sh	Wed Mar 21 17:45:39 2012 -0500
+++ b/sources/include.sh	Wed Mar 21 17:47:20 2012 -0500
@@ -67,18 +67,23 @@
 # Adjust $PATH
 
 # If record-commands.sh set up a wrapper directory, adjust $PATH again.
-if [ -z "$OLDPATH" ] && [ -f "$WRAPDIR/wrappy" ]
+
+export PATH
+if [ -z "$OLDPATH" ]
 then
-  mkdir -p "$BUILD/logs"
-  [ $? -ne 0 ] && echo "Bad $WRAPDIR" >&2 && dienow
-  export WRAPPY_LOGPATH="$BUILD/logs/cmdlines.$ARCH_NAME.early"
   export OLDPATH="$PATH"
-  PATH="$WRAPDIR"
-else
-  export OLDPATH="$PATH"
-  [ ! -f "$HOSTTOOLS/busybox" ] &&
-    PATH="$(hosttools_path):$OLDPATH" ||
-    PATH="$(hosttools_path)"
+  [ -f "$HOSTTOOLS/busybox" ] &&
+    PATH="$(hosttools_path)" ||
+    PATH="$(hosttools_path):$PATH"
+
+  if [ -f "$WRAPDIR/wrappy" ]
+  then
+    OLDPATH="$PATH"
+    mkdir -p "$BUILD/logs"
+    [ $? -ne 0 ] && echo "Bad $WRAPDIR" >&2 && dienow
+    export WRAPPY_LOGPATH="$BUILD/logs/cmdlines.$ARCH_NAME.early"
+    PATH="$WRAPDIR"
+  fi
 fi
 
 # Create files with known permissions