Merge ~smoser/cloud-init:bug/fix-read-version-on-branch into cloud-init:master

Proposed by Scott Moser
Status: Merged
Merged at revision: a3376d45c83e90150d8de79a2b31282a7d760bd7
Proposed branch: ~smoser/cloud-init:bug/fix-read-version-on-branch
Merge into: cloud-init:master
Diff against target: 50 lines (+6/-5)
3 files modified
Makefile (+4/-3)
tools/make-tarball (+1/-1)
tools/read-version (+1/-1)
Reviewer Review Type Date Requested Status
Ryan Harper Approve
Paul Meyer Pending
Review via email: mp+315227@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

LGTM, fixes the 'make' command on branches.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index ed631cf..18ec568 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -27,7 +27,8 @@ ifeq ($(distro),)
6 distro = redhat
7 endif
8
9-READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version)
10+READ_VERSION=$(shell $(PYVER) $(CWD)/tools/read-version || \
11+ echo read-version-failed)
12 CODE_VERSION=$(shell $(PYVER) -c "from cloudinit import version; print(version.version_string())")
13
14
15@@ -62,8 +63,8 @@ test: $(unittests)
16
17 check_version:
18 @if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \
19- echo "Error: read-version version $(READ_VERSION)" \
20- "not equal to code version $(CODE_VERSION)"; exit 2; \
21+ echo "Error: read-version version '$(READ_VERSION)'" \
22+ "not equal to code version '$(CODE_VERSION)'"; exit 2; \
23 else true; fi
24
25 clean_pyc:
26diff --git a/tools/make-tarball b/tools/make-tarball
27index c150dd2..91c4562 100755
28--- a/tools/make-tarball
29+++ b/tools/make-tarball
30@@ -35,7 +35,7 @@ while [ $# -ne 0 ]; do
31 done
32
33 rev=${1:-HEAD}
34-version=$(git describe ${long_opt} $rev)
35+version=$(git describe "--match=[0-9]*" ${long_opt} $rev)
36
37 archive_base="cloud-init-$version"
38 if [ -z "$output" ]; then
39diff --git a/tools/read-version b/tools/read-version
40index 3b30b49..ddb2838 100755
41--- a/tools/read-version
42+++ b/tools/read-version
43@@ -56,7 +56,7 @@ if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
44 flags = []
45 if use_tags:
46 flags = ['--tags']
47- cmd = ['git', 'describe'] + flags
48+ cmd = ['git', 'describe', '--match=[0-9]*'] + flags
49
50 version = tiny_p(cmd).strip()
51

Subscribers

People subscribed via source and target branches