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 | 115 | DEBSIGN_TEMPLATE = 'debsign -p {gpgcmd} *.changes' | 115 | DEBSIGN_TEMPLATE = 'debsign -p {gpgcmd} *.changes' |
6 | 116 | 116 | ||
7 | 117 | 117 | ||
10 | 118 | UBUNTU_VERSION_TEMPLATE = '{version}-0ubuntu1~{release}.{upatch}~juju1' | 118 | UBUNTU_VERSION_TEMPLATE = '{epoch}:{version}~0ubuntu1~{release}.{upatch}~juju1' |
11 | 119 | DAILY_VERSION_TEMPLATE = '{version}-{date}+{build}+{revid}~{release}' | 119 | DAILY_VERSION_TEMPLATE = '{epoch}:{version}~{date}+{build}+{revid}~{release}' |
12 | 120 | 120 | ||
13 | 121 | 121 | ||
14 | 122 | VERSION_PATTERN = re.compile('(\d+)\.(\d+)\.(\d+)') | 122 | VERSION_PATTERN = re.compile('(\d+)\.(\d+)\.(\d+)') |
15 | @@ -320,7 +320,7 @@ | |||
16 | 320 | 320 | ||
17 | 321 | 321 | ||
18 | 322 | def make_ubuntu_version(series, version, upatch=1, | 322 | def make_ubuntu_version(series, version, upatch=1, |
20 | 323 | date=None, build=None, revid=None): | 323 | date=None, build=None, revid=None, epoch=1): |
21 | 324 | """Return an Ubuntu package version. | 324 | """Return an Ubuntu package version. |
22 | 325 | 325 | ||
23 | 326 | :param series: The series codename. | 326 | :param series: The series codename. |
24 | @@ -330,17 +330,18 @@ | |||
25 | 330 | :param date: The date of the build. | 330 | :param date: The date of the build. |
26 | 331 | :param build: The build number in CI. | 331 | :param build: The build number in CI. |
27 | 332 | :param revid: The revid hash of the source. | 332 | :param revid: The revid hash of the source. |
28 | 333 | :param epoch: The epoch to pass in version name | ||
29 | 333 | :return: An Ubuntu version string. | 334 | :return: An Ubuntu version string. |
30 | 334 | """ | 335 | """ |
31 | 335 | release = juju_series.get_version(series) | 336 | release = juju_series.get_version(series) |
32 | 336 | # if daily params are set, we make daily build | 337 | # if daily params are set, we make daily build |
33 | 337 | if all([date, build, revid]): | 338 | if all([date, build, revid]): |
34 | 338 | return DAILY_VERSION_TEMPLATE.format( | 339 | return DAILY_VERSION_TEMPLATE.format( |
36 | 339 | version=version, release=release, upatch=upatch, | 340 | epoch=epoch, version=version, release=release, upatch=upatch, |
37 | 340 | date=date, build=build, revid=revid) | 341 | date=date, build=build, revid=revid) |
38 | 341 | else: | 342 | else: |
39 | 342 | return UBUNTU_VERSION_TEMPLATE.format( | 343 | return UBUNTU_VERSION_TEMPLATE.format( |
41 | 343 | version=version, release=release, upatch=upatch) | 344 | epoch=epoch, version=version, release=release, upatch=upatch) |
42 | 344 | 345 | ||
43 | 345 | 346 | ||
44 | 346 | def make_changelog_message(version, bugs=None): | 347 | def make_changelog_message(version, bugs=None): |
45 | @@ -396,7 +397,7 @@ | |||
46 | 396 | def create_source_package(source_dir, spb, series, version, | 397 | def create_source_package(source_dir, spb, series, version, |
47 | 397 | upatch='1', bugs=None, gpgcmd=None, debemail=None, | 398 | upatch='1', bugs=None, gpgcmd=None, debemail=None, |
48 | 398 | debfullname=None, verbose=False, | 399 | debfullname=None, verbose=False, |
50 | 399 | date=None, build=None, revid=None): | 400 | date=None, build=None, revid=None, epoch=1): |
51 | 400 | """Create a series source package from a source package branch. | 401 | """Create a series source package from a source package branch. |
52 | 401 | 402 | ||
53 | 402 | The new source package can be used to create series source packages. | 403 | The new source package can be used to create series source packages. |
54 | @@ -417,10 +418,11 @@ | |||
55 | 417 | :param date: The date of the build. | 418 | :param date: The date of the build. |
56 | 418 | :param build: The build number in CI. | 419 | :param build: The build number in CI. |
57 | 419 | :param revid: The revid hash of the source. | 420 | :param revid: The revid hash of the source. |
58 | 421 | :param epoch: The epoch to pass in version name | ||
59 | 420 | """ | 422 | """ |
60 | 421 | 423 | ||
61 | 422 | ubuntu_version = make_ubuntu_version(series, version, upatch, | 424 | ubuntu_version = make_ubuntu_version(series, version, upatch, |
63 | 423 | date, build, revid) | 425 | date, build, revid, epoch) |
64 | 424 | message = make_changelog_message(version, bugs=bugs) | 426 | message = make_changelog_message(version, bugs=bugs) |
65 | 425 | source = os.path.join(source_dir, 'source') | 427 | source = os.path.join(source_dir, 'source') |
66 | 426 | env = make_deb_shell_env(debemail, debfullname) | 428 | env = make_deb_shell_env(debemail, debfullname) |
67 | @@ -435,7 +437,7 @@ | |||
68 | 435 | def build_source(tarfile_path, location, series, bugs, | 437 | def build_source(tarfile_path, location, series, bugs, |
69 | 436 | debemail=None, debfullname=None, gpgcmd=None, | 438 | debemail=None, debfullname=None, gpgcmd=None, |
70 | 437 | branch=None, upatch=1, verbose=False, | 439 | branch=None, upatch=1, verbose=False, |
72 | 438 | date=None, build=None, revid=None): | 440 | date=None, build=None, revid=None, epoch=1): |
73 | 439 | """Build one or more series source packages from a new release tarfile. | 441 | """Build one or more series source packages from a new release tarfile. |
74 | 440 | 442 | ||
75 | 441 | The packages are unsigned by default, but providing the path to a gpgcmd, | 443 | The packages are unsigned by default, but providing the path to a gpgcmd, |
76 | @@ -457,6 +459,7 @@ | |||
77 | 457 | :param date: The date of the build. | 459 | :param date: The date of the build. |
78 | 458 | :param build: The build number in CI. | 460 | :param build: The build number in CI. |
79 | 459 | :param revid: The revid hash of the source. | 461 | :param revid: The revid hash of the source. |
80 | 462 | :param epoch: The epoch to pass in version name | ||
81 | 460 | :return: the exit code (which is 0 or else an exception was raised). | 463 | :return: the exit code (which is 0 or else an exception was raised). |
82 | 461 | """ | 464 | """ |
83 | 462 | if not isinstance(series, list): | 465 | if not isinstance(series, list): |
84 | @@ -483,7 +486,7 @@ | |||
85 | 483 | build_dir, spb, a_series, version, | 486 | build_dir, spb, a_series, version, |
86 | 484 | upatch=upatch, bugs=bugs, gpgcmd=gpgcmd, | 487 | upatch=upatch, bugs=bugs, gpgcmd=gpgcmd, |
87 | 485 | debemail=debemail, debfullname=debfullname, verbose=verbose, | 488 | debemail=debemail, debfullname=debfullname, verbose=verbose, |
89 | 486 | date=date, build=build, revid=revid) | 489 | date=date, build=build, revid=revid, epoch=epoch) |
90 | 487 | return 0 | 490 | return 0 |
91 | 488 | 491 | ||
92 | 489 | 492 | ||
93 | @@ -506,8 +509,8 @@ | |||
94 | 506 | args.tar_file, args.location, args.series, args.bugs, | 509 | args.tar_file, args.location, args.series, args.bugs, |
95 | 507 | debemail=args.debemail, debfullname=args.debfullname, | 510 | debemail=args.debemail, debfullname=args.debfullname, |
96 | 508 | gpgcmd=args.gpgcmd, branch=args.branch, upatch=args.upatch, | 511 | gpgcmd=args.gpgcmd, branch=args.branch, upatch=args.upatch, |
99 | 509 | verbose=args.verbose, | 512 | verbose=args.verbose, date=args.date, build=args.build, |
100 | 510 | date=args.date, build=args.build, revid=args.revid) | 513 | revid=args.revid, epoch=args.epoch) |
101 | 511 | elif args.command == 'binary': | 514 | elif args.command == 'binary': |
102 | 512 | exitcode = build_binary( | 515 | exitcode = build_binary( |
103 | 513 | args.dsc, args.location, args.series, args.arch, | 516 | args.dsc, args.location, args.series, args.arch, |
104 | @@ -533,6 +536,8 @@ | |||
105 | 533 | '--debfullname', default=os.environ.get("DEBFULLNAME"), | 536 | '--debfullname', default=os.environ.get("DEBFULLNAME"), |
106 | 534 | help="Your full name; Environment: DEBFULLNAME.") | 537 | help="Your full name; Environment: DEBFULLNAME.") |
107 | 535 | src_parser.add_argument( | 538 | src_parser.add_argument( |
108 | 539 | '--epoch', default='1', help="The epoch for package version") | ||
109 | 540 | src_parser.add_argument( | ||
110 | 536 | '--gpgcmd', default=None, | 541 | '--gpgcmd', default=None, |
111 | 537 | help="Path to a gpg signing command to make signed packages.") | 542 | help="Path to a gpg signing command to make signed packages.") |
112 | 538 | src_parser.add_argument( | 543 | src_parser.add_argument( |
113 | 539 | 544 | ||
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 | 334 | 334 | ||
119 | 335 | def test_make_ubuntu_version(self): | 335 | def test_make_ubuntu_version(self): |
120 | 336 | ubuntu_version = make_ubuntu_version('trusty', '1.2.3') | 336 | ubuntu_version = make_ubuntu_version('trusty', '1.2.3') |
124 | 337 | self.assertEqual('1.2.3-0ubuntu1~14.04.1~juju1', ubuntu_version) | 337 | self.assertEqual('1:1.2.3~0ubuntu1~14.04.1~juju1', ubuntu_version) |
125 | 338 | ubuntu_version = make_ubuntu_version('precise', '1.22-alpha1', '8') | 338 | ubuntu_version = make_ubuntu_version('precise', '1.22~alpha1', '8') |
126 | 339 | self.assertEqual('1.22-alpha1-0ubuntu1~12.04.8~juju1', ubuntu_version) | 339 | self.assertEqual('1:1.22~alpha1~0ubuntu1~12.04.8~juju1', ubuntu_version) |
127 | 340 | 340 | ||
128 | 341 | def test_make_changelog_message(self): | 341 | def test_make_changelog_message(self): |
129 | 342 | message = make_changelog_message('1.2.0') | 342 | message = make_changelog_message('1.2.0') |
130 | @@ -397,6 +397,7 @@ | |||
131 | 397 | scenarios = [ | 397 | scenarios = [ |
132 | 398 | ('release', | 398 | ('release', |
133 | 399 | {'date': None, | 399 | {'date': None, |
134 | 400 | 'epoch': '2', | ||
135 | 400 | 'build': None, | 401 | 'build': None, |
136 | 401 | 'revid': None, | 402 | 'revid': None, |
137 | 402 | 'version': '1.2.3', | 403 | 'version': '1.2.3', |
138 | @@ -407,6 +408,7 @@ | |||
139 | 407 | 408 | ||
140 | 408 | ('daily', | 409 | ('daily', |
141 | 409 | {'date': '20160502', | 410 | {'date': '20160502', |
142 | 411 | 'epoch': None, | ||
143 | 410 | 'build': '3065', | 412 | 'build': '3065', |
144 | 411 | 'revid': '4bbce805', | 413 | 'revid': '4bbce805', |
145 | 412 | 'version': '1.2.3~20160502~3065~4bbce805', | 414 | 'version': '1.2.3~20160502~3065~4bbce805', |
146 | @@ -416,6 +418,7 @@ | |||
147 | 416 | }), | 418 | }), |
148 | 417 | ('broken_daily', | 419 | ('broken_daily', |
149 | 418 | {'date': None, | 420 | {'date': None, |
150 | 421 | 'epoch': None, | ||
151 | 419 | 'build': '3065', | 422 | 'build': '3065', |
152 | 420 | 'revid': '4bbce805', | 423 | 'revid': '4bbce805', |
153 | 421 | 'version': '1.2.3', | 424 | 'version': '1.2.3', |
154 | @@ -458,22 +461,25 @@ | |||
155 | 458 | scenarios = [ | 461 | scenarios = [ |
156 | 459 | ('release', | 462 | ('release', |
157 | 460 | {'date': None, | 463 | {'date': None, |
158 | 464 | 'epoch': '1', | ||
159 | 461 | 'build': None, | 465 | 'build': None, |
160 | 462 | 'revid': None, | 466 | 'revid': None, |
162 | 463 | 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1' | 467 | 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1' |
163 | 464 | }), | 468 | }), |
164 | 465 | 469 | ||
165 | 466 | ('daily', | 470 | ('daily', |
166 | 467 | {'date': '20160502', | 471 | {'date': '20160502', |
167 | 472 | 'epoch': '2', | ||
168 | 468 | 'build': '3065', | 473 | 'build': '3065', |
169 | 469 | 'revid': '4bbce805', | 474 | 'revid': '4bbce805', |
171 | 470 | 'ubuntu_version': '1.2.3-20160502+3065+4bbce805~14.04' | 475 | 'ubuntu_version': '2:1.2.3~20160502+3065+4bbce805~14.04' |
172 | 471 | }), | 476 | }), |
173 | 472 | ('broken_daily', | 477 | ('broken_daily', |
174 | 473 | {'date': None, | 478 | {'date': None, |
175 | 479 | 'epoch': '1', | ||
176 | 474 | 'build': '3065', | 480 | 'build': '3065', |
177 | 475 | 'revid': '4bbce805', | 481 | 'revid': '4bbce805', |
179 | 476 | 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1' | 482 | 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1' |
180 | 477 | }) | 483 | }) |
181 | 478 | ] | 484 | ] |
182 | 479 | 485 | ||
183 | @@ -484,7 +490,8 @@ | |||
184 | 484 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', | 490 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', |
185 | 485 | '1.2.3', upatch='1', bugs=['987'], gpgcmd=None, | 491 | '1.2.3', upatch='1', bugs=['987'], gpgcmd=None, |
186 | 486 | debemail='me@email', debfullname='me', verbose=False, | 492 | debemail='me@email', debfullname='me', verbose=False, |
188 | 487 | date=self.date, build=self.build, revid=self.revid) | 493 | date=self.date, build=self.build, revid=self.revid, |
189 | 494 | epoch=self.epoch) | ||
190 | 488 | script = BUILD_SOURCE_TEMPLATE.format( | 495 | script = BUILD_SOURCE_TEMPLATE.format( |
191 | 489 | spb='/juju-build-any-all/spb', | 496 | spb='/juju-build-any-all/spb', |
192 | 490 | source='/juju-build-trusty-all/source', | 497 | source='/juju-build-trusty-all/source', |
193 | @@ -503,7 +510,8 @@ | |||
194 | 503 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', | 510 | '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty', |
195 | 504 | '1.2.3', upatch='1', bugs=['987'], gpgcmd='/my/gpgcmd', | 511 | '1.2.3', upatch='1', bugs=['987'], gpgcmd='/my/gpgcmd', |
196 | 505 | debemail='me@email', debfullname='me', verbose=False, | 512 | debemail='me@email', debfullname='me', verbose=False, |
198 | 506 | date=self.date, build=self.build, revid=self.revid) | 513 | date=self.date, build=self.build, revid=self.revid, |
199 | 514 | epoch=self.epoch) | ||
200 | 507 | script = BUILD_SOURCE_TEMPLATE.format( | 515 | script = BUILD_SOURCE_TEMPLATE.format( |
201 | 508 | spb='/juju-build-any-all/spb', | 516 | spb='/juju-build-any-all/spb', |
202 | 509 | source='/juju-build-trusty-all/source', | 517 | source='/juju-build-trusty-all/source', |
203 | @@ -522,17 +530,20 @@ | |||
204 | 522 | scenarios = [ | 530 | scenarios = [ |
205 | 523 | ('release', | 531 | ('release', |
206 | 524 | {'date': None, | 532 | {'date': None, |
207 | 533 | 'epoch': None, | ||
208 | 525 | 'build': None, | 534 | 'build': None, |
209 | 526 | 'revid': None | 535 | 'revid': None |
210 | 527 | }), | 536 | }), |
211 | 528 | 537 | ||
212 | 529 | ('daily', | 538 | ('daily', |
213 | 530 | {'date': '20160502', | 539 | {'date': '20160502', |
214 | 540 | 'epoch': '1', | ||
215 | 531 | 'build': '3065', | 541 | 'build': '3065', |
216 | 532 | 'revid': '4bbce805' | 542 | 'revid': '4bbce805' |
217 | 533 | }), | 543 | }), |
218 | 534 | ('broken_daily', | 544 | ('broken_daily', |
219 | 535 | {'date': None, | 545 | {'date': None, |
220 | 546 | 'epoch': None, | ||
221 | 536 | 'build': '3065', | 547 | 'build': '3065', |
222 | 537 | 'revid': '4bbce805' | 548 | 'revid': '4bbce805' |
223 | 538 | }) | 549 | }) |
224 | @@ -643,10 +654,13 @@ | |||
225 | 643 | if self.revid: | 654 | if self.revid: |
226 | 644 | args_list.append('--revid') | 655 | args_list.append('--revid') |
227 | 645 | args_list.append(self.revid) | 656 | args_list.append(self.revid) |
228 | 657 | args_list.append('--epoch') | ||
229 | 658 | args_list.append(self.epoch) | ||
230 | 646 | code = main(args_list) | 659 | code = main(args_list) |
231 | 647 | self.assertEqual(0, code) | 660 | self.assertEqual(0, code) |
232 | 648 | bs_mock.assert_called_with( | 661 | bs_mock.assert_called_with( |
233 | 649 | 'my.tar.gz', '~/workspace', 'trusty', ['123', '456'], | 662 | 'my.tar.gz', '~/workspace', 'trusty', ['123', '456'], |
234 | 650 | debemail='me@email', debfullname='me', gpgcmd=None, | 663 | debemail='me@email', debfullname='me', gpgcmd=None, |
235 | 651 | branch=DEFAULT_SPB, upatch='1', verbose=False, | 664 | branch=DEFAULT_SPB, upatch='1', verbose=False, |
237 | 652 | date=self.date, build=self.build, revid=self.revid) | 665 | date=self.date, build=self.build, revid=self.revid, |
238 | 666 | epoch=self.epoch) |
Thank you.