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/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 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