-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathosc-submit-dependencies2
More file actions
executable file
·22 lines (22 loc) · 1.04 KB
/
osc-submit-dependencies2
File metadata and controls
executable file
·22 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh -e
prj="${1:?"Need project in OBS, e.g. home:$USER"}"
src="${src:-"openSUSE:Factory"}"
sleep_duration="${sleep_duration:-20}"
while :; do
result=$(osc api /build/$prj/_result)
if echo $result | grep -q "state.*building"; then
echo "$(date -Is) project building, waiting …"
sleep 60
continue
fi
unresolvables_string=$(osc api /build/$prj/_result | xq -r '.resultlist.result | .[].status | .[] | select(.["@code"]=="unresolvable") | .details')
unresolvables=$(echo "$unresolvables_string" | sed -e 's/(got version[^)]*),\?//g' -e 's/nothing provides \(\S\+\)[^,$]*,\?/\1/g' -e 's/ \+/\n/g' | sed 's/[,(]//' | sort | uniq)
echo "unresolvables: $unresolvables"
for i in $unresolvables; do
dep=$(echo $i | sed -e "s/(/-/" -e "s/::/-/g" -e "s/)//" -e "s/python3[0-9]*/python/")
osc list $prj | grep -q $dep && continue
echo "Adding \"$dep\"" && osc linkpac $src $dep $prj ||:
done
echo "$(date -Is) Next iteration in ${sleep_duration}s …"
sleep $sleep_duration
done