# HG changeset patch # User Rob Landley # Date 1332370040 18000 # Node ID 8e98296410f36a2cbad96cfb999392455e9d3130 # Parent c8fac8498b6680079c8804ca8fd386087c0d037c Another attempt to make more/record-commands.sh and host-tools.sh play together. diff -r c8fac8498b66 -r 8e98296410f3 host-tools.sh --- a/host-tools.sh Wed Mar 21 17:45:39 2012 -0500 +++ b/host-tools.sh Wed Mar 21 17:47:20 2012 -0500 @@ -104,8 +104,11 @@ FALLBACK="$STAGE_DIR" PATH="$OLDPATH" "$STAGE_DIR/which" -a "$i" | while read j do - mkdir -p "$FALLBACK" && - ln -sf "$j" "$FALLBACK/$i" || dienow + if [ ! -e "$FALLBACK/$i" ] + then + mkdir -p "$FALLBACK" && + ln -sf "$j" "$FALLBACK/$i" || dienow + fi X=$[$X+1] FALLBACK="$STAGE_DIR/fallback-$X" @@ -123,7 +126,7 @@ # gcc.real. Systems that aren't crazy don't need this. ET_TU_UBUNTU="$(PATH="$OLDPATH" "$STAGE_DIR/which" gcc.real)" -[ ! -z "$ET_TU_UBUNTU" ] && ln -sf "$ET_TU_UBUNTU" "$STAGE_DIR/gcc.real" +[ ! -z "$ET_TU_UBUNTU" ] && ln -s "$ET_TU_UBUNTU" "$STAGE_DIR/gcc.real" 2>/dev/null # We now have all the tools we need in $STAGE_DIR, so trim the $PATH to # remove the old ones. diff -r c8fac8498b66 -r 8e98296410f3 sources/include.sh --- 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