-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrebuilddeps
executable file
·87 lines (78 loc) · 2.28 KB
/
rebuilddeps
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
# Rebuild everything that has a given dependency (e.g. after an update
# with an ABI breakage and/or soname bump)
# Usage:
# ./rebuilddeps 'dependency' ['commit message']
# e.g.
# ./rebuilddeps 'libQt6Core.so.6()(64bit)' 'Rebuild for updated Qt'
# Automatically excludes KDE when rebuilding for a Qt dependency, because
# KDE bits need to be built in the right order (use the buildlists for that).
error() {
echo "$@"
exit 1
}
D=$(realpath $(dirname "$0"))
is_qt6=false
if [ "$1" = "-r" ]; then
DONT_BUMP=true
shift
else
DONT_BUMP=false
fi
if [ "$1" = "-l" ]; then
DONT_BUMP=true
LIST_ONLY=true
shift
else
LIST_ONLY=false
fi
DEP="$1"
shift
if [ "$#" -gt 0 ]; then
REASON="$@"
else
REASON="Rebuild for updated $(echo $DEP |sed -e 's,\.so\.[0-9].*,,;s,\(\)\(64bit\),,')"
fi
if echo "$DEP" |grep -qE '^libQt6(Core|Gui|Network|Svg)'; then
is_qt6=true
fi
while read r; do
echo "========== $r =========="
if $is_qt6; then
if grep -qE "openmandriva/$r($| )" $D/qt6.buildlist $D/kf6.buildlist $D/plasma6.buildlist $D/kapps6.buildlist; then
echo "NOT $r"
continue
fi
fi
[ "$r" = "lucene++" ] && r=luceneplusplus
if ! $DONT_BUMP; then
rm -rf ${r}
git clone [email protected]:OpenMandrivaAssociation/${r}.git || error clone $r
cd ${r}
OLDRELEASE="$(grep -i '^Release[[:space:]]*:' *.spec |cut -d: -f2- |xargs echo)"
if echo ${OLDRELEASE} |grep -q '}'; then
NUMREL=`echo $OLDRELEASE |rev |cut -d'}' -f1 |rev`
RELEASE=`echo $OLDRELEASE |sed -e "s,}[^}]*\$,}$((NUMREL+1)),"`
elif echo ${OLDRELEASE} |grep -q '\.'; then
NUMREL=`echo $OLDRELEASE |rev |cut -d'.' -f1 |rev`
RELEASE=`echo $OLDRELEASE |sed -e "s,\.[^.]*\$,.$((NUMREL+1)),"`
else
RELEASE=$((OLDRELEASE+1))
fi
if [ "$RELEASE" = "$OLDRELEASE" ]; then
error "Could not determine new release number for $r"
fi
sed -i -e "s,^\(Release.*:.*\)${OLDRELEASE},\1${RELEASE}," *.spec
git commit -am "$REASON"
git push origin master
cd ..
fi
BUILDLIST="$BUILDLIST openmandriva/$r"
done < <(dnf --refresh repoquery --whatrequires "$DEP" --qf '%{sourcerpm}' |rev |cut -d- -f3- |rev |sort |uniq)
if [ -n "$BUILDLIST" ]; then
if $LIST_ONLY; then
echo $BUILDLIST
else
echo $BUILDLIST | abf chain_build -a znver1 -a aarch64 -a x86_64 -b master --no-extra-tests --update-type enhancement -i /dev/stdin
fi
fi