From c6c7acd8a63244b032d7e59f767f311f9bb0d522 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 22 Mar 2016 14:35:49 -0700 Subject: images: Package builder script now can specify versioning --- images/CMakeLists.txt | 7 ++++++- images/create_imgs_package.py | 8 +++++--- images/make_zip.sh | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'images') diff --git a/images/CMakeLists.txt b/images/CMakeLists.txt index 161b5130a..6c3b23239 100644 --- a/images/CMakeLists.txt +++ b/images/CMakeLists.txt @@ -18,7 +18,12 @@ ######################################################################## # Setup Project ######################################################################## -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +#OPTION(UHD_PATCH_OVERRIDE "Use this string to force a patch level version string." OFF) +MESSAGE(STATUS ${UHD_PATCH_OVERRIDE}) +IF(DEFINED UHD_PATCH_OVERRIDE) + SET(UHD_VERSION_PATCH_OVERRIDE ${UHD_PATCH_OVERRIDE}) +ENDIF(DEFINED UHD_PATCH_OVERRIDE) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(UHD-images NONE) LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../host/cmake/Modules) INCLUDE(UHDVersion) #sets version variables (used below) diff --git a/images/create_imgs_package.py b/images/create_imgs_package.py index bdd4e7644..82b7d65d4 100755 --- a/images/create_imgs_package.py +++ b/images/create_imgs_package.py @@ -47,12 +47,13 @@ def parse_args(): parser = argparse.ArgumentParser(description='Link the current set of images to this commit.') parser.add_argument('--commit', default=None, help='Supply a commit message to the changes to host/CMakeLists.txt.') - parser.add_argument('-r', '--release-mode', default=None, + parser.add_argument('-r', '--release-mode', default="", help='Specify UHD_RELEASE_MODE. Typically "release" or "rc1" or similar.') parser.add_argument('--skip-edit', default=False, action='store_true', help='Do not edit the CMakeLists.txt file.') parser.add_argument('--skip-move', default=False, action='store_true', help='Do not move the archives after creating them.') + parser.add_argument('--patch', help='Override patch version number.') return parser.parse_args() def move_zip_to_repo(base_url, zipfilename): @@ -75,8 +76,9 @@ def main(): clear_img_dir(img_root_dir) print "== Creating archives..." cpack_cmd = ["./make_zip.sh",] - if args.release_mode is not None: - cpack_cmd.append(args.release_mode) + cpack_cmd.append(args.release_mode) + if args.patch is not None: + cpack_cmd.append("-DUHD_PATCH_OVERRIDE={}".format(args.patch)) try: cpack_output = subprocess.check_output(cpack_cmd) except subprocess.CalledProcessError as e: diff --git a/images/make_zip.sh b/images/make_zip.sh index 19695ef3f..e9ef802f7 100755 --- a/images/make_zip.sh +++ b/images/make_zip.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Automatically run the make-zip-file process # Check we're in the right directory and all is set: if [ ! -e 'make_zip.sh' ]; then @@ -28,12 +28,12 @@ mkdir build cd build # Run the CPack process (ZIP file) -cmake .. -DCPACK_GENERATOR=ZIP -DUHD_RELEASE_MODE="$1" .. +cmake .. -DCPACK_GENERATOR=ZIP -DUHD_RELEASE_MODE="$1" $2 .. make package mv uhd-images*.zip .. # Run the CPack process (tarball) -cmake .. -DCPACK_GENERATOR=TGZ -DUHD_RELEASE_MODE="$1" .. +cmake .. -DCPACK_GENERATOR=TGZ -DUHD_RELEASE_MODE="$1" $2 .. make package mv uhd-images*.tar.gz .. -- cgit v1.2.3