-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpkg-snapshot-version
executable file
·67 lines (60 loc) · 1.6 KB
/
pkg-snapshot-version
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
#!/bin/bash
#
# Update an Ubuntu package to a new upstream snapshot.
#
# Clones git package from upstream into upstream directory.
# Clones git package from launchpad into pkg directory.
# Generates orig tarball from upstream branch and imports to package branch.
# Leaves you in d/changelog to edit.
#
# Note: The following needs to be in ~/.gbp.conf:
# [import-orig]
# postimport = dch -v%(version)s New upstream version.
#
# Examples: pkg-snapshot-version cinder master
# pkg-snapshot-version cinder stable/mitaka
#
set -ex
if [ $# -ne 2 ]
then
echo "Usage: $0 package-name branch-name"
echo " $0 cinder master"
echo " $0 cinder stable/mitaka"
exit
fi
package=$1
branch=$2
rm -rf ~/tarballs
[ -d upstream ] || mkdir upstream
[ -d pkg ] || mkdir pkg
[ -d pkg/${package} ] && rm -rf pkg/${package}
# clone upstream branch and generate snapshot tarball
cd upstream
if [ "$package" = "openstack-trove" ]
then
git clone https://github.com/openstack/trove || true
cd trove
else
git clone https://github.com/openstack/$package || true
cd $package
fi
git checkout $branch
git pull
pkgos-generate-snapshot
cd ../..
# clone package branch and import snapshot tarball
cd pkg
git clone lp:~ubuntu-openstack-dev/ubuntu/+source/$package || true
cd $package
git pull
git checkout pristine-tar
git checkout upstream
git checkout $branch
if [ "$package" = "openstack-trove" ]
then
package="trove"
fi
gbp import-orig --no-interactive --merge-mode=replace ~/tarballs/*${package}_*.orig.tar.gz
cp ~/tarballs/*${package}* ..
dch -i
sed -i "1s/1ubuntu1/0ubuntu1/" debian/changelog