Merge lp:~nskaggs/juju-release-tools/add-epoch into lp:juju-release-tools
- add-epoch
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 339 |
Proposed branch: | lp:~nskaggs/juju-release-tools/add-epoch |
Merge into: | lp:juju-release-tools |
Diff against target: |
238 lines (+39/-20) 2 files modified
build_package.py (+16/-11) tests/test_build_package.py (+23/-9) |
To merge this branch: | bzr merge lp:~nskaggs/juju-release-tools/add-epoch |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | code | Approve | |
Review via email: mp+305383@code.launchpad.net |
Commit message
Description of the change
Fix for bug 1619396. Add epoch to version strings.
- 338. By Nicholas Skaggs
-
make epoch default to 1
Nicholas Skaggs (nskaggs) wrote : | # |
+ dch --newversion 1:2.0-beta18~
+ debcommit
bzr commit -m 'New upstream devel release. (LP #1)'
Committing to: /mnt/jenkins/
modified debian/changelog
Committed revision 140.
+ bzr bd -S -- -us -uc
Building using working tree
Building package in normal mode
Looking for a way to retrieve the upstream tarball
Using apt to look for the upstream tarball.
apt could not find the needed tarball.
Trying to use get-packaged-
dh get-packaged-
dh: Unknown sequence get-packaged-
debian/rules:23: recipe for target 'get-packaged-
make: *** [get-packaged-
Trying to run get-packaged-
Trying to use get-orig-source to retrieve needed tarball (deprecated).
dh get-orig-source
dh: Unknown sequence get-orig-source (choose from: binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep)
debian/rules:23: recipe for target 'get-orig-source' failed
make: *** [get-orig-source] Error 2
Trying to run get-orig-source rule failed
Using uscan to look for the upstream tarball.
uscan warn: In /tmp/tmpVtgMO5 no matching hrefs for version 2.0 in watch line
https:/
uscan could not find the needed tarball.
bzr: ERROR: Unable to find the needed upstream tarball for package juju-core, version 2.0.
Creating /mnt/jenkins/
Copying juju-core_
Creating /mnt/jenkins/
Traceback (most recent call last):
File "/var/lib/
sys.
File "/var/lib/
revid=
File "/var/lib/
date=date, build=build, revid=revid, epoch=epoch)
File "/var/lib/
subprocess.
File "/usr/lib/
raise CalledProcessEr
Curtis Hovey (sinzui) wrote : | # |
Why are you looking at the juju 1.x project (juju-core). Juju 2.x is published in the juju project.
https:/
Nicholas Skaggs (nskaggs) wrote : | # |
I ran a new one with http://
Since we call the package juju-core, bzr-bd looks at the juju-core project for an upstream tarball.
Curiously the actual run does this fine:
bzr bd -S -- -us -uc
Building using working tree
Building package in normal mode
Looking for a way to retrieve the upstream tarball
Using pristine-tar to reconstruct juju-core_
Preview Diff
1 | === modified file 'build_package.py' |
2 | --- build_package.py 2016-07-15 21:49:02 +0000 |
3 | +++ build_package.py 2016-09-09 21:33:08 +0000 |
4 | @@ -115,8 +115,8 @@ |
5 | DEBSIGN_TEMPLATE = 'debsign -p {gpgcmd} *.changes' |
6 | |
7 | |
8 | -UBUNTU_VERSION_TEMPLATE = '{version}-0ubuntu1~{release}.{upatch}~juju1' |
9 | -DAILY_VERSION_TEMPLATE = '{version}-{date}+{build}+{revid}~{release}' |
10 | +UBUNTU_VERSION_TEMPLATE = '{epoch}:{version}~0ubuntu1~{release}.{upatch}~juju1' |
11 | +DAILY_VERSION_TEMPLATE = '{epoch}:{version}~{date}+{build}+{revid}~{release}' |
12 | |
13 | |
14 | VERSION_PATTERN = re.compile('(\d+)\.(\d+)\.(\d+)') |
15 | @@ -320,7 +320,7 @@ |
16 | |
17 | |
18 | def make_ubuntu_version(series, version, upatch=1, |
19 | - date=None, build=None, revid=None): |
20 | + date=None, build=None, revid=None, epoch=1): |
21 | """Return an Ubuntu package version. |
22 | |
23 | :param series: The series codename. |
24 | @@ -330,17 +330,18 @@ |
25 | :param date: The date of the build. |
26 | :param build: The build number in CI. |
27 | :param revid: The revid hash of the source. |
28 | + :param epoch: The epoch to pass in version name |
29 | :return: An Ubuntu version string. |
30 | """ |
31 | release = juju_series.get_version(series) |
32 | # if daily params are set, we make daily build |
33 | if all([date, build, revid]): |
34 | return DAILY_VERSION_TEMPLATE.format( |
35 | - version=version, release=release, upatch=upatch, |
36 | + epoch=epoch, version=version, release=release, upatch=upatch, |
37 | date=date, build=build, revid=revid) |
38 | else: |
39 | return UBUNTU_VERSION_TEMPLATE.format( |
40 | - version=version, release=release, upatch=upatch) |
41 | + epoch=epoch, version=version, release=release, upatch=upatch) |
42 | |
43 | |
44 | def make_changelog_message(version, bugs=None): |
45 | @@ -396,7 +397,7 @@ |
46 | def create_source_package(source_dir, spb, series, version, |
47 | upatch='1', bugs=None, gpgcmd=None, debemail=None, |
48 | debfullname=None, verbose=False, |
49 | - date=None, build=None, revid=None): |
50 | + date=None, build=None, revid=None, epoch=1): |
51 | """Create a series source package from a source package branch. |
52 | |
53 | The new source package can be used to create series source packages. |
54 | @@ -417,10 +418,11 @@ |
55 | :param date: The date of the build. |
56 | :param build: The build number in CI. |
57 | :param revid: The revid hash of the source. |
58 | + :param epoch: The epoch to pass in version name |
59 | """ |
60 | |
61 | ubuntu_version = make_ubuntu_version(series, version, upatch, |
62 | - date, build, revid) |
63 | + date, build, revid, epoch) |
64 | message = make_changelog_message(version, bugs=bugs) |
65 | source = os.path.join(source_dir, 'source') |
66 | env = make_deb_shell_env(debemail, debfullname) |
67 | @@ -435,7 +437,7 @@ |
68 | def build_source(tarfile_path, location, series, bugs, |
69 | debemail=None, debfullname=None, gpgcmd=None, |
70 | branch=None, upatch=1, verbose=False, |
71 | - date=None, build=None, revid=None): |
72 | + date=None, build=None, revid=None, epoch=1): |
73 | """Build one or more series source packages from a new release tarfile. |
74 | |
75 | The packages are unsigned by default, but providing the path to a gpgcmd, |
76 | @@ -457,6 +459,7 @@ |
77 | :param date: The date of the build. |
78 | :param build: The build number in CI. |
79 | :param revid: The revid hash of the source. |
80 | + :param epoch: The epoch to pass in version name |
81 | :return: the exit code (which is 0 or else an exception was raised). |
82 | """ |
83 | if not isinstance(series, list): |
84 | @@ -483,7 +486,7 @@ |
85 | build_dir, spb, a_series, version, |
86 | upatch=upatch, bugs=bugs, gpgcmd=gpgcmd, |
87 | debemail=debemail, debfullname=debfullname, verbose=verbose, |
88 | - date=date, build=build, revid=revid) |
89 | + date=date, build=build, revid=revid, epoch=epoch) |
90 | return 0 |
91 | |
92 | |
93 | @@ -506,8 +509,8 @@ |
94 | args.tar_file, args.location, args.series, args.bugs, |
95 | debemail=args.debemail, debfullname=args.debfullname, |
96 | gpgcmd=args.gpgcmd, branch=args.branch, upatch=args.upatch, |
97 | - verbose=args.verbose, |
98 | - date=args.date, build=args.build, revid=args.revid) |
99 | + verbose=args.verbose, date=args.date, build=args.build, |
100 | + revid=args.revid, epoch=args.epoch) |
101 | elif args.command == 'binary': |
102 | exitcode = build_binary( |
103 | args.dsc, args.location, args.series, args.arch, |
104 | @@ -533,6 +536,8 @@ |
105 | '--debfullname', default=os.environ.get("DEBFULLNAME"), |
106 | help="Your full name; Environment: DEBFULLNAME.") |
107 | src_parser.add_argument( |
108 | + '--epoch', default='1', help="The epoch for package version") |
109 | + src_parser.add_argument( |
110 | '--gpgcmd', default=None, |
111 | help="Path to a gpg signing command to make signed packages.") |
112 | src_parser.add_argument( |
113 | |
114 | === modified file 'tests/test_build_package.py' |
115 | --- tests/test_build_package.py 2016-07-21 14:01:00 +0000 |
116 | +++ tests/test_build_package.py 2016-09-09 21:33:08 +0000 |
117 | @@ -334,9 +334,9 @@ |
118 | |
119 | def test_make_ubuntu_version(self): |
120 | ubuntu_version = make_ubuntu_version('trusty', '1.2.3') |
121 | - self.assertEqual('1.2.3-0ubuntu1~14.04.1~juju1', ubuntu_version) |
122 | - ubuntu_version = make_ubuntu_version('precise', '1.22-alpha1', '8') |
123 | - self.assertEqual('1.22-alpha1-0ubuntu1~12.04.8~juju1', ubuntu_version) |
124 | + self.assertEqual('1:1.2.3~0ubuntu1~14.04.1~juju1', ubuntu_version) |
125 | + ubuntu_version = make_ubuntu_version('precise', '1.22~alpha1', '8') |
126 | + self.assertEqual('1:1.22~alpha1~0ubuntu1~12.04.8~juju1', ubuntu_version) |
127 | |
128 | def test_make_changelog_message(self): |
129 | message = make_changelog_message('1.2.0') |
130 | @@ -397,6 +397,7 @@ |
131 | scenarios = [ |
132 | ('release', |
133 | {'date': None, |
134 | + 'epoch': '2', |
135 | 'build': None, |
136 | 'revid': None, |
137 | 'version': '1.2.3', |
138 | @@ -407,6 +408,7 @@ |
139 | |
140 | ('daily', |
141 | {'date': '20160502', |
142 | + 'epoch': None, |
143 | 'build': '3065', |
144 | 'revid': '4bbce805', |
145 | 'version': '1.2.3~20160502~3065~4bbce805', |
146 | @@ -416,6 +418,7 @@ |
147 | }), |
148 | ('broken_daily', |
149 | {'date': None, |
150 | + 'epoch': None, |
151 | 'build': '3065', |
152 | 'revid': '4bbce805', |
153 | 'version': '1.2.3', |
154 | @@ -458,22 +461,25 @@ |
155 | scenarios = [ |
156 | ('release', |
157 | {'date': None, |
158 | + 'epoch': '1', |
159 | 'build': None, |
160 | 'revid': None, |
161 | - 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1' |
162 | + 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1' |
163 | }), |
164 | |
165 | ('daily', |
166 | {'date': '20160502', |
167 | + 'epoch': '2', |
168 | 'build': '3065', |
169 | 'revid': '4bbce805', |
170 | - 'ubuntu_version': '1.2.3-20160502+3065+4bbce805~14.04' |
171 | + 'ubuntu_version': '2:1.2.3~20160502+3065+4bbce805~14.04' |
172 | }), |
173 | ('broken_daily', |
174 | {'date': None, |
175 | + 'epoch': '1', |
176 | 'build': '3065', |
177 | 'revid': '4bbce805', |
178 | - 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1' |
179 | + 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1' |
180 | }) |
181 | ] |
182 | |
183 | @@ -484,7 +490,8 @@ |
184 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', |
185 | '1.2.3', upatch='1', bugs=['987'], gpgcmd=None, |
186 | debemail='me@email', debfullname='me', verbose=False, |
187 | - date=self.date, build=self.build, revid=self.revid) |
188 | + date=self.date, build=self.build, revid=self.revid, |
189 | + epoch=self.epoch) |
190 | script = BUILD_SOURCE_TEMPLATE.format( |
191 | spb='/juju-build-any-all/spb', |
192 | source='/juju-build-trusty-all/source', |
193 | @@ -503,7 +510,8 @@ |
194 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', |
195 | '1.2.3', upatch='1', bugs=['987'], gpgcmd='/my/gpgcmd', |
196 | debemail='me@email', debfullname='me', verbose=False, |
197 | - date=self.date, build=self.build, revid=self.revid) |
198 | + date=self.date, build=self.build, revid=self.revid, |
199 | + epoch=self.epoch) |
200 | script = BUILD_SOURCE_TEMPLATE.format( |
201 | spb='/juju-build-any-all/spb', |
202 | source='/juju-build-trusty-all/source', |
203 | @@ -522,17 +530,20 @@ |
204 | scenarios = [ |
205 | ('release', |
206 | {'date': None, |
207 | + 'epoch': None, |
208 | 'build': None, |
209 | 'revid': None |
210 | }), |
211 | |
212 | ('daily', |
213 | {'date': '20160502', |
214 | + 'epoch': '1', |
215 | 'build': '3065', |
216 | 'revid': '4bbce805' |
217 | }), |
218 | ('broken_daily', |
219 | {'date': None, |
220 | + 'epoch': None, |
221 | 'build': '3065', |
222 | 'revid': '4bbce805' |
223 | }) |
224 | @@ -643,10 +654,13 @@ |
225 | if self.revid: |
226 | args_list.append('--revid') |
227 | args_list.append(self.revid) |
228 | + args_list.append('--epoch') |
229 | + args_list.append(self.epoch) |
230 | code = main(args_list) |
231 | self.assertEqual(0, code) |
232 | bs_mock.assert_called_with( |
233 | 'my.tar.gz', '~/workspace', 'trusty', ['123', '456'], |
234 | debemail='me@email', debfullname='me', gpgcmd=None, |
235 | branch=DEFAULT_SPB, upatch='1', verbose=False, |
236 | - date=self.date, build=self.build, revid=self.revid) |
237 | + date=self.date, build=self.build, revid=self.revid, |
238 | + epoch=self.epoch) |
Thank you.