diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-01-28 16:17:56 +0100 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2019-01-28 17:01:42 +0100 |
commit | 317c2f8e695de186487347117296faa04ed42269 (patch) | |
tree | e7ad715c17bb0f606f2ffcbe85c2a3e4d07ead69 | |
parent | 015dd3fa693039acd08171e8a8d27b3776670a41 (diff) |
[HICN-10] Fix for build number retrieval from CMake
Change-Id: I511df63962dda9ec53117a9a380cb5ac05a0b10b
Signed-off-by: Mauro Sardara <msardara@cisco.com>
-rwxr-xr-x | cmake/Modules/Packager.cmake | 12 | ||||
-rw-r--r-- | scripts/build-packages.sh | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/cmake/Modules/Packager.cmake b/cmake/Modules/Packager.cmake index 8f7ba4264..9a64488e4 100755 --- a/cmake/Modules/Packager.cmake +++ b/cmake/Modules/Packager.cmake @@ -51,19 +51,21 @@ macro(make_packages) list(GET VER 1 commit_num) list(GET VER 2 commit_name) - if (NOT ENV{BUILD_NUMBER}) + if ($ENV{BUILD_NUMBER} STREQUAL "") set(bld "b1") else() set(bld "b$ENV{BUILD_NUMBER}") endif() + message("Build number is: ${bld}") + #define DEB and RPM version numbers if(${commit_num} EQUAL 0) set(deb_ver "${tag}") set(rpm_ver "${tag}") else() - set(deb_ver "${tag}-${commit_num}-${commit_name}~${bld}") - set(rpm_ver "${tag}-${commit_num}_${commit_name}~${bld}") + set(deb_ver "${tag}-${commit_num}-release") + set(rpm_ver "${tag}-${commit_num}-release") endif() get_cmake_property(components COMPONENTS) @@ -81,7 +83,7 @@ macro(make_packages) set(CPACK_PACKAGE_VERSION "${deb_ver}") foreach(lc ${components}) string(TOUPPER ${lc} uc) - set(CPACK_${type}_${uc}_FILE_NAME "${lc}_${tag}-${commit_num}-release_${arch}.deb") + set(CPACK_${type}_${uc}_FILE_NAME "${lc}_${deb_ver}_${arch}.deb") set(DEB_DEPS) if (NOT ${${lc}_DEB_DEPENDENCIES} STREQUAL "") @@ -121,7 +123,7 @@ macro(make_packages) endif() set(CPACK_RPM_${uc}_PACKAGE_NAME "${package_name}") - set(CPACK_${type}_${uc}_FILE_NAME "${package_name}-${tag}-${commit_num}-release.${arch}.rpm") + set(CPACK_${type}_${uc}_FILE_NAME "${package_name}-${rpm_ver}.${arch}.rpm") endforeach() endif() diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 6101e93fa..b199f99e8 100644 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -56,6 +56,7 @@ setup_fdio_repo() { curl -s ${PACKAGECLOUD_RELEASE_REPO_RPM} | sudo bash curl ${LATEST_EPEL_REPO} > epel-release-latest-7.noarch.rpm rpm -ivh epel-release-latest-7.noarch.rpm || true + rm epel-release-latest-7.noarch.rpm else echo "Distribution ${DISTRIB_ID} is not supported" exit -1 |