Merge ~dbungert/curtin:build-deb-dch into curtin:master

Proposed by Dan Bungert
Status: Merged
Approved by: Dan Bungert
Approved revision: ea4cca677245ea6cb68ea0fda24e1a0a7416592f
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~dbungert/curtin:build-deb-dch
Merge into: curtin:master
Diff against target: 108 lines (+10/-46)
2 files modified
dev/null (+0/-5)
tools/build-deb (+10/-41)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Olivier Gayot Approve
Review via email: mp+413637@code.launchpad.net

Commit message

build-deb: changelog gen with dch

* primary reason for this is to generate the changelog with a real
  DEBNAME/DEBEMAIL
* remove template debian/changelog.trunk
* assume debian version 0ubuntu1
* let dch manage the changelog file

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Gayot (ogayot) wrote :

Hello,

A few observations on the code itself. Nothing serious.

also, there are other places where the changelog.trunk is mentioned, maybe we should update:
* if [ ! -d "$dir" ]; then
    # make-tarball will create the directory name based on the
    # contents of debian/changelog.trunk in the version provided.

* echo "WARNING: git at '${uver}' had different version"
        echo " in debian/changelog.trunk than your tree. version there"
        echo " is '$d' working directory had $uver"

Thanks,
Olivier

review: Needs Fixing
~dbungert/curtin:build-deb-dch updated
1d96c58... by Dan Bungert

build-deb: address feedback

* quoted variables are safer in case RELEASE or uver are set weirdly
* remove more references to changelog.trunk
* remove some more logic looking at the tarball, it's OK to have this
  handle snapshots
* fix zero-arg usage

ea4cca6... by Dan Bungert

build-deb: change default to signed files

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Gayot (ogayot) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog.trunk b/debian/changelog.trunk
2deleted file mode 100644
3index 4d943c0..0000000
4--- a/debian/changelog.trunk
5+++ /dev/null
6@@ -1,5 +0,0 @@
7-curtin (UPSTREAM_VER-0ubuntu1) UNRELEASED; urgency=low
8-
9- * Initial release
10-
11- -- Scott Moser <smoser@ubuntu.com> Mon, 29 Jul 2013 16:12:09 -0400
12diff --git a/tools/build-deb b/tools/build-deb
13index dbe364f..85868d7 100755
14--- a/tools/build-deb
15+++ b/tools/build-deb
16@@ -1,7 +1,7 @@
17 #!/bin/sh
18 # This file is part of curtin. See LICENSE file for copyright and license info.
19
20-set -e
21+set -eu
22
23 sourcename="curtin"
24 TEMP_D=""
25@@ -13,7 +13,7 @@ cleanup() {
26 [ -z "$TEMP_D" ] || rm -Rf "$TEMP_D"
27 }
28
29-if [ "$1" = "-h" -o "$1" = "--help" ]; then
30+if [ "${1:-}" = "-h" -o "${1:-}" = "--help" ]; then
31 cat <<EOF
32 Usage: ${0##*/}
33 build a deb of from trunk directory
34@@ -36,19 +36,13 @@ top_d=$(cd "$(dirname "${0}")"/.. && pwd)
35 ref=HEAD
36
37 if [ $# -eq 0 ]; then
38- # if no opts given, build source, without depends, and not signed.
39- set -- -S -d -us -uc
40+ # if no opts given, build source, without depends.
41+ set -- -S -d
42 fi
43
44-# grab the first line in the changelog
45-# hopefully this pulls the version info there
46-# resulting in something like: UPSTREAM_VER-0ubuntu1
47-clogver_o=$(sed -n '1s,.*(\([^)]*\)).*,\1,p' debian/changelog.trunk)
48-
49 # uver gets 17.1-3-gc85e2562 '17.1' if this is a tag.
50 uver=$(git describe --long --abbrev=8 "--match=[0-9][0-9]*" "$ref")
51-clogver_debian=${clogver_o##*-}
52-clogver_new="${uver}-${clogver_debian}"
53+clogver_new="${uver}-0ubuntu1"
54
55 # uver_base_rel rel gets '17.1'
56 uver_base_rel=${uver%%-*}
57@@ -60,7 +54,7 @@ TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${bname}.XXXXXX")
58
59 trap cleanup EXIT
60
61-echo "building version ${uver}, debian_ver=${clogver_debian}"
62+echo "building version ${uver}"
63
64 dir="${sourcename}-$uver"
65 tarball="${sourcename}_$uver.orig.tar.gz"
66@@ -73,38 +67,13 @@ cd "${TEMP_D}"
67 tar xzf "$tarball" || fail "failed extract tarball"
68
69 if [ ! -d "$dir" ]; then
70- # make-tarball will create the directory name based on the
71- # contents of debian/changelog.trunk in the version provided.
72- # if that differs from what is here, then user has changes.
73- for d in ${sourcename}*; do
74- [ -d "$d" ] && break
75- done
76- if [ -d "$d" ]; then
77- {
78- echo "WARNING: git at '${uver}' had different version"
79- echo " in debian/changelog.trunk than your tree. version there"
80- echo " is '$d' working directory had $uver"
81- } 1>&2
82- dir=$d
83- else
84- echo "did not find a directory created by make-tarball. sorry." 1>&2
85- exit
86- fi
87+ echo "did not find a directory created by make-tarball. sorry." 1>&2
88+ exit
89 fi
90 cd "$dir" || fail "failed cd $dir"
91
92-# move files ending in .trunk to name without .trunk
93-# ie, this copies debian/changelog.trunk to debian/changelog
94-for f in debian/*.trunk; do
95- mv "$f" "${f%.trunk}"
96-done
97-
98-# first line of debian/changelog looks like
99-# curtin (<version>) UNRELEASED; urgency=low
100-# fix the version and UNRELEASED
101-sed -i -e "1s,([^)]*),(${clogver_new})," \
102- -e "1s,UNRELEASED,${RELEASE}," debian/changelog ||
103- fail "failed to write debian/changelog"
104+dch --create --package curtin --newversion "$clogver_new" \
105+ --distribution "$RELEASE" "Development release"
106 debuild "$@" || fail "debuild failed"
107
108 cd "$TEMP_D"

Subscribers

People subscribed via source and target branches