From e9cd211f2813f502d1d8f6d13beab109b47d8f8795f51067d38e01a1f0dea213 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Mon, 24 Jan 2022 15:02:01 +0000 Subject: [PATCH 1/2] Accepting request 948424 from home:fcrozat:branches:openSUSE:Tools - Generate OS_VERSION based on os-release VERSION (bsc#1195061). - Bump version to 0.5 OBS-URL: https://build.opensuse.org/request/show/948424 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-kiwi_metainfo_helper?expand=0&rev=27 --- README | 1 + kiwi_metainfo_helper | 2 ++ obs-service-kiwi_metainfo_helper.changes | 6 ++++++ test.sh | 2 ++ 4 files changed, 11 insertions(+) diff --git a/README b/README index b6525c3..27b822e 100644 --- a/README +++ b/README @@ -12,6 +12,7 @@ build-specific metainfo. | %SOURCEURL% | Source url for container recipe (IBS) | https://sources.suse.com/SUSE:SLE-15:Update:CR/sles15-image/2951b67133dd6384cacb28203174e030/ | | %RELEASE% | The OBS release number (.) | 4.2 | | %BUILDTIME% | $(date --utc +%FT%T.%NZ) | 2018-10-30T09:19:02.074934628Z | +| %OS_VERSION% | VERSION in the os-release file | 15 | | %OS_VERSION_ID% | VERSION_ID in the os-release file | 15 | | %OS_VERSION_ID_SP% | Like VERSION_ID, but with SP (SLE only) | 15.0 | | %OS_PRETTY_NAME% | PRETTY_NAME in the os-release file | SUSE Linux Enterprise Server 15 SP3 (Snapshot16) | diff --git a/kiwi_metainfo_helper b/kiwi_metainfo_helper index 9f0e1ac..ff2be81 100644 --- a/kiwi_metainfo_helper +++ b/kiwi_metainfo_helper @@ -77,6 +77,7 @@ if grep -q "%OS_" ${files[@]}; then [ -f "${tempdir}/usr/lib/os-release" ] && . "${tempdir}/usr/lib/os-release" [ -f "${tempdir}/etc/os-release" ] && . "${tempdir}/etc/os-release" + VERSION="${VERSION:-}" # Special case for SLE X "SP 0", make sure it has .0 VERSION_ID_SP="${VERSION_ID}" [[ "${VERSION_ID_SP%}" == *"."* ]] || VERSION_ID_SP="${VERSION_ID}.0" @@ -118,6 +119,7 @@ if grep -q "%OS_" ${files[@]}; then -e "s/%OS_PRETTY_NAME_DASHED%/${PRETTY_NAME_DASHED}/g" \ -e "s/%OS_PRETTY_NAME_BEFORE_PAREN%/${PRETTY_NAME_BEFORE_PAREN}/g" \ -e "s/%OS_PRETTY_NAME_BEFORE_PAREN_DASHED%/${PRETTY_NAME_BEFORE_PAREN_DASHED}/g" \ + -e "s/%OS_VERSION%/${VERSION}/g" \ -e "s/%OS_VERSION_ID_SP%/${VERSION_ID_SP}/g" "${files[@]}" fi diff --git a/obs-service-kiwi_metainfo_helper.changes b/obs-service-kiwi_metainfo_helper.changes index d74b21a..e83e870 100644 --- a/obs-service-kiwi_metainfo_helper.changes +++ b/obs-service-kiwi_metainfo_helper.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 24 09:36:17 UTC 2022 - Frederic Crozat + +- Generate OS_VERSION based on os-release VERSION (bsc#1195061). +- Bump version to 0.5 + ------------------------------------------------------------------- Mon Jan 17 09:57:02 UTC 2022 - Fabian Vogt diff --git a/test.sh b/test.sh index a1e0e1e..98aa3b1 100644 --- a/test.sh +++ b/test.sh @@ -33,6 +33,7 @@ DISTURL=%DISTURL% SOURCEURL=%SOURCEURL% RELEASE=%RELEASE% BUILDTIME=%BUILDTIME% +OS_VERSION=%OS_VERSION% OS_VERSION_ID=%OS_VERSION_ID% OS_VERSION_ID_SP=%OS_VERSION_ID_SP% OS_PRETTY_NAME=%OS_PRETTY_NAME% @@ -49,6 +50,7 @@ DISTURL=obs://build.opensuse.org/openSUSE:Factory/images/0f40c57dd619e1dff9e5129 SOURCEURL=https://build.opensuse.org/package/show/openSUSE:Factory/opensuse-tumbleweed-image?rev=0f40c57dd619e1dff9e512949b6bca09 RELEASE=4.2 BUILDTIME=2018-10-30T09:19:02.074934628Z +OS_VERSION=15-SP4 OS_VERSION_ID=15.4 OS_VERSION_ID_SP=15.4 OS_PRETTY_NAME=SUSE Linux Enterprise Server 15 SP4 From 740a3d449d9b01ac04284ceba4eb0461e5501714facbca59218a56b30c14d8de Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 25 Jan 2022 09:39:38 +0000 Subject: [PATCH 2/2] Actually bump the version OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-kiwi_metainfo_helper?expand=0&rev=28 --- obs-service-kiwi_metainfo_helper.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs-service-kiwi_metainfo_helper.spec b/obs-service-kiwi_metainfo_helper.spec index 1f2f336..b7f72e2 100644 --- a/obs-service-kiwi_metainfo_helper.spec +++ b/obs-service-kiwi_metainfo_helper.spec @@ -17,7 +17,7 @@ Name: obs-service-kiwi_metainfo_helper -Version: 0.4 +Version: 0.5 Release: 0 Summary: Service for substituting various variables in build recipes License: GPL-2.0-or-later