-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackport
More file actions
executable file
·39 lines (39 loc) · 862 Bytes
/
backport
File metadata and controls
executable file
·39 lines (39 loc) · 862 Bytes
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
#!/bin/sh
# Backport a package (or set of packages from a buildlist)
# from cooker to 3.0
# (C) 2016 Bernhard Rosenkraenzer <bero@lindev.ch>
# Released under the GPL v3
set -e
if [ "$1" = "-n" -o "$1" = "--no-build" ]; then
shift
BUILD=false
else
BUILD=true
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
if $BUILD; then
abf chain_build -b 3.0 --update-type enhancement -i $1
fi
exit 0
fi
TMPDIR=$(mktemp -d /tmp/backportXXXXXX)
cd $TMPDIR
git clone git@github.com:OpenMandrivaAssociation/$1.git
cd $1
if git checkout -b 3.0 origin/3.0; then
git rebase master
git push --force origin 3.0
else
git push origin master:3.0
fi
if $BUILD; then
abf build -p openmandriva/$1 -b 3.0 --auto-publish --update-type recommended
fi
cd
rm -rf $TMPDIR