-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrebuild
executable file
·46 lines (40 loc) · 1.37 KB
/
rebuild
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
#!/bin/sh
# Usage: rebuild project [reason]
# project: Project to rebuild (ls *.buildlist for available projects)
# reason: Reason to give in commit message
#
# (C) 2019 Bernhard Rosenkränzer <[email protected]>
# Released under the terms of the GPLv3
if [ "$#" -lt 1 ]; then
echo "Specify the project to rebuild"
exit 1
fi
PROJECT="$1"
shift
REASON="$@"
[ -z "$REASON" ] && REASON="Rebuild"
PACKAGES="$(cat $(dirname $0)/$PROJECT.buildlist |grep -vE '^#' |sed -e 's,openmandriva/,,g')"
for i in $PACKAGES; do
rm -rf ${i}
git clone [email protected]:OpenMandrivaAssociation/${i}.git || error $i
cd ${i}
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 $i"
exit 1
fi
sed -i -e "s,^\(Release.*:.*\)${OLDRELEASE},\1${RELEASE}," *.spec
git commit -am "$REASON"
git push origin master
cd ..
done
abf chain_build -a znver1 -a aarch64 -a x86_64 -b master --update-type enhancement -i $PROJECT.buildlist