-
Notifications
You must be signed in to change notification settings - Fork 3
/
rbk
executable file
·48 lines (48 loc) · 1.52 KB
/
rbk
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
#!/bin/bash -e
# rebuild with KVM mode
pkg=$(basename `pwd`)
years=15
if grep -q "^$pkg$" "$(dirname $BASH_SOURCE)"/exceptions/neardate ; then
years=1
fi
if grep -q "^$pkg$" "$(dirname $BASH_SOURCE)"/exceptions/cpu ; then
cputype2=host
fi
: ${slot:=4}
: ${clean:=--clean --offline}
: ${project:=home:bmwiedemann:reproducible}
: ${repo:=openSUSE_Tumbleweed}
: ${datediff:=$(((((365*$years+36)*24+13)*60+17)*60))}
: ${host1:=buildhosta}
: ${host2:=buildhostb}
: ${parallelism:=4}
: ${parallelism2:=1}
: ${cputype2:=qemu64}
: ${vmtype:=--vm-type=kvm}
export vmtype
now=$(date +%s)
later=$(date --date=@$((now+datediff)) -u "+%FT%T")
export OSC_BUILD_ROOT=/var/tmp/build-root.${slot}/
export VM_CUSTOMOPT=""
osc up -S
fixuposcmtime
mkdir -p RPMS
osc build ${oscbuildextrapkg} --preload --nopreinstallimage --noservice --vm-type=kvm --alternative-project=$project ${oscbuildparams} $repo $pkg.spec 2>&1 | tee RPMS/.build.log2
if (( ${PIPESTATUS[0]} )) ; then
if grep -q "Error: build description file named '.*does not exist" RPMS/.build.log2 ; then
echo 2
else
echo 33
fi > .osc-build-retval
exit 33
fi
rm -f .build-differed .build-rbkt
export clean
vmtype="--vm-type=kvm" clean="$clean -j${parallelism}" HOST=$host1 OUTDIR=RPMS.2017 nice -n 7 rebuild &
pid=$!
export VM_CUSTOMOPT="-rtc base=$later -cpu $cputype2,l3-cache=on"
export OSC_BUILD_ROOT=/var/tmp/build-root.${slot}b/
clean="$clean -j${parallelism2}" HOST=$host2 OUTDIR=RPMS rebuild
wait $pid
dir1=RPMS.2017 compareone
grep '^0$' .build-differed || oscmount