comparison root-filesystem.sh @ 744:759adf5a0fe9

Refactor so include.sh mostly just sets environment variables. Move read_arch_dir to function and call it explicitly (no more need for $NO_ARCH). Make blank_tempdir a function, called explicitly by stages when needed, with some sanity checks. Insert prerequisite tests to later stages so they can detect failure early and provide an explicit erro rmessage, and have those tests happen before blanking $WORK dir, to preserve debugging info. Make buildall.sh depend on prerequisite tests rather than trying to avoid calling later stages (and thus do flow control from asynchronous context). Add FAIL_QUIET option so buildall.sh doesn't spam the log with the new prerequisite error messages.
author Rob Landley <rob@landley.net>
date Thu, 11 Jun 2009 05:42:51 -0500
parents 5f5c3747f475
children 34f9a88336a8
comparison
equal deleted inserted replaced
743:5e745e03408a 744:759adf5a0fe9
2 2
3 # Get lots of predefined environment variables and shell functions. 3 # Get lots of predefined environment variables and shell functions.
4 4
5 source sources/include.sh || exit 1 5 source sources/include.sh || exit 1
6 6
7 # Purple. And why not? 7 # Parse the sources/targets/$1 directory
8
9 read_arch_dir "$1"
10
11 # If this target has a base architecture that's already been built, use that.
12
13 check_for_base_arch root-filesystem || exit 0
14
15 # Die if our prerequisite isn't there.
16
17 if [ -z "$(which "$ARCH-cc")" ]
18 then
19 [ -z "$FAIL_QUIET" ] && echo No "$ARCH-cc" in '$PATH'. >&2
20 exit 1
21 fi
22
23 # Announce start of stage.
24
8 echo -e "$NATIVE_COLOR" 25 echo -e "$NATIVE_COLOR"
9
10 check_for_base_arch root-filesystem || exit 0
11
12 echo "=== Building minimal native development environment" 26 echo "=== Building minimal native development environment"
13 27
14 rm -rf "${NATIVE_ROOT}" 28 blank_tempdir "$WORK"
29 blank_tempdir "$NATIVE_ROOT"
15 30
16 # Determine which directory layout we're using 31 # Determine which directory layout we're using
17 32
18 if [ ! -z "${NATIVE_TOOLSDIR}" ] 33 if [ ! -z "${NATIVE_TOOLSDIR}" ]
19 then 34 then