From f8189fa9be6bcc222cc5f728605ace8d9b3e295d Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Tue, 30 Apr 2019 17:45:06 -0500 Subject: [PATCH] pkgs: remove git hash from version When a repository holds more than one kata version it is difficult to ask dnf or zypper for a kata version because the version includes a git commit. This commit removes the sha from the package version. Signed-off-by: Jose Carlos Venegas Munoz --- .../kata-containers-image.spec-template | 7 ++----- obs-packaging/ksm-throttler/_service-template | 2 +- .../kata-ksm-throttler.dsc-template | 4 ++-- .../kata-ksm-throttler.spec-template | 4 ++-- .../kata-linux-container.spec-template | 2 +- obs-packaging/proxy/_service-template | 2 +- obs-packaging/proxy/kata-proxy.dsc-template | 4 ++-- obs-packaging/proxy/kata-proxy.spec-template | 4 ++-- .../qemu-lite/qemu-lite.spec-template | 2 +- .../qemu-vanilla/qemu-vanilla.spec-template | 2 +- obs-packaging/runtime/_service-template | 2 +- .../runtime/kata-runtime.dsc-template | 4 ++-- .../runtime/kata-runtime.spec-template | 4 ++-- obs-packaging/runtime/update.sh | 21 +++++++------------ obs-packaging/scripts/pkglib.sh | 6 ++++-- obs-packaging/shim/_service-template | 2 +- obs-packaging/shim/kata-shim.dsc-template | 4 ++-- obs-packaging/shim/kata-shim.spec-template | 4 ++-- 18 files changed, 36 insertions(+), 44 deletions(-) diff --git a/obs-packaging/kata-containers-image/kata-containers-image.spec-template b/obs-packaging/kata-containers-image/kata-containers-image.spec-template index 05e028b959..dda386f15d 100644 --- a/obs-packaging/kata-containers-image/kata-containers-image.spec-template +++ b/obs-packaging/kata-containers-image/kata-containers-image.spec-template @@ -1,9 +1,6 @@ -%define version @VERSION@ -%define release @RELEASE@ - Name: kata-containers-image -Version: %{version} -Release: %{release}. +Version: @VERSION@ +Release: @RELEASE@ License: Artistic-1.0 BSD-3-Clause BSD-3-Clause-Kata BSD-4-Clause-UC GFDL-1.3 GPL-2.0 GPL-2.0+ GPL-3.0 GPL-3.0+ LGPL-2.0 LGPL-2.0+ LGPL-2.1 LGPL-3.0+ MIT MPL-2.0 Public-Domain Summary: Kata Containers Image Url: https://github.com/kata-containers/osbuilder diff --git a/obs-packaging/ksm-throttler/_service-template b/obs-packaging/ksm-throttler/_service-template index 15c4d64b9f..6e641adb95 100644 --- a/obs-packaging/ksm-throttler/_service-template +++ b/obs-packaging/ksm-throttler/_service-template @@ -4,7 +4,7 @@ git https://github.com/kata-containers/ksm-throttler.git kata-ksm-throttler - @VERSION@.git+@HASH@ + @VERSION@ @HASH@ diff --git a/obs-packaging/ksm-throttler/kata-ksm-throttler.dsc-template b/obs-packaging/ksm-throttler/kata-ksm-throttler.dsc-template index 8a617db012..2a04841603 100644 --- a/obs-packaging/ksm-throttler/kata-ksm-throttler.dsc-template +++ b/obs-packaging/ksm-throttler/kata-ksm-throttler.dsc-template @@ -1,13 +1,13 @@ Format: 3.0 (quilt) Source: kata-ksm-throttler -Version: @VERSION@.git+@HASH@-@RELEASE@ +Version: @VERSION@-@RELEASE@ Section: devel Priority: optional Maintainer: Kata containers team Standards-Version: 3.9.6 Homepage: https://katacontainers.io Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make, pkg-config, dh-systemd, systemd -Debtransform-Tar: kata-ksm-throttler-@VERSION@.git+@HASH@.tar.gz +Debtransform-Tar: kata-ksm-throttler-@VERSION@.tar.gz Package: kata-ksm-throttler Architecture: @deb_arch@ diff --git a/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template b/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template index 6a3dc15350..fbbdbf6ef8 100644 --- a/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template +++ b/obs-packaging/ksm-throttler/kata-ksm-throttler.spec-template @@ -16,8 +16,8 @@ %define debug_package %{nil} Name: kata-ksm-throttler -Version: @VERSION@.git+@HASH@ -Release: @RELEASE@. +Version: @VERSION@ +Release: @RELEASE@ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Summary : No detailed summary available diff --git a/obs-packaging/linux-container/kata-linux-container.spec-template b/obs-packaging/linux-container/kata-linux-container.spec-template index 9d8041d19d..5aa1d367bc 100644 --- a/obs-packaging/linux-container/kata-linux-container.spec-template +++ b/obs-packaging/linux-container/kata-linux-container.spec-template @@ -6,7 +6,7 @@ Name: kata-linux-container Version: @VERSION@.@CONFIG_VERSION@ -Release: @RELEASE@. +Release: @RELEASE@ License: GPL-2.0 Summary: The Linux kernel optimized for running inside a container Group: System/Kernel diff --git a/obs-packaging/proxy/_service-template b/obs-packaging/proxy/_service-template index e2277f62a2..26c538282a 100644 --- a/obs-packaging/proxy/_service-template +++ b/obs-packaging/proxy/_service-template @@ -4,7 +4,7 @@ git https://github.com/kata-containers/proxy.git kata-proxy - @VERSION@+git.@HASH@ + @VERSION@ @HASH@ diff --git a/obs-packaging/proxy/kata-proxy.dsc-template b/obs-packaging/proxy/kata-proxy.dsc-template index e3c38199fd..555e5ef302 100644 --- a/obs-packaging/proxy/kata-proxy.dsc-template +++ b/obs-packaging/proxy/kata-proxy.dsc-template @@ -1,13 +1,13 @@ format: 3.0 (quilt) Source: kata-proxy -Version: @VERSION@+git.@HASH@-@RELEASE@ +Version: @VERSION@-@RELEASE@ Section: devel Priority: optional Maintainer: Kata containers team Standards-Version: 3.9.6 Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make Homepage: https://katacontainers.io -Debtransform-Tar: kata-proxy-@VERSION@+git.@HASH@.tar.gz +Debtransform-Tar: kata-proxy-@VERSION@.tar.gz Package: kata-proxy Architecture: @deb_arch@ diff --git a/obs-packaging/proxy/kata-proxy.spec-template b/obs-packaging/proxy/kata-proxy.spec-template index 12c2376560..7298480611 100644 --- a/obs-packaging/proxy/kata-proxy.spec-template +++ b/obs-packaging/proxy/kata-proxy.spec-template @@ -10,8 +10,8 @@ %undefine _missing_build_ids_terminate_build Name: kata-proxy -Version: @VERSION@+git.@HASH@ -Release: @RELEASE@. +Version: @VERSION@ +Release: @RELEASE@ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pkgconfig(systemd) diff --git a/obs-packaging/qemu-lite/qemu-lite.spec-template b/obs-packaging/qemu-lite/qemu-lite.spec-template index 6a68fd8f56..b79c88d4e0 100644 --- a/obs-packaging/qemu-lite/qemu-lite.spec-template +++ b/obs-packaging/qemu-lite/qemu-lite.spec-template @@ -1,7 +1,7 @@ %global qemu_lite_hash @QEMU_LITE_HASH@ Name: qemu-lite Version: @VERSION@+git.%{qemu_lite_hash} -Release: @RELEASE@. +Release: @RELEASE@ Source0: %{name}-%{version}.tar.gz Source1: qemu-lite-rpmlintrc Source2: configure-hypervisor.sh diff --git a/obs-packaging/qemu-vanilla/qemu-vanilla.spec-template b/obs-packaging/qemu-vanilla/qemu-vanilla.spec-template index 16c2739501..fa3b90defb 100644 --- a/obs-packaging/qemu-vanilla/qemu-vanilla.spec-template +++ b/obs-packaging/qemu-vanilla/qemu-vanilla.spec-template @@ -1,7 +1,7 @@ %global qemu_vanilla_hash @QEMU_VANILLA_HASH@ Name: qemu-vanilla Version: @VERSION@+git.%{qemu_vanilla_hash} -Release: @RELEASE@. +Release: @RELEASE@ Source0: %{name}-%{version}.tar.gz Source1: qemu-vanilla-rpmlintrc Source2: configure-hypervisor.sh diff --git a/obs-packaging/runtime/_service-template b/obs-packaging/runtime/_service-template index b776d9bd7f..f05e57d26d 100644 --- a/obs-packaging/runtime/_service-template +++ b/obs-packaging/runtime/_service-template @@ -6,7 +6,7 @@ https://github.com/kata-containers/runtime.git kata-runtime - @VERSION@+git.@HASH@ + @VERSION@ @HASH@ diff --git a/obs-packaging/runtime/kata-runtime.dsc-template b/obs-packaging/runtime/kata-runtime.dsc-template index 3ba0fb66de..d10f4b075d 100644 --- a/obs-packaging/runtime/kata-runtime.dsc-template +++ b/obs-packaging/runtime/kata-runtime.dsc-template @@ -2,14 +2,14 @@ Format: 3.0 (quilt) Source: kata-runtime # Version is expected to be started with a digit following by an alphanumeric string # e.g. 1.0.0+git.1234567-1 -Version: @VERSION@+git.@HASH@-@RELEASE@ +Version: @VERSION@-@RELEASE@ Section: devel Priority: optional Maintainer: Kata containers team Standards-Version: 3.9.6 Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make Homepage: https://katacontainers.io -Debtransform-Tar: kata-runtime-@VERSION@+git.@HASH@.tar.gz +Debtransform-Tar: kata-runtime-@VERSION@.tar.gz Package: kata-runtime Architecture: @deb_arch@ diff --git a/obs-packaging/runtime/kata-runtime.spec-template b/obs-packaging/runtime/kata-runtime.spec-template index 43a2e38fb7..450e108e40 100644 --- a/obs-packaging/runtime/kata-runtime.spec-template +++ b/obs-packaging/runtime/kata-runtime.spec-template @@ -14,8 +14,8 @@ Name: kata-runtime # Version is expected to be started with a digit following by an alphanumeric string # e.g. 1.0.0+git.1234567 -Version: @VERSION@+git.@HASH@ -Release: @RELEASE@. +Version: @VERSION@ +Release: @RELEASE@ Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Summary : No detailed summary available diff --git a/obs-packaging/runtime/update.sh b/obs-packaging/runtime/update.sh index 972ff0615e..9d6b1a8a0a 100755 --- a/obs-packaging/runtime/update.sh +++ b/obs-packaging/runtime/update.sh @@ -45,33 +45,26 @@ cli "$@" # Package depedencies info "requires:" -PROXY_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/proxy") -PROXY_REQUIRED_VERESION=$(pkg_version "${kata_proxy_version}" "${PROXY_RELEASE}" "${kata_proxy_hash}") +PROXY_REQUIRED_VERESION=$(pkg_version "${kata_proxy_version}" "" "") info "proxy ${PROXY_REQUIRED_VERESION}" -SHIM_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/shim") -SHIM_REQUIRED_VERSION=$(pkg_version "${kata_shim_version}" "${SHIM_RELEASE}" "${kata_shim_hash}") +SHIM_REQUIRED_VERSION=$(pkg_version "${kata_shim_version}" "" "") info "shim ${SHIM_REQUIRED_VERSION}" -KERNEL_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/linux-container") KERNEL_CONFIG_VERSION=$(cat "${SCRIPT_DIR}/../../kernel/kata_config_version") -KERNEL_REQUIRED_VERSION=$(pkg_version "${kernel_version}.${KERNEL_CONFIG_VERSION}" "${KERNEL_RELEASE}" "") +KERNEL_REQUIRED_VERSION=$(pkg_version "${kernel_version}.${KERNEL_CONFIG_VERSION}" "" "") info "kata-linux-container ${KERNEL_REQUIRED_VERSION}" -KSM_THROTTLER_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/ksm-throttler") -KSM_THROTTLER_REQUIRED_VERSION=$(pkg_version "${kata_ksm_throttler_version}" "${KSM_THROTTLER_RELEASE}" "${kata_ksm_throttler_hash}") +KSM_THROTTLER_REQUIRED_VERSION=$(pkg_version "${kata_ksm_throttler_version}" "" "") info "ksm-throttler ${KSM_THROTTLER_REQUIRED_VERSION}" -KATA_CONTAINERS_IMAGE_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/kata-containers-image") -KATA_IMAGE_REQUIRED_VERSION=$(pkg_version "${kata_osbuilder_version}" "${KATA_CONTAINERS_IMAGE_RELEASE}" "") +KATA_IMAGE_REQUIRED_VERSION=$(pkg_version "${kata_osbuilder_version}" "" "") info "image ${KATA_IMAGE_REQUIRED_VERSION}" -KATA_CONTAINERS_QEMU_LITE_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/qemu-lite") -KATA_QEMU_LITE_REQUIRED_VERSION=$(pkg_version "${qemu_lite_version}" "${KATA_CONTAINERS_QEMU_LITE_RELEASE}" "${qemu_lite_hash}") +KATA_QEMU_LITE_REQUIRED_VERSION=$(pkg_version "${qemu_lite_version}" "" "${qemu_lite_hash}") info "qemu-lite ${KATA_QEMU_LITE_REQUIRED_VERSION}" -KATA_CONTAINERS_QEMU_VANILLA_RELEASE=$(get_obs_pkg_release "home:${OBS_PROJECT}:${OBS_SUBPROJECT}/qemu-vanilla") -KATA_QEMU_VANILLA_REQUIRED_VERSION=$(pkg_version "${qemu_vanilla_version}" "${KATA_CONTAINERS_QEMU_VANILLA_RELEASE}" "${qemu_vanilla_hash}") +KATA_QEMU_VANILLA_REQUIRED_VERSION=$(pkg_version "${qemu_vanilla_version}" "" "${qemu_vanilla_hash}") info "qemu-vanilla ${KATA_QEMU_VANILLA_REQUIRED_VERSION}" PROJECT_REPO=${PROJECT_REPO:-home:${OBS_PROJECT}:${OBS_SUBPROJECT}/runtime} diff --git a/obs-packaging/scripts/pkglib.sh b/obs-packaging/scripts/pkglib.sh index 19d253870f..52b0cd6228 100644 --- a/obs-packaging/scripts/pkglib.sh +++ b/obs-packaging/scripts/pkglib.sh @@ -291,14 +291,16 @@ function pkg_version() { local pkg_release="$2" local commit_id="$3" [ -n "${project_version}" ] || die "${FUNCNAME}: need version" - [ -n "${pkg_release}" ] || die "${FUNCNAME}: pkg release is needed" pkg_version="${project_version}" if [ -n "$commit_id" ]; then pkg_version+="+git.${commit_id:0:7}" fi - echo "$pkg_version-${pkg_release}" + if [ -n "$pkg_release" ]; then + pkg_version+="-${pkg_release}" + fi + echo "$pkg_version" } function get_obs_pkg_release() { diff --git a/obs-packaging/shim/_service-template b/obs-packaging/shim/_service-template index edb29511ef..92c7358b7e 100644 --- a/obs-packaging/shim/_service-template +++ b/obs-packaging/shim/_service-template @@ -4,7 +4,7 @@ git https://github.com/kata-containers/shim.git kata-shim - @VERSION@+git.@HASH@ + @VERSION@ @HASH@ diff --git a/obs-packaging/shim/kata-shim.dsc-template b/obs-packaging/shim/kata-shim.dsc-template index 757f148dea..5182927a30 100644 --- a/obs-packaging/shim/kata-shim.dsc-template +++ b/obs-packaging/shim/kata-shim.dsc-template @@ -1,13 +1,13 @@ Format: 3.0 (quilt) Source: kata-shim -Version: @VERSION@+git.@HASH@-@RELEASE@ +Version: @VERSION@-@RELEASE@ Section: devel Priority: optional Maintainer: Kata containers team Standards-Version: 3.9.6 Build-Depends: debhelper (>= 9), git, ca-certificates, execstack, devscripts, dh-make Homepage: https://katacontainers.io -Debtransform-Tar: kata-shim-@VERSION@+git.@HASH@.tar.gz +Debtransform-Tar: kata-shim-@VERSION@.tar.gz Package: kata-shim Architecture: @deb_arch@ diff --git a/obs-packaging/shim/kata-shim.spec-template b/obs-packaging/shim/kata-shim.spec-template index ae30e98b51..4cdb88de29 100644 --- a/obs-packaging/shim/kata-shim.spec-template +++ b/obs-packaging/shim/kata-shim.spec-template @@ -8,8 +8,8 @@ %undefine _missing_build_ids_terminate_build Name: kata-shim -Version: @VERSION@+git.@HASH@ -Release: @RELEASE@. +Version: @VERSION@ +Release: @RELEASE@ Summary : No detailed summary available Group : Development/Tools License : Apache-2.0