-
Notifications
You must be signed in to change notification settings - Fork 9
/
buildroll.sh
executable file
·49 lines (42 loc) · 1.16 KB
/
buildroll.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
BUILDROLL=src/roll/rocksbuild/build-roll.sh
ROLLS=$*
#
# download all the binaries first
# this is to avoid downloading error all the way down into the compilation
# and fail sooner than later
#
for roll in $ROLLS; do
if ls src/roll/$roll/.*.metadata ; then
echo "Downloading binaries for $roll"
pushd src/roll/$roll
#
# try it twice, if it fails twice abort
make download || make download || exit 1
popd
fi
done
echo "buildroll.sh Rolls: $ROLLS"
for i in $ROLLS; do
echo "Building Roll: $i. See /tmp/build-$i.out"
df -h
$BUILDROLL -s -z -p src/roll $i &> /tmp/build-$i.out
# some rolls are inside a directory whose name is not the same
# as the ROLLNAME
rollname=`awk -F = '/ROLLNAME/ {print $NF}' src/roll/$i/version.mk | awk '{print $1}'`
test "$rollname" || rollname=$i
if [ ! -f src/roll/$i/${rollname}*iso ]; then
echo "Unable to create roll ${i}. Aborting!"
exit 127
fi
rocks list roll $rollname &> /dev/null
if [ $? == 0 ]; then
echo "Removing old $rollname roll"
rocks remove roll $rollname
fi
pushd src/roll/$i
rocks add roll $rollname*iso
rocks enable roll $rollname
popd
done
echo "buildroll.sh Complete at `date`"