From b8ecbbb9e1cfdbb7909d582d58d09601db37be98 Mon Sep 17 00:00:00 2001 From: Daniel Farrell Date: Fri, 5 Oct 2018 23:05:33 -0400 Subject: [PATCH] Add override for pkg version in pkg build logic The package version is the bit after the minus, meant for use by the package itself, not the thing being packaged (ODL). It's normally auto-detected for pre-release builds, or manually fixed at 1 for releases. Add param to optionally manually override. This is needed to fix an issue with building the Fluorine Common Distro on the CentOS CBS. Jira: INTPAK-210 Change-Id: Ifc97d92d4ec3503b31ea57eb535cdf79505afcf0 Signed-off-by: Daniel Farrell --- packages/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/build.py b/packages/build.py index c829353..3bedc6a 100755 --- a/packages/build.py +++ b/packages/build.py @@ -53,6 +53,8 @@ if __name__ == "__main__": # Direct builds require an archive URL direct_parser.add_argument("--download_url", required=True, help="URL to tar/zip build archive to package") + direct_parser.add_argument( + "--pkg_version", help="Override autodetected package component of RPM version (maj.min.pat-pkg)'") # Create subparser for building latest snapshot from a given branch latest_snap_parser = subparsers.add_parser( @@ -118,6 +120,11 @@ if __name__ == "__main__": # Use download_url to find pkg version, add to build def build.update(lib.extract_version(build["download_url"])) + # Override automatically extracted package version with param if passed + if (hasattr(args, "pkg_version") and args.pkg_version is not None and + args.pkg_version is not ""): + build['pkg_version'] = args.pkg_version + # Karaf 3 distros use distribution-karaf-, Karaf 4 uses karaf- build.update({"distro_name_prefix": lib.get_distro_name_prefix( build['version_major'], build['download_url'])}) -- 2.36.6