Merge lp:~nskaggs/juju-release-tools/add-epoch into lp:juju-release-tools

Proposed by Nicholas Skaggs
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
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+305383@code.launchpad.net

Description of the change

Fix for bug 1619396. Add epoch to version strings.

To post a comment you must log in.
338. By Nicholas Skaggs

make epoch default to 1

Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

+ dch --newversion 1:2.0-beta18~0ubuntu1~12.04.1~juju1 -D precise --force-distribution New upstream devel release. (LP #1)
+ debcommit
bzr commit -m 'New upstream devel release. (LP #1)'
Committing to: /mnt/jenkins/workspace/balloons-release-juju-create-source-packages/juju-build-precise-all/source/
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-orig-source to retrieve needed tarball.
dh get-packaged-orig-source
dh: Unknown sequence get-packaged-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-packaged-orig-source' failed
make: *** [get-packaged-orig-source] Error 2
Trying to run get-packaged-orig-source rule failed
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://launchpad.net/juju-core/+download https://launchpad.net/juju-core/.*/.*/.*/juju-core_(.*)\.tar\.gz
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/workspace/balloons-release-juju-create-source-packages/juju-build-any-all
Copying juju-core_2.0-beta18.tar.gz to /mnt/jenkins/workspace/balloons-release-juju-create-source-packages/juju-build-any-all
Creating /mnt/jenkins/workspace/balloons-release-juju-create-source-packages/juju-build-precise-all
Traceback (most recent call last):
  File "/var/lib/jenkins/juju-release-tools/build_package_test.py", line 584, in <module>
    sys.exit(main(sys.argv))
  File "/var/lib/jenkins/juju-release-tools/build_package_test.py", line 513, in main
    revid=args.revid, epoch=args.epoch)
  File "/var/lib/jenkins/juju-release-tools/build_package_test.py", line 489, in build_source
    date=date, build=build, revid=revid, epoch=epoch)
  File "/var/lib/jenkins/juju-release-tools/build_package_test.py", line 432, in create_source_package
    subprocess.check_call([script], shell=True, cwd=source_dir, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)

Revision history for this message
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://launchpad.net/juju/2.0/2.0-beta18

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

I ran a new one with http://juju-ci.vapour.ws:8080/view/Experiments/job/balloons-release-juju-create-source-packages/6/console. I believe this issue is encountered because we haven't released anything new since the juju-core -> juju switch into the archive.

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_2.0-rc1.orig.tar.gz.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'build_package.py'
--- build_package.py 2016-07-15 21:49:02 +0000
+++ build_package.py 2016-09-09 21:33:08 +0000
@@ -115,8 +115,8 @@
115DEBSIGN_TEMPLATE = 'debsign -p {gpgcmd} *.changes'115DEBSIGN_TEMPLATE = 'debsign -p {gpgcmd} *.changes'
116116
117117
118UBUNTU_VERSION_TEMPLATE = '{version}-0ubuntu1~{release}.{upatch}~juju1'118UBUNTU_VERSION_TEMPLATE = '{epoch}:{version}~0ubuntu1~{release}.{upatch}~juju1'
119DAILY_VERSION_TEMPLATE = '{version}-{date}+{build}+{revid}~{release}'119DAILY_VERSION_TEMPLATE = '{epoch}:{version}~{date}+{build}+{revid}~{release}'
120120
121121
122VERSION_PATTERN = re.compile('(\d+)\.(\d+)\.(\d+)')122VERSION_PATTERN = re.compile('(\d+)\.(\d+)\.(\d+)')
@@ -320,7 +320,7 @@
320320
321321
322def make_ubuntu_version(series, version, upatch=1,322def make_ubuntu_version(series, version, upatch=1,
323 date=None, build=None, revid=None):323 date=None, build=None, revid=None, epoch=1):
324 """Return an Ubuntu package version.324 """Return an Ubuntu package version.
325325
326 :param series: The series codename.326 :param series: The series codename.
@@ -330,17 +330,18 @@
330 :param date: The date of the build.330 :param date: The date of the build.
331 :param build: The build number in CI.331 :param build: The build number in CI.
332 :param revid: The revid hash of the source.332 :param revid: The revid hash of the source.
333 :param epoch: The epoch to pass in version name
333 :return: An Ubuntu version string.334 :return: An Ubuntu version string.
334 """335 """
335 release = juju_series.get_version(series)336 release = juju_series.get_version(series)
336 # if daily params are set, we make daily build337 # if daily params are set, we make daily build
337 if all([date, build, revid]):338 if all([date, build, revid]):
338 return DAILY_VERSION_TEMPLATE.format(339 return DAILY_VERSION_TEMPLATE.format(
339 version=version, release=release, upatch=upatch,340 epoch=epoch, version=version, release=release, upatch=upatch,
340 date=date, build=build, revid=revid)341 date=date, build=build, revid=revid)
341 else:342 else:
342 return UBUNTU_VERSION_TEMPLATE.format(343 return UBUNTU_VERSION_TEMPLATE.format(
343 version=version, release=release, upatch=upatch)344 epoch=epoch, version=version, release=release, upatch=upatch)
344345
345346
346def make_changelog_message(version, bugs=None):347def make_changelog_message(version, bugs=None):
@@ -396,7 +397,7 @@
396def create_source_package(source_dir, spb, series, version,397def create_source_package(source_dir, spb, series, version,
397 upatch='1', bugs=None, gpgcmd=None, debemail=None,398 upatch='1', bugs=None, gpgcmd=None, debemail=None,
398 debfullname=None, verbose=False,399 debfullname=None, verbose=False,
399 date=None, build=None, revid=None):400 date=None, build=None, revid=None, epoch=1):
400 """Create a series source package from a source package branch.401 """Create a series source package from a source package branch.
401402
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.
@@ -417,10 +418,11 @@
417 :param date: The date of the build.418 :param date: The date of the build.
418 :param build: The build number in CI.419 :param build: The build number in CI.
419 :param revid: The revid hash of the source.420 :param revid: The revid hash of the source.
421 :param epoch: The epoch to pass in version name
420 """422 """
421423
422 ubuntu_version = make_ubuntu_version(series, version, upatch,424 ubuntu_version = make_ubuntu_version(series, version, upatch,
423 date, build, revid)425 date, build, revid, epoch)
424 message = make_changelog_message(version, bugs=bugs)426 message = make_changelog_message(version, bugs=bugs)
425 source = os.path.join(source_dir, 'source')427 source = os.path.join(source_dir, 'source')
426 env = make_deb_shell_env(debemail, debfullname)428 env = make_deb_shell_env(debemail, debfullname)
@@ -435,7 +437,7 @@
435def build_source(tarfile_path, location, series, bugs,437def build_source(tarfile_path, location, series, bugs,
436 debemail=None, debfullname=None, gpgcmd=None,438 debemail=None, debfullname=None, gpgcmd=None,
437 branch=None, upatch=1, verbose=False,439 branch=None, upatch=1, verbose=False,
438 date=None, build=None, revid=None):440 date=None, build=None, revid=None, epoch=1):
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.
440442
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,
@@ -457,6 +459,7 @@
457 :param date: The date of the build.459 :param date: The date of the build.
458 :param build: The build number in CI.460 :param build: The build number in CI.
459 :param revid: The revid hash of the source.461 :param revid: The revid hash of the source.
462 :param epoch: The epoch to pass in version name
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).
461 """464 """
462 if not isinstance(series, list):465 if not isinstance(series, list):
@@ -483,7 +486,7 @@
483 build_dir, spb, a_series, version,486 build_dir, spb, a_series, version,
484 upatch=upatch, bugs=bugs, gpgcmd=gpgcmd,487 upatch=upatch, bugs=bugs, gpgcmd=gpgcmd,
485 debemail=debemail, debfullname=debfullname, verbose=verbose,488 debemail=debemail, debfullname=debfullname, verbose=verbose,
486 date=date, build=build, revid=revid)489 date=date, build=build, revid=revid, epoch=epoch)
487 return 0490 return 0
488491
489492
@@ -506,8 +509,8 @@
506 args.tar_file, args.location, args.series, args.bugs,509 args.tar_file, args.location, args.series, args.bugs,
507 debemail=args.debemail, debfullname=args.debfullname,510 debemail=args.debemail, debfullname=args.debfullname,
508 gpgcmd=args.gpgcmd, branch=args.branch, upatch=args.upatch,511 gpgcmd=args.gpgcmd, branch=args.branch, upatch=args.upatch,
509 verbose=args.verbose,512 verbose=args.verbose, date=args.date, build=args.build,
510 date=args.date, build=args.build, revid=args.revid)513 revid=args.revid, epoch=args.epoch)
511 elif args.command == 'binary':514 elif args.command == 'binary':
512 exitcode = build_binary(515 exitcode = build_binary(
513 args.dsc, args.location, args.series, args.arch,516 args.dsc, args.location, args.series, args.arch,
@@ -533,6 +536,8 @@
533 '--debfullname', default=os.environ.get("DEBFULLNAME"),536 '--debfullname', default=os.environ.get("DEBFULLNAME"),
534 help="Your full name; Environment: DEBFULLNAME.")537 help="Your full name; Environment: DEBFULLNAME.")
535 src_parser.add_argument(538 src_parser.add_argument(
539 '--epoch', default='1', help="The epoch for package version")
540 src_parser.add_argument(
536 '--gpgcmd', default=None,541 '--gpgcmd', default=None,
537 help="Path to a gpg signing command to make signed packages.")542 help="Path to a gpg signing command to make signed packages.")
538 src_parser.add_argument(543 src_parser.add_argument(
539544
=== modified file 'tests/test_build_package.py'
--- tests/test_build_package.py 2016-07-21 14:01:00 +0000
+++ tests/test_build_package.py 2016-09-09 21:33:08 +0000
@@ -334,9 +334,9 @@
334334
335 def test_make_ubuntu_version(self):335 def test_make_ubuntu_version(self):
336 ubuntu_version = make_ubuntu_version('trusty', '1.2.3')336 ubuntu_version = make_ubuntu_version('trusty', '1.2.3')
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)
338 ubuntu_version = make_ubuntu_version('precise', '1.22-alpha1', '8')338 ubuntu_version = make_ubuntu_version('precise', '1.22~alpha1', '8')
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)
340340
341 def test_make_changelog_message(self):341 def test_make_changelog_message(self):
342 message = make_changelog_message('1.2.0')342 message = make_changelog_message('1.2.0')
@@ -397,6 +397,7 @@
397 scenarios = [397 scenarios = [
398 ('release',398 ('release',
399 {'date': None,399 {'date': None,
400 'epoch': '2',
400 'build': None,401 'build': None,
401 'revid': None,402 'revid': None,
402 'version': '1.2.3',403 'version': '1.2.3',
@@ -407,6 +408,7 @@
407408
408 ('daily',409 ('daily',
409 {'date': '20160502',410 {'date': '20160502',
411 'epoch': None,
410 'build': '3065',412 'build': '3065',
411 'revid': '4bbce805',413 'revid': '4bbce805',
412 'version': '1.2.3~20160502~3065~4bbce805',414 'version': '1.2.3~20160502~3065~4bbce805',
@@ -416,6 +418,7 @@
416 }),418 }),
417 ('broken_daily',419 ('broken_daily',
418 {'date': None,420 {'date': None,
421 'epoch': None,
419 'build': '3065',422 'build': '3065',
420 'revid': '4bbce805',423 'revid': '4bbce805',
421 'version': '1.2.3',424 'version': '1.2.3',
@@ -458,22 +461,25 @@
458 scenarios = [461 scenarios = [
459 ('release',462 ('release',
460 {'date': None,463 {'date': None,
464 'epoch': '1',
461 'build': None,465 'build': None,
462 'revid': None,466 'revid': None,
463 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1'467 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1'
464 }),468 }),
465469
466 ('daily',470 ('daily',
467 {'date': '20160502',471 {'date': '20160502',
472 'epoch': '2',
468 'build': '3065',473 'build': '3065',
469 'revid': '4bbce805',474 'revid': '4bbce805',
470 'ubuntu_version': '1.2.3-20160502+3065+4bbce805~14.04'475 'ubuntu_version': '2:1.2.3~20160502+3065+4bbce805~14.04'
471 }),476 }),
472 ('broken_daily',477 ('broken_daily',
473 {'date': None,478 {'date': None,
479 'epoch': '1',
474 'build': '3065',480 'build': '3065',
475 'revid': '4bbce805',481 'revid': '4bbce805',
476 'ubuntu_version': '1.2.3-0ubuntu1~14.04.1~juju1'482 'ubuntu_version': '1:1.2.3~0ubuntu1~14.04.1~juju1'
477 })483 })
478 ]484 ]
479485
@@ -484,7 +490,8 @@
484 '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty',490 '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty',
485 '1.2.3', upatch='1', bugs=['987'], gpgcmd=None,491 '1.2.3', upatch='1', bugs=['987'], gpgcmd=None,
486 debemail='me@email', debfullname='me', verbose=False,492 debemail='me@email', debfullname='me', verbose=False,
487 date=self.date, build=self.build, revid=self.revid)493 date=self.date, build=self.build, revid=self.revid,
494 epoch=self.epoch)
488 script = BUILD_SOURCE_TEMPLATE.format(495 script = BUILD_SOURCE_TEMPLATE.format(
489 spb='/juju-build-any-all/spb',496 spb='/juju-build-any-all/spb',
490 source='/juju-build-trusty-all/source',497 source='/juju-build-trusty-all/source',
@@ -503,7 +510,8 @@
503 '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty',510 '/juju-build-trusty-all', '/juju-build-any-all/spb', 'trusty',
504 '1.2.3', upatch='1', bugs=['987'], gpgcmd='/my/gpgcmd',511 '1.2.3', upatch='1', bugs=['987'], gpgcmd='/my/gpgcmd',
505 debemail='me@email', debfullname='me', verbose=False,512 debemail='me@email', debfullname='me', verbose=False,
506 date=self.date, build=self.build, revid=self.revid)513 date=self.date, build=self.build, revid=self.revid,
514 epoch=self.epoch)
507 script = BUILD_SOURCE_TEMPLATE.format(515 script = BUILD_SOURCE_TEMPLATE.format(
508 spb='/juju-build-any-all/spb',516 spb='/juju-build-any-all/spb',
509 source='/juju-build-trusty-all/source',517 source='/juju-build-trusty-all/source',
@@ -522,17 +530,20 @@
522 scenarios = [530 scenarios = [
523 ('release',531 ('release',
524 {'date': None,532 {'date': None,
533 'epoch': None,
525 'build': None,534 'build': None,
526 'revid': None535 'revid': None
527 }),536 }),
528537
529 ('daily',538 ('daily',
530 {'date': '20160502',539 {'date': '20160502',
540 'epoch': '1',
531 'build': '3065',541 'build': '3065',
532 'revid': '4bbce805'542 'revid': '4bbce805'
533 }),543 }),
534 ('broken_daily',544 ('broken_daily',
535 {'date': None,545 {'date': None,
546 'epoch': None,
536 'build': '3065',547 'build': '3065',
537 'revid': '4bbce805'548 'revid': '4bbce805'
538 })549 })
@@ -643,10 +654,13 @@
643 if self.revid:654 if self.revid:
644 args_list.append('--revid')655 args_list.append('--revid')
645 args_list.append(self.revid)656 args_list.append(self.revid)
657 args_list.append('--epoch')
658 args_list.append(self.epoch)
646 code = main(args_list)659 code = main(args_list)
647 self.assertEqual(0, code)660 self.assertEqual(0, code)
648 bs_mock.assert_called_with(661 bs_mock.assert_called_with(
649 'my.tar.gz', '~/workspace', 'trusty', ['123', '456'],662 'my.tar.gz', '~/workspace', 'trusty', ['123', '456'],
650 debemail='me@email', debfullname='me', gpgcmd=None,663 debemail='me@email', debfullname='me', gpgcmd=None,
651 branch=DEFAULT_SPB, upatch='1', verbose=False,664 branch=DEFAULT_SPB, upatch='1', verbose=False,
652 date=self.date, build=self.build, revid=self.revid)665 date=self.date, build=self.build, revid=self.revid,
666 epoch=self.epoch)

Subscribers

People subscribed via source and target branches