Merge ~smoser/curtin:test-git into curtin:master

Proposed by Scott Moser on 2017-12-19
Status: Merged
Merged at revision: c5cb03e197f0a5066188530f50b2c6c1f15a904a
Proposed branch: ~smoser/curtin:test-git
Merge into: curtin:master
Diff against target: 551 lines (+262/-111)
12 files modified
.gitignore (+1/-0)
curtin/version.py (+7/-7)
debian/changelog.trunk (+1/-1)
debian/control (+0/-2)
dev/null (+0/-61)
doc/topics/development.rst (+5/-6)
tests/unittests/test_block_iscsi.py (+2/-2)
tests/unittests/test_version.py (+5/-5)
tools/build-deb (+21/-26)
tools/make-tarball (+50/-0)
tools/new-upstream-snapshot (+169/-0)
tox.ini (+1/-1)
Reviewer Review Type Date Requested Status
Ryan Harper Approve on 2017-12-20
Server Team CI bot continuous-integration Needs Fixing on 2017-12-20
Chad Smith 2017-12-19 Approve on 2017-12-20
Review via email: mp+335415@code.launchpad.net

Description of the Change

Two commits that might as well be kept separate.

-----
debian/control: drop conflicts that had bzr version

this is fine as the bzr version (~bzr54) is not in any supported
release.. trusty is at 126-0ubuntu1 in released version even.

----
Switch uses of bzr to git, borrow from cloud-init git workflow.

Basically replace all references to bzr. git-describe and experience
in cloud-init make this fairly painless.

 - curtin/version.py
   replace usage of 'bzr revno' with 'git-describe'.
   versions 'packed' from git will show a version like 17.1-5-gdfd3389f.

 - debian/changelog.trunk
   remove the hard coded version string.

 - tools/export-tarball, tools/make-tarball:
   replace export-tarball with a version of make-tarball taken from
   cloud-init.

 - tools/build-deb, update to use git-describe and make-tarball.
   Also set some default parameters (-S -d -us -uc).

 - doc/, tox.ini, just replace bzr with git.

To post a comment you must log in.
Chad Smith (chad.smith) wrote :

Generally looks like a good first pass, but trying to run this on artful hits issues parsing old changelog containing *bzr* and trying to run git log against that version versus master

fatal: ambiguous argument '0.1.0~bzr532..master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
failed git log 0.1.0~bzr532..master

Chad Smith (chad.smith) wrote :

Should we be performing the git log relative to our tags?
 git log ubuntu/17.0_bzr552-0ubuntu1..master

Scott Moser (smoser) wrote :

will fix

Chad Smith (chad.smith) :
Chad Smith (chad.smith) wrote :

Thanks for the updates here, new-upstream-snapshot changes work well. The CI failures I think are irrelevant due to us switching to git and killing off bzr

from jenkins
+ bzr branch 'lp:~smoser/curtin' curtin-709
bzr: ERROR: Invalid url supplied to transport: "lp:~smoser/curtin": ~smoser/curtin is too short to be a branch name. Try '~<owner>/+junk/<branch>', '~<owner>/<product>/<branch> or '~<owner>/<distribution>/<series>/<sourcepackage>/<branch>'.

review: Approve
Chad Smith (chad.smith) wrote :

Thanks for the fixes new-upstream-snapshot and tools/build-deb work for me now. LGTM!

review: Approve
Ryan Harper (raharper) wrote :

Looks good. One comment on --long to make-tarball

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.bzrignore b/.gitignore
2index 83bb75f..8f343e7 100644
3--- a/.bzrignore
4+++ b/.gitignore
5@@ -2,3 +2,4 @@
6 __pycache__
7 .tox
8 .coverage
9+curtin.egg-info/
10diff --git a/curtin/version.py b/curtin/version.py
11index dd342f9..10992dc 100644
12--- a/curtin/version.py
13+++ b/curtin/version.py
14@@ -15,15 +15,15 @@ def version_string():
15 if not _PACKED_VERSION.startswith('@@'):
16 return _PACKED_VERSION
17
18- revno = None
19 version = old_version
20- bzrdir = os.path.abspath(os.path.join(__file__, '..', '..', '.bzr'))
21- if os.path.isdir(bzrdir):
22+ gitdir = os.path.abspath(os.path.join(__file__, '..', '..', '.git'))
23+ if os.path.exists(gitdir):
24 try:
25- out = subprocess.check_output(['bzr', 'revno'], cwd=bzrdir)
26- revno = out.decode('utf-8').strip()
27- if revno:
28- version += "~bzr%s" % revno
29+ out = subprocess.check_output(
30+ ['git', 'describe', '--long', '--abbrev=8',
31+ "--match=[0-9][0-9]*"],
32+ cwd=os.path.dirname(gitdir))
33+ version = out.decode('utf-8').strip()
34 except subprocess.CalledProcessError:
35 pass
36
37diff --git a/debian/changelog.trunk b/debian/changelog.trunk
38index ec1e294..4d943c0 100644
39--- a/debian/changelog.trunk
40+++ b/debian/changelog.trunk
41@@ -1,4 +1,4 @@
42-curtin (17.1~bzrREVNO-0ubuntu1) UNRELEASED; urgency=low
43+curtin (UPSTREAM_VER-0ubuntu1) UNRELEASED; urgency=low
44
45 * Initial release
46
47diff --git a/debian/control b/debian/control
48index 7130bf9..305bbd7 100644
49--- a/debian/control
50+++ b/debian/control
51@@ -50,7 +50,6 @@ Package: curtin-common
52 Architecture: all
53 Priority: extra
54 Depends: ${misc:Depends}
55-Conflicts: curtin (<= 0.1.0~bzr54-0ubuntu1)
56 Description: Library and tools for curtin installer
57 This package contains utilities for the curtin installer.
58
59@@ -71,7 +70,6 @@ Package: python3-curtin
60 Section: python
61 Architecture: all
62 Priority: extra
63-Conflicts: curtin (<= 0.1.0~bzr54-0ubuntu1)
64 Depends: curtin-common (= ${binary:Version}),
65 python3-oauthlib,
66 python3-yaml,
67diff --git a/doc/topics/development.rst b/doc/topics/development.rst
68index 39b52c4..a1f6a36 100644
69--- a/doc/topics/development.rst
70+++ b/doc/topics/development.rst
71@@ -10,7 +10,7 @@ Install dependencies
72
73 Install some virtualization and cloud packages to get started.::
74
75- sudo apt-get -qy install kvm libvirt-bin cloud-utils bzr
76+ sudo apt-get -qy install kvm libvirt-bin cloud-utils git
77
78
79 Download cloud images
80@@ -33,19 +33,18 @@ Curtin will use two cloud images (-disk1.img) is for booting,
81
82 Getting the source
83 ==================
84-Download curtin source from launchpad via `bzr` command.::
85+Download curtin source from launchpad via `git` command.::
86
87 mkdir -p ~/src
88- bzr init-repo ~/src/curtin
89- ( cd ~/src/curtin && bzr branch lp:curtin trunk.dist )
90- ( cd ~/src/curtin && bzr branch trunk.dist trunk )
91+ cd ~/src
92+ git clone https://git.launchpad.net/curtin
93
94 Using curtin
95 ============
96 Use `launch` to launch a kvm instance with user data to pack up
97 local curtin and run it inside an instance.::
98
99- cd ~/src/curtin/trunk
100+ cd ~/src/curtin
101 ./tools/launch $BOOTIMG --publish $ROOTTGZ -- curtin install "PUBURL/${ROOTTGZ##*/}"
102
103
104diff --git a/tests/unittests/test_block_iscsi.py b/tests/unittests/test_block_iscsi.py
105index 8592fc6..382bed6 100644
106--- a/tests/unittests/test_block_iscsi.py
107+++ b/tests/unittests/test_block_iscsi.py
108@@ -527,7 +527,7 @@ class TestBlockIscsiVolPath(CiTestCase):
109
110 def test_volpath_is_iscsi_layered_true(self):
111 volume_path = '/dev/wark'
112- slaves = ['wark', 'bzr', 'super-iscsi-lun-27']
113+ slaves = ['wark', 'bzoink', 'super-iscsi-lun-27']
114 self.mock_get_device_slave_knames.return_value = slaves
115 self.mock_path_to_kname.side_effect = lambda x: x
116 self.mock_kname_is_iscsi.side_effect = lambda x: 'iscsi' in x
117@@ -542,7 +542,7 @@ class TestBlockIscsiVolPath(CiTestCase):
118
119 def test_volpath_is_iscsi_layered_false(self):
120 volume_path = '/dev/wark'
121- slaves = ['wark', 'bzr', 'nvmen27p47']
122+ slaves = ['wark', 'bzoink', 'nvmen27p47']
123 self.mock_get_device_slave_knames.return_value = slaves
124 self.mock_path_to_kname.side_effect = lambda x: x
125 self.mock_kname_is_iscsi.side_effect = lambda x: 'iscsi' in x
126diff --git a/tests/unittests/test_version.py b/tests/unittests/test_version.py
127index 2d3ab7d..c4c1099 100644
128--- a/tests/unittests/test_version.py
129+++ b/tests/unittests/test_version.py
130@@ -31,16 +31,16 @@ class TestCurtinVersion(CiTestCase):
131
132 version._PACKAGED_VERSION = original_pkg_string
133
134- def test_bzr_revno_version(self):
135+ def test_git_describe_version(self):
136 self.mock_path.exists.return_value = True
137- bzr_revno = "999"
138- self.mock_subp.return_value = bzr_revno.encode("utf-8")
139+ git_describe = old_version + "-13-g90fa654f"
140+ self.mock_subp.return_value = git_describe.encode("utf-8")
141
142 ver_string = version.version_string()
143- self.assertEqual(old_version + "~bzr" + bzr_revno, ver_string)
144+ self.assertEqual(git_describe, ver_string)
145
146 @mock.patch.object(os, 'getcwd')
147- def test_bzr_revno_version_exception(self, mock_getcwd):
148+ def test_git_describe_version_exception(self, mock_getcwd):
149 self.mock_path.exists.return_value = True
150 mock_getcwd.return_value = "/tmp/foo"
151 self.mock_subp.side_effect = subprocess.CalledProcessError(1, 'foo')
152diff --git a/tools/build-deb b/tools/build-deb
153index 685473b..d928595 100755
154--- a/tools/build-deb
155+++ b/tools/build-deb
156@@ -32,52 +32,47 @@ bname=${0##*/}
157
158 start_d=$PWD
159 top_d=$(cd "$(dirname "${0}")"/.. && pwd)
160+ref=HEAD
161+
162+if [ $# -eq 0 ]; then
163+ # if no opts given, build source, without depends, and not signed.
164+ set -- -S -d -us -uc
165+fi
166
167 # grab the first line in the changelog
168 # hopefully this pulls the version info there
169-# resulting in something like: 0.1.0~bzrREVNO-1~trunk1
170+# resulting in something like: UPSTREAM_VER-0ubuntu1
171 clogver_o=$(sed -n '1s,.*(\([^)]*\)).*,\1,p' debian/changelog.trunk)
172
173-revno=$(bzr revno) || fail "failed to get revno"
174-clogver_upstream=${clogver_o%%-*}
175-clogver_debian=${clogver_o#*-}
176-
177-# uver_bzr gets 17.1~bzr<revno>
178-uver_bzr=$(echo "${clogver_upstream}" | sed "s,REVNO,$revno,")
179-# uver_rel gets '17.1'
180-uver_rel=$(echo "${clogver_upstream}" | sed 's,~bzrREVNO,,')
181-
182-tag_revno=$(bzr tags | awk '$1 == v { print $2 }' v="${uver_rel}")
183-if [ "${tag_revno}" = "$revno" ]; then
184- # if this is a tag, then drop ~bzrXXX from the changelog version.
185- echo "Building a tag of upstream version ($uver_rel -> $revno)" 1>&2
186- clogver_new="${uver}-${clogver_debian}"
187- uver="${uver_rel}"
188- export_string="tag:${uver_rel}"
189-else
190- uver="${uver_bzr}"
191- export_string="$revno"
192-fi
193+# uver gets 17.1-3-gc85e2562 '17.1' if this is a tag.
194+uver=$(git describe --long --abbrev=8 "--match=[0-9][0-9]*" "$ref")
195+clogver_debian=${clogver_o##*-}
196 clogver_new="${uver}-${clogver_debian}"
197
198+# uver_base_rel rel gets '17.1'
199+uver_base_rel=${uver%%-*}
200+if [ "${uver_base_rel}" = "${uver}" ]; then
201+ echo "building from a tagged version ($uver)" 1>&2
202+fi
203+
204 TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${bname}.XXXXXX")
205
206 trap cleanup EXIT
207
208-echo "building upstream version $uver, debian ver=${clogver_debian}"
209+echo "building version ${uver}, debian_ver=${clogver_debian}"
210
211 dir="${sourcename}-$uver"
212 tarball="${sourcename}_$uver.orig.tar.gz"
213
214 myd=$(dirname "$0")
215-"$myd/export-tarball" "${export_string}" "${TEMP_D}/$tarball"
216+"$myd/make-tarball" --output="$TEMP_D/$tarball" --long "$ref"
217 echo "created ${tarball}"
218
219 cd "${TEMP_D}"
220 tar xzf "$tarball" || fail "failed extract tarball"
221
222 if [ ! -d "$dir" ]; then
223- # export-tarball will create the directory name based on the
224+ # make-tarball will create the directory name based on the
225 # contents of debian/changelog.trunk in the version provided.
226 # if that differs from what is here, then user has changes.
227 for d in ${sourcename}*; do
228@@ -85,13 +80,13 @@ if [ ! -d "$dir" ]; then
229 done
230 if [ -d "$d" ]; then
231 {
232- echo "WARNING: bzr at '${export_string}' had different version"
233+ echo "WARNING: git at '${uver}' had different version"
234 echo " in debian/changelog.trunk than your tree. version there"
235 echo " is '$d' working directory had $uver"
236 } 1>&2
237 dir=$d
238 else
239- echo "did not find a directory created by export-tarball. sorry." 1>&2
240+ echo "did not find a directory created by make-tarball. sorry." 1>&2
241 exit
242 fi
243 fi
244diff --git a/tools/export-tarball b/tools/export-tarball
245deleted file mode 100755
246index 1b9c17d..0000000
247--- a/tools/export-tarball
248+++ /dev/null
249@@ -1,61 +0,0 @@
250-#!/bin/sh
251-
252-set -e
253-sourcename="curtin"
254-
255-Usage() {
256- cat <<EOF
257-Usage: [revno [output.tar.gz]]
258-
259- Create a tarball of revno (or tag) in output.tar.gz
260- revno defaults to \`bzr revno\`.
261- output filename defaults to:
262- curtin-X.Y~bzrREVNO.tar.gz
263- or, if a tag is given:
264- curtin-TAG.tar.gz
265-
266- if UNCOMMITTED is set to non '0' in environment
267- then uncommitted changes will be kept in the tarball.
268-EOF
269-}
270-
271-TEMP_D=""
272-fail() { echo "$@" 1>&2; exit 1; }
273-cleanup() {
274- [ -z "$TEMP_D" ] || rm -Rf "$TEMP_D"
275-}
276-
277-export_uncommitted=""
278-if [ "${UNCOMMITTED:-0}" != "0" ]; then
279- export_uncommitted="--uncommitted"
280-fi
281-
282-[ "$1" = "-h" -o "$1" = "--help" ] && { Usage; exit 0; }
283-
284-TEMP_D=$(mktemp -d)
285-trap cleanup EXIT
286-
287-case "${1:-HEAD}" in
288- tag:*) version="${1#tag:}";;
289- HEAD) revno="$(bzr revno)"; revargs="-r $revno";;
290- [0-9]*) revno="$1" ; revargs="-r $1";;
291-esac
292-output="$2"
293-
294-if [ -z "$version" ]; then
295- bzr cat $revargs debian/changelog.trunk > "$TEMP_D/clog" ||
296- fail "failed to extract debian/change.log.trunk at $revargs"
297-
298- clogver_o=$(sed -n '1s,.*(\([^)]*\)).*,\1,p' $TEMP_D/clog)
299- clogver_upstream=${clogver_o%%-*}
300- mmm=${clogver_o%%~*}
301- version="$mmm~bzr$revno"
302-fi
303-
304-if [ -z "$output" ]; then
305- output="$sourcename-$version.tar.gz"
306-fi
307-
308-bzr export ${export_uncommitted} \
309- --format=tgz --root="$sourcename-${version}" $revargs $output
310-echo "wrote $output"
311diff --git a/tools/make-tarball b/tools/make-tarball
312new file mode 100755
313index 0000000..e2fce38
314--- /dev/null
315+++ b/tools/make-tarball
316@@ -0,0 +1,50 @@
317+#!/bin/sh
318+set -e
319+
320+TEMP_D=""
321+cleanup() {
322+ [ -z "$TEMP_D" ] || rm -Rf "${TEMP_D}"
323+}
324+trap cleanup EXIT
325+
326+Usage() {
327+ cat <<EOF
328+Usage: ${0##*/} [revision]
329+ create a tarball of revision (default HEAD)
330+
331+ options:
332+ -o | --output FILE write to file
333+EOF
334+}
335+
336+short_opts="ho:v"
337+long_opts="help,output:,long,verbose"
338+getopt_out=$(getopt --name "${0##*/}" \
339+ --options "${short_opts}" --long "${long_opts}" -- "$@") &&
340+ eval set -- "${getopt_out}" || { Usage 1>&2; exit 1; }
341+
342+long_opt=""
343+while [ $# -ne 0 ]; do
344+ cur=$1; next=$2
345+ case "$cur" in
346+ -o|--output) output=$next; shift;;
347+ --long) long_opt="--long";;
348+ --) shift; break;;
349+ esac
350+ shift;
351+done
352+
353+rev=${1:-HEAD}
354+version=$(git describe --abbrev=8 "--match=[0-9][0-9]*" ${long_opt} $rev)
355+
356+archive_base="curtin-$version"
357+if [ -z "$output" ]; then
358+ output="$archive_base.tar.gz"
359+fi
360+
361+TEMP_D=$(mktemp -d)
362+tar=${output##*/}
363+tar="$TEMP_D/${tar%.gz}"
364+git archive --format=tar --prefix="$archive_base/" "$rev" > "$tar"
365+gzip -9 -c "$tar" > "$output"
366+echo "$output"
367diff --git a/tools/new-upstream-snapshot b/tools/new-upstream-snapshot
368new file mode 100755
369index 0000000..925deb2
370--- /dev/null
371+++ b/tools/new-upstream-snapshot
372@@ -0,0 +1,169 @@
373+#!/bin/sh
374+
375+TEMP_D=""
376+CR='
377+'
378+error() { echo "$@" 1>&2; }
379+fail() { [ $# -eq 0 ] || error "$@"; exit 1; }
380+Usage() {
381+cat <<EOF
382+${0##*/} [branch]
383+ update current branch with trunk branch.
384+ branch defaults to 'master'
385+EOF
386+}
387+
388+print_commit() {
389+ local subject="$1" author="$2" bugs="$3" aname="" abugs=""
390+ local indent=" - " indent2=" " ll=79
391+ aname=${author% <*}
392+ [ "${aname}" = "Scott Moser" ] && aname=""
393+ abugs="${aname:+ [${aname}]}${bugs:+ (LP: ${bugs})}"
394+ if [ $((${#subject}+${#abugs})) -le $(($ll-${#indent})) ]; then
395+ echo "${indent}${subject}${abugs}"
396+ elif [ ${#subject} -ge $(($ll-${#indent})) ]; then
397+ echo "${subject}${abugs}" |
398+ fmt --width=$(($ll-${#indent})) |
399+ sed -e "1s/^/${indent}/; 1n;" \
400+ -e 's/^[ ]*//' \
401+ -e '/^[ ]*$/d' -e "s/^/$indent2/" -e 's/[ ]\+$//'
402+
403+ else
404+ ( echo "${subject}"; echo "${abugs}" ) |
405+ fmt --width=$(($ll-${#indent})) |
406+ sed -e "1s/^/${indent}/; 1n;" \
407+ -e 's/^[ ]*//' \
408+ -e '/^[ ]*$/d' -e "s/^/$indent2/" -e 's/[ ]\+$//'
409+ fi
410+}
411+
412+git_log_to_dch() {
413+ local line="" commit="" lcommit="" bugs=""
414+ while :; do
415+ read line || break
416+ case "$line" in
417+ commit\ *)
418+ if [ -n "$commit" ]; then
419+ print_commit "$subject" "$author" "$bugs"
420+ fi
421+ commit=${line#*: }
422+ bugs=""
423+ author=""
424+ subject=""
425+ ;;
426+ Author:*) author="${line#Author: }";;
427+ LP:*) bugs="${bugs:+${bugs}, }${line#*: }";;
428+ "") [ -z "$subject" ] && read subject;;
429+ esac
430+ done
431+ if [ -n "$commit" ]; then
432+ print_commit "$subject" "$author" "$bugs"
433+ fi
434+}
435+cleanup() {
436+ [ ! -d "${TEMP_D}" ] || rm -Rf "${TEMP_D}"
437+}
438+
439+from_ref=${1:-"master"}
440+cur_branch=$(git rev-parse --abbrev-ref HEAD) ||
441+ fail "failed to get current branch"
442+
443+case "$cur_branch" in
444+ ubuntu/*) :;;
445+ *) fail "You are on branch '$cur_branch', expect to be on ubuntu/*";;
446+esac
447+
448+TEMP_D=$(mktemp -d) || fail "failed mktemp"
449+trap cleanup EXIT
450+
451+prev_pkg_ver=$(dpkg-parsechangelog --show-field Version) ||
452+ fail "failed reading package version"
453+pkg_name=$(dpkg-parsechangelog --show-field Source) ||
454+ fail "failed to read Source from changelog"
455+
456+merge_base=$(git merge-base "$from_ref" HEAD) ||
457+ fail "cannot find merge base for $from_ref and HEAD"
458+
459+new_pkg_debian="0ubuntu1"
460+new_upstream_ver=$(git describe --abbrev=8 "${from_ref}")
461+new_pkg_ver="${new_upstream_ver}-${new_pkg_debian}"
462+
463+prev_upstream_ver=${prev_pkg_ver%-*}
464+if [ "${prev_upstream_ver}" = "${new_upstream_ver}" ]; then
465+ echo "nothing to commit. '$from_ref' is at ${new_upstream_ver}."
466+ exit 0
467+fi
468+
469+dpseries="debian/patches/series"
470+if [ -e $dpseries ]; then
471+ drops=""
472+ while read bname extra; do
473+ case "$bname" in
474+ cpick-*)
475+ commit=${bname#cpick-}
476+ commit=${commit%%-*}
477+ echo "bname=$bname commit=${commit}" 1>&2
478+ if git merge-base --is-ancestor "$commit" "$from_ref"; then
479+ drops="${drops} debian/patches/$bname"
480+ fi
481+ ;;
482+ *) echo "$bname${extra:+ ${extra}}";;
483+ esac
484+ done < $dpseries > "${TEMP_D}/series"
485+ drops=${drops# }
486+ if [ -n "$drops" ]; then
487+ cp "${TEMP_D}/series" "$dpseries" ||
488+ fail "failed copying to $dpseries"
489+ if [ ! -s $dpseries ]; then
490+ git rm --force "$dpseries" ||
491+ fail "failed removing empty $dpseries: git rm $dpseries"
492+ fi
493+ msg="drop cherry picks before merge from ${from_ref} at $new_upstream_ver"
494+ msg="$msg${CR}${CR}drop the following cherry picks:"
495+ for file in $drops; do
496+ git rm "$file" || fail "failed to git rm $file"
497+ msg="${msg}$CR $file"
498+ done
499+ git commit -m "$msg" "$dpseries" $drops
500+ fi
501+fi
502+
503+git merge "${from_ref}" -m "merge from $from_ref at $new_upstream_ver" ||
504+ fail "failed: git merge ${from_ref} -m 'merge from $from_ref ..'"
505+clog="${TEMP_D}/changelog"
506+gitlog="${TEMP_D}/gitlog"
507+
508+git log --first-parent --no-decorate --format=full \
509+ "${merge_base}..${from_ref}" > "$gitlog" ||
510+ fail "failed git log ${merge_base}..${from_ref}"
511+
512+cat >> "$clog" <<EOF
513+$pkg_name ($new_pkg_ver) UNRELEASED; urgency=medium
514+
515+ * New upstream snapshot.
516+EOF
517+git_log_to_dch < "$gitlog" >> "$clog" ||
518+ fail "failed git_log_to_dch"
519+cat >> "$clog" <<EOF
520+
521+ -- ${DEBFULLNAME} <$DEBEMAIL> $(date -R)
522+
523+EOF
524+
525+cat "$clog" "debian/changelog" > "$TEMP_D/newlog" &&
526+ cp "$TEMP_D/newlog" "debian/changelog" ||
527+ fail "failed replacing debian/changelog"
528+
529+dch -e || fail "dch -e exited $?"
530+
531+git diff
532+
533+echo -n "Commit this change? (Y/n): "
534+read answer || fail "failed to read answer"
535+case "$answer" in
536+ n|[Nn][oO]) exit 1;;
537+esac
538+
539+msg="update changelog (new upstream snapshot $new_upstream_ver)."
540+git commit -m "$msg" debian/changelog ||
541+ fail "failed to commit '$msg'"
542diff --git a/tox.ini b/tox.ini
543index f238134..a7bacf8 100644
544--- a/tox.ini
545+++ b/tox.ini
546@@ -101,4 +101,4 @@ deps = pyflakes
547
548 [flake8]
549 builtins = _
550-exclude = .venv,.bzr,.tox,dist,doc,*lib/python*,*egg,build
551+exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build

Subscribers

People subscribed via source and target branches