-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildbot.sh
executable file
·69 lines (55 loc) · 1.66 KB
/
buildbot.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
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
WORKDIR=${WORKDIR:=$HOME/repos}
ZSTLOGDIR=${ZSTLOGDIR:=$HOME/logs}
SCRIPTSPATH=${SCRIPTSPATH:=$HOME/loongshot/scripts}
max_retries=2
DOUBLEDASH="--"
for para in "$@"; do
if [[ $para == "--" ]]; then
DOUBLEDASH=""
break
fi
done
umask 002
while [ 1 ]; do
retries=0
pkg=`$SCRIPTSPATH/dbcmd.py task --get --build`
orig=$pkg
if [[ "$pkg" == None ]]; then
exit 0
fi
if [[ "$pkg" == %stop ]]; then
exit 1
fi
if [[ "$pkg" == *:nocheck ]]; then
NOCHECK=--nocheck
pkg=${pkg%:nocheck}
else
NOCHECK=""
fi
# the pkg can have version info in it
if [[ "$pkg" == *:* ]]; then
VER="--ver ${pkg#*:}" # Extracts the version part after the first ":"
pkg=${pkg%%:*}; # Extracts the pkgbase part before the first ":"
else
VER=""
fi
while [[ $retries -lt $max_retries ]]; do
./0build.sh $pkg $VER "$@" $DOUBLEDASH $NOCHECK
((retries++))
if [[ -f all.log ]]; then
ALLLOGS=all.log
else
PKGVER=$(source $WORKDIR/$pkg/PKGBUILD; echo $epoch${epoch:+:}$pkgver-$pkgrel)
ALLLOGS=$ZSTLOGDIR/$pkg/$pkg-$PKGVER.log
fi
# restart to download the corrupted packages
grep "pkg.tar.zst is corrupted" $ALLLOGS >/dev/null 2>&1 && continue
# update config.{sub,guess} and retry
grep -q "unable to guess system type" $ALLLOGS && echo $pkg >> ~/loongarch-packages/update_config && continue
break
done
$SCRIPTSPATH/dbcmd.py task --done $orig
# tracking the soname changes
grep -A4 "WARNING.*Sonames differ" $ALLLOGS >> sonames.log
done