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 <jose.carlos.venegas.munoz@intel.com>
This commit is contained in:
Jose Carlos Venegas Munoz 2019-04-30 17:45:06 -05:00
parent e73473fc75
commit f8189fa9be
18 changed files with 36 additions and 44 deletions

View File

@ -1,9 +1,6 @@
%define version @VERSION@
%define release @RELEASE@
Name: kata-containers-image
Version: %{version}
Release: %{release}.<B_CNT>
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

View File

@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/ksm-throttler.git</param>
<param name="filename">kata-ksm-throttler</param>
<param name="versionformat">@VERSION@.git+@HASH@</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">

View File

@ -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 <https://github.com/kata-containers/>
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@

View File

@ -16,8 +16,8 @@
%define debug_package %{nil}
Name: kata-ksm-throttler
Version: @VERSION@.git+@HASH@
Release: @RELEASE@.<B_CNT>
Version: @VERSION@
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Summary : No detailed summary available

View File

@ -6,7 +6,7 @@
Name: kata-linux-container
Version: @VERSION@.@CONFIG_VERSION@
Release: @RELEASE@.<B_CNT>
Release: @RELEASE@
License: GPL-2.0
Summary: The Linux kernel optimized for running inside a container
Group: System/Kernel

View File

@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/proxy.git</param>
<param name="filename">kata-proxy</param>
<param name="versionformat">@VERSION@+git.@HASH@</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">

View File

@ -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 <https://github.com/kata-containers/>
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@

View File

@ -10,8 +10,8 @@
%undefine _missing_build_ids_terminate_build
Name: kata-proxy
Version: @VERSION@+git.@HASH@
Release: @RELEASE@.<B_CNT>
Version: @VERSION@
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pkgconfig(systemd)

View File

@ -1,7 +1,7 @@
%global qemu_lite_hash @QEMU_LITE_HASH@
Name: qemu-lite
Version: @VERSION@+git.%{qemu_lite_hash}
Release: @RELEASE@.<B_CNT>
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
Source1: qemu-lite-rpmlintrc
Source2: configure-hypervisor.sh

View File

@ -1,7 +1,7 @@
%global qemu_vanilla_hash @QEMU_VANILLA_HASH@
Name: qemu-vanilla
Version: @VERSION@+git.%{qemu_vanilla_hash}
Release: @RELEASE@.<B_CNT>
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
Source1: qemu-vanilla-rpmlintrc
Source2: configure-hypervisor.sh

View File

@ -6,7 +6,7 @@
<param name="url">https://github.com/kata-containers/runtime.git</param>
<param name="filename">kata-runtime</param>
<!--- versionformat defines the name of the tarball. -->
<param name="versionformat">@VERSION@+git.@HASH@</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">

View File

@ -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 <https://github.com/kata-containers/>
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@

View File

@ -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@.<B_CNT>
Version: @VERSION@
Release: @RELEASE@
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Summary : No detailed summary available

View File

@ -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}

View File

@ -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() {

View File

@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="url">https://github.com/kata-containers/shim.git</param>
<param name="filename">kata-shim</param>
<param name="versionformat">@VERSION@+git.@HASH@</param>
<param name="versionformat">@VERSION@</param>
<param name="revision">@HASH@</param>
</service>
<service name="recompress">

View File

@ -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 <https://github.com/kata-containers/>
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@

View File

@ -8,8 +8,8 @@
%undefine _missing_build_ids_terminate_build
Name: kata-shim
Version: @VERSION@+git.@HASH@
Release: @RELEASE@.<B_CNT>
Version: @VERSION@
Release: @RELEASE@
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0