Merge lp:~andreserl/maas/packaging_changes_for_git into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 564
Merged at revision: 561
Proposed branch: lp:~andreserl/maas/packaging_changes_for_git
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 130 lines (+95/-10)
4 files modified
debian/changelog (+1/-1)
debian/rules (+0/-9)
publish (+31/-0)
release-build (+63/-0)
To merge this branch: bzr merge lp:~andreserl/maas/packaging_changes_for_git
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+326225@code.launchpad.net

Commit message

- Remove get-orig-source.
- Do not include rev on debian/changelog header.
- Include scripts that automatically build packaging source files.

To post a comment you must log in.
564. By Andres Rodriguez on 2017-06-23

Update version to match discussion

Revision history for this message
Andres Rodriguez (andreserl) wrote :

selfie!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2017-06-15 08:05:26 +0000
3+++ debian/changelog 2017-06-23 13:32:08 +0000
4@@ -1,4 +1,4 @@
5-maas (2.3.0~alpha1+bzr6085-0ubuntu1) UNRELEASED; urgency=medium
6+maas (2.3.0~alpha1-0ubuntu1) UNRELEASED; urgency=medium
7
8 * UNRELEASED
9
10
11=== modified file 'debian/rules'
12--- debian/rules 2017-06-08 23:30:03 +0000
13+++ debian/rules 2017-06-23 13:32:08 +0000
14@@ -73,12 +73,3 @@
15 dh_auto_clean
16 rm -rf $(BUILDHOME)
17 rm -rf src/*.egg-info
18-
19-DEB_DEBIAN_DIR=$(dir $(firstword $(MAKEFILE_LIST)))
20-REV=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
21- | sed -rne 's,^Version: .*[+~]bzr([0-9]+).*,\1,p')
22-VER=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
23- | sed -rne 's,^Version: ([^-]+).*,\1,p')
24-get-orig-source:
25- bzr export -r $(REV) --root=maas-$(VER).orig \
26- maas_$(VER).orig.tar.gz lp:maas
27
28=== added file 'publish'
29--- publish 1970-01-01 00:00:00 +0000
30+++ publish 2017-06-23 13:32:08 +0000
31@@ -0,0 +1,31 @@
32+#!/bin/sh -e
33+
34+PKG=$(head -n1 debian/changelog | awk '{print $1}')
35+VER=$(head -n 1 debian/changelog | sed 's/^.*(//' | sed 's/).*//' | sed 's/-.*//')
36+
37+case "$1" in
38+ experimental3)
39+ dput -f ppa:maas-maintainers/experimental3 maas*source.changes
40+ ;;
41+ next)
42+ dput -f ppa:maas/next maas*source.changes
43+ ;;
44+ next-proposed)
45+ dput -f ppa:maas/next-proposed maas*source.changes
46+ ;;
47+ experimental)
48+ echo "experimental"
49+ dput -f ppa:maas-maintainers/experimental maas*trusty*source.changes
50+ dput -f ppa:maas-maintainers/experimental maas*vivid*source.changes
51+ dput -f ppa:maas-maintainers/experimental maas*wily*source.changes
52+ ;;
53+ proposed)
54+ dput -f ppa:maas/proposed maas*source.changes
55+ ;;
56+ stable)
57+ dput -f ppa:maas/stable maas*source.changes
58+ ;;
59+ *)
60+ dput -f $1 maas*source.changes
61+ ;;
62+esac
63
64=== added file 'release-build'
65--- release-build 1970-01-01 00:00:00 +0000
66+++ release-build 2017-06-23 13:32:08 +0000
67@@ -0,0 +1,63 @@
68+#!/bin/sh -e
69+error() {
70+ echo "ERROR: $@" >&2
71+ exit 1
72+}
73+
74+usage () {
75+ echo "Usage:"
76+ echo " $0 <path-to-local-repo> [commit (defaults to HEAD)]"
77+ exit 1
78+}
79+
80+if [ -z "$1" ]; then
81+ usage
82+ if [ ! -f $1 ]; then
83+ error "Local branch location does not exist. Cannot proceed"
84+ fi
85+fi
86+
87+if [ -z "$2" ]; then
88+ echo "WARNING: No commit specified, using HEAD instead"
89+ COMMIT="HEAD"
90+else
91+ COMMIT="$2"
92+fi
93+
94+PKG=$(head -n1 debian/changelog | awk '{print $1}')
95+MAJOR_VER=$(head -n 1 debian/changelog | sed 's/^.*(//' | sed 's/).*//' | sed 's/-.*//')
96+#REV=$(head -n 1 debian/changelog | sed -rne 's,.*[+~.]git([0-9a-zA-Z]+).*,\1,p')
97+REV_COUNT=$(git -C $1 rev-list --count $COMMIT)
98+REV_SHORT=$(git -C $1 rev-parse --short $COMMIT)
99+FULL_VER="$MAJOR_VER+git$REV_COUNT.$REV_SHORT"
100+TARBALL="maas_$FULL_VER.orig.tar.gz"
101+
102+get_orig_source() {
103+ branch="$1"
104+ git -C $branch archive --format=tar.gz --prefix="maas-$FULL_VER.orig/" $COMMIT -o $TARBALL $REV
105+
106+}
107+# Obtain the tarball from a local branch
108+get_orig_source $1 $FULL_VER $REV
109+
110+# Copy the tarball to the local dir
111+mv "${1}/${TARBALL}" .
112+
113+# Update the changelog
114+sed -i "s/${MAJOR_VER}-0ubuntu1/${FULL_VER}-0ubuntu1/i" debian/changelog
115+
116+# Untar
117+tar zxvf ${PKG}_${FULL_VER}.orig.tar.gz
118+cd "${PKG}-${FULL_VER}.orig/"
119+cp -r ../debian .
120+sed -i "s/) UNRELEASED;/~16.04.1) xenial;/i" debian/changelog
121+debuild -S -sa
122+sed -i "s/~16.04.1) xenial;/~16.10.1) yakkety;/" debian/changelog
123+debuild -S
124+sed -i "s/~16.10.1) yakkety;/~17.04.1) zesty;/" debian/changelog
125+debuild -S
126+sed -i "s/~17.04.1) zesty;/~17.10.1) artful;/" debian/changelog
127+debuild -S
128+
129+cd ../
130+sed -i "s/${FULL_VER}-0ubuntu1/${MAJOR_VER}-0ubuntu1/i" debian/changelog

Subscribers

People subscribed via source and target branches

to all changes: