-
Notifications
You must be signed in to change notification settings - Fork 1
/
rolling2rock
executable file
·48 lines (47 loc) · 1.2 KB
/
rolling2rock
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
#!/bin/sh
D="$(mktemp -d /tmp/c2rXXXXXX)"
rock_b=5.0
error() {
echo "$@" >/dev/stderr
cd /
rm -rf "$D"
exit 1
}
if [ -z "$D" ]; then
echo "Couldn't create temporary directory"
exit 1
fi
if [ "$1" = "-f" -o "$1" = "--force" ]; then
FORCE=true
shift
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
if ! git checkout -b $rock_b origin/rolling; then
error "No rolling branch - maybe you need to use cooker2rolling first"
fi
git push --force origin $rock_b
else
error "Couldn't find repository for $1 - bad package name?"
fi
else
if git clone -b $rock_b [email protected]:OpenMandrivaAssociation/$1; then
cd $1
if ! git merge origin/rolling; then
error "Couldn't automatically merge branches. Please try manually."
fi
elif git clone [email protected]:OpenMandrivaAssociation/$1; then
cd $1
git checkout -b $rock_b origin/rolling
else
error "Couldn't find repository for $1 - bad package name?"
fi
git push origin $rock_b
fi
abf chain_build -b $rock_b -a aarch64 -a znver1 -a x86_64 --auto-publish-status testing --no-cached-chroot --update-type enhancement openmandriva/$1