comparison host-tools.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 c3b91b70cc42
children a242ea5d6bb4
comparison
equal deleted inserted replaced
1581:f9b0ebfbdd1b 1582:6a8114c148d1
22 # host has all the necessary packages installed and doesn't have any extra 22 # host has all the necessary packages installed and doesn't have any extra
23 # packages (such as libtool, pkg-config, python...) that might provide 23 # packages (such as libtool, pkg-config, python...) that might provide
24 # false information to autoconf or attach themselves as dependencies to 24 # false information to autoconf or attach themselves as dependencies to
25 # the newly generated programs. (In practice, this can be quite fiddly.) 25 # the newly generated programs. (In practice, this can be quite fiddly.)
26 26
27 SAVEPATH="$PATH"
27 source sources/include.sh || exit 1 28 source sources/include.sh || exit 1
28 29
29 STAGE_DIR="${HOSTTOOLS}" 30 STAGE_DIR="${HOSTTOOLS}"
30 31
31 # Blank $WORK but accept $STAGE_DIR if it exists. Re-running this script 32 # Blank $WORK but accept $STAGE_DIR if it exists. Re-running this script
100 then 101 then
101 # Loop through each instance, populating fallback directories. 102 # Loop through each instance, populating fallback directories.
102 103
103 X=0 104 X=0
104 FALLBACK="$STAGE_DIR" 105 FALLBACK="$STAGE_DIR"
105 PATH="$OLDPATH" "$STAGE_DIR/which" -a "$i" | while read j 106 PATH="$SAVEPATH" "$STAGE_DIR/which" -a "$i" | while read j
106 do 107 do
107 if [ ! -e "$FALLBACK/$i" ] 108 if [ ! -e "$FALLBACK/$i" ]
108 then 109 then
109 mkdir -p "$FALLBACK" && 110 mkdir -p "$FALLBACK" &&
110 ln -sf "$j" "$FALLBACK/$i" || dienow 111 ln -sf "$j" "$FALLBACK/$i" || dienow
123 done 124 done
124 125
125 # Workaround for a bug in Ubuntu 10.04 where gcc became a perl script calling 126 # Workaround for a bug in Ubuntu 10.04 where gcc became a perl script calling
126 # gcc.real. Systems that aren't crazy don't need this. 127 # gcc.real. Systems that aren't crazy don't need this.
127 128
128 ET_TU_UBUNTU="$(PATH="$OLDPATH" "$STAGE_DIR/which" gcc.real)" 129 ET_TU_UBUNTU="$(PATH="$SAVEPATH" "$STAGE_DIR/which" gcc.real)"
129 [ ! -z "$ET_TU_UBUNTU" ] && ln -s "$ET_TU_UBUNTU" "$STAGE_DIR/gcc.real" 2>/dev/null 130 [ ! -z "$ET_TU_UBUNTU" ] && ln -s "$ET_TU_UBUNTU" "$STAGE_DIR/gcc.real" 2>/dev/null
130 131
131 # We now have all the tools we need in $STAGE_DIR, so trim the $PATH to 132 # We now have all the tools we need in $STAGE_DIR, so trim the $PATH to
132 # remove the old ones. 133 # remove the old ones.
133 134