-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpkg-move-to-ubuntu-openstack-dev
executable file
·38 lines (36 loc) · 1.35 KB
/
pkg-move-to-ubuntu-openstack-dev
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
#!/bin/bash
#
# Author: Chris MacNaughton
#
# This was used to move packages from lp:~ubuntu-server-dev to lp:~ubuntu-openstack-dev.
#
# for package in aodh ... watcher-dashboard zaqar; do ./pkg-move-to-ubuntu-openstack-dev $package; done
#
basepath=$(pwd)
branches="master stable/liberty stable/mitaka stable/newton stable/ocata stable/pike stable/queens stable/rocky stable/stein stable/train stable/ussuri"
package="$1"
git clone lp:~ubuntu-server-dev/ubuntu/+source/$package
mkdir /tmp/$package
cd $package
for branch in $branches; do
git checkout $branch
if [[ "$?" == "0" ]]; then
# BEGIN update d/control and d/changelog appropriately
sed -i "s/ubuntu-server-dev/ubuntu-openstack-dev/g" debian/control
head -n 1 debian/changelog | grep -q UNRELEASED
if [[ "$?" == "0" ]]; then
dch --append "d/control: Update VCS paths for move to lp:~ubuntu-openstack-dev."
else
dch --rebuild "d/control: Update VCS paths for move to lp:~ubuntu-openstack-dev."
fi
debcommit -a
# END update d/control and d/changelog appropriately
fi
done
rm -rf /tmp/$package
git checkout master
git remote add new lp:~ubuntu-openstack-dev/ubuntu/+source/$package
git push --all new; git push --tags new;
git push new 'refs/remotes/origin/upstream:refs/heads/upstream'
git push new 'refs/remotes/origin/pristine-tar:refs/heads/pristine-tar'
cd $basepath