-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcooker2rolling
executable file
·65 lines (59 loc) · 1.52 KB
/
cooker2rolling
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
#!/bin/sh
DO_ABF_BUILD=true
if [ "$1" = "-n" ]; then
DO_ABF_BUILD=false
shift
fi
if [ "$1" = "-f" -o "$1" = "--force" ]; then
FORCE=true
shift
fi
if echo $1 |grep -q '\.buildlist'; then
cat $1 |while read r; do
for pkg in $r; do
p=$(echo $pkg |sed -e 's,openmandriva/,,')
$0 -n $p
done
done
$DO_ABF_BUILD && abf chain_build --testing -b rolling -a aarch64 -a znver1 -a x86_64 --auto-publish-status testing --no-cached-chroot --update-type enhancement -i $1
exit 0
fi
D="$(mktemp -d /tmp/c2rXXXXXX)"
error() {
echo "$@" >/dev/stderr
cd /
rm -rf "$D"
exit 1
}
if [ -z "$D" ]; then
echo "Couldn't create temporary directory"
exit 1
fi
if [ -z "$1" ]; then
echo "Usage: $0 package name"
exit 1
fi
cd "$D"
if [ "$FORCE" = "true" ]; then
if git clone [email protected]:OpenMandrivaAssociation/$1; then
cd $1
git checkout -b rolling origin/master
git push --force origin rolling
else
error "Couldn't find repository for $1 - bad package name?"
fi
else
if git clone -b rolling [email protected]:OpenMandrivaAssociation/$1; then
cd $1
if ! git merge origin/master; then
error "Couldn't automatically merge branches. Please try manually."
fi
elif git clone [email protected]:OpenMandrivaAssociation/$1; then
cd $1
git checkout -b rolling origin/master
else
error "Couldn't find repository for $1 - bad package name?"
fi
git push origin rolling
fi
$DO_ABF_BUILD && abf chain_build -b rolling -a aarch64 -a znver1 -a x86_64 --auto-publish-status testing --no-cached-chroot --update-type enhancement openmandriva/$1