[28705] in Source-Commits

home help back first fref pref prev next nref lref last post

build-system commit: athena-upstream-tarball: Accept --force-version=VERSION

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Wed Oct 12 04:11:15 2016

Date: Wed, 12 Oct 2016 04:11:12 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201610120811.u9C8BCAM006476@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/build-system/commit/730dd8a5e74137ecf4652f73b9617d5ac130c28f
commit 730dd8a5e74137ecf4652f73b9617d5ac130c28f
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Wed Oct 12 04:09:25 2016 -0400

    athena-upstream-tarball: Accept --force-version=VERSION

 athena-upstream-tarball |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/athena-upstream-tarball b/athena-upstream-tarball
index bcf1a4e..f2d352a 100755
--- a/athena-upstream-tarball
+++ b/athena-upstream-tarball
@@ -89,7 +89,7 @@ def do_git_archive(package, version, rev, filename, generated_path, dest_path):
     fullname = "%s-%s" % (package, version)
     rev.repo.git('archive', '--prefix=%s/' % fullname, '--output=%s' % filename, rev.hash)
 
-def build_upstream_tarball(package, do_build = True, do_pristine_tar = False, allow_override = False):
+def build_upstream_tarball(package, do_build = True, do_pristine_tar = False, allow_override = False, force_version = None):
     """
     Build a correct redistributable release of non-Debian-specific package.
     """
@@ -122,6 +122,9 @@ def build_upstream_tarball(package, do_build = True, do_pristine_tar = False, al
             raise BuildError("No VERSION file found, and no other way to determine current version was provided")
         method = 'git archive'
 
+    if force_version is not None:
+        version = force_version
+
     # The tag must exist in order for build to succeed
     try:
         tagged = repo.read_tag(version)
@@ -168,6 +171,7 @@ def main():
     argparser.add_argument("--pristine-tar", "-p", action="store_true", help="Commit the tarball to the Git repo")
     argparser.add_argument("--only-pristine-tar", "-P", action="store_true", help="Do not build the tarball, only commit it")
     argparser.add_argument("--yes-please-do-override-my-pristine-tar", action="store_true", help="Do not quit if pristine-tar is checked in")
+    argparser.add_argument("--force-version", help="Override the detected version number")
     args = argparser.parse_args()
 
     global quiet
@@ -176,7 +180,7 @@ def main():
     do_build = not args.only_pristine_tar
     do_pristine_tar = args.pristine_tar or args.only_pristine_tar
 
-    build_upstream_tarball(args.package, do_build, do_pristine_tar, args.yes_please_do_override_my_pristine_tar)
+    build_upstream_tarball(args.package, do_build, do_pristine_tar, args.yes_please_do_override_my_pristine_tar, args.force_version)
 
 if __name__ == '__main__':
     if not dabuildsys.claim_lock():

home help back first fref pref prev next nref lref last post