-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·56 lines (51 loc) · 1004 Bytes
/
build.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
50
51
52
53
54
55
56
#!/bin/bash
ln=1
exec=`scripts/get-config.pl6 exec`
if [ "$1" == "--start-at" ]; then
shift
re='^[0-9]+$'
if ! [[ $1 =~ $re ]] ; then
echo "Searching for $1"
ln=`awk "/$1/{ print NR; exit }" BuildList`
else
echo "Starting at $1"
ln=$1
fi
shift
tail --lines=+$ln BuildList > BuildList.now
else
cp BuildList BuildList.now
fi
if [ "$1" == "--log" ]; then
shift
name=$1
shift
else
name='LastBuildResults'
fi
date=`date --utc +%Y%m%d`
if [[ "$1" == "--date" ]]; then
shift;
date=$1
shift
fi
if [[ "$1" == "--suffix" ]]; then
shift
suffix=$1
shift
fi
perl6 scripts/backup_results.pl6 $name
/usr/bin/time -p /bin/bash -c '(
echo "Build started for: ";
./'$exec' -v;
'"i=$ln"'; n=`wc -l BuildList | cut -f1 -d\ `; for a in `cat BuildList.now`; do
(
echo " === $a === ($i/$n)"
P6_GLIB_COMPILE_PROCESS=1 ./'$exec' -e "use $a" 2>&1
)
i=$((i+1))
done;
echo;
)' 2>&1 | tee -a $name
cp $name stats/$name-$date$suffix
rm BuildList.now