Mercurial > hg > control-images
annotate common/bootstrap/run-build-stages.sh @ 40:ef471ef37665 draft default tip
Yank reliance on ash.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 18 Jul 2015 01:39:24 -0500 |
parents | a051c841d782 |
children |
rev | line source |
---|---|
0
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/sh |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 # Run each of the individual package build files, in order. |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 [ -z "$MANIFEST" ] && MANIFEST=/usr/src/packages |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 touch "$MANIFEST" |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
7 |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
8 [ -z "$FILTER" ] || FILTER="/$FILTER/d" |
17 | 9 PACKAGES="$(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list)" |
10 PACKAGECOUNT=$(echo "$PACKAGES" | wc -w) | |
11 X=0 | |
12 for i in $PACKAGES | |
0
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
13 do |
17 | 14 X=$(($X+1)) |
0
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 if [ -z "$FORCE" ] && grep -q "$i" "$MANIFEST" |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
16 then |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
17 echo "$i already installed" |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
18 continue |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 fi |
33
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
20 if [ ! -z "$RECORD" ] |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
21 then |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
22 [ "${RECORD:0:1}" != "," ] && RECORD=",$RECORD" |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
23 if [ "$RECORD" == ,all ] || [ "$RECORD" != "${RECORD/,$i/}" ] |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
24 then |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
25 echo recording commands for $i |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
26 export RECORD_COMMANDS=record-commands |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
27 else |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
28 RECORD_COMMANDS= |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
29 fi |
a051c841d782
Add command recording ability (via record-commands wrapper).
Rob Landley <rob@landley.net>
parents:
17
diff
changeset
|
30 fi |
17 | 31 X_OF_Y="($X of $PACKAGECOUNT)" /mnt/build-one-package.sh "$i" || exit 1 |
0
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
32 |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
33 sed -i -e "/$i/d" "$MANIFEST" && |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
34 echo "$i" >> "$MANIFEST" || exit 1 |
bcd2e358d57f
Start by copying the existing control image building infrastructure from Aboriginal Linux, and shuffling the layout around a bit.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
35 done |