From 61fba753b82c9bcf4f3bfd32cf8b1ad14f866d766e1fa9118556fc1992ffcf21 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 7 Nov 2024 09:27:14 +0000 Subject: [PATCH] - don't replace %BASE_DIGEST% with empty string when not available OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-kiwi_metainfo_helper?expand=0&rev=43 --- kiwi_metainfo_helper | 11 +++++++---- obs-service-kiwi_metainfo_helper.changes | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/kiwi_metainfo_helper b/kiwi_metainfo_helper index 06101d2..21dfc65 100644 --- a/kiwi_metainfo_helper +++ b/kiwi_metainfo_helper @@ -132,10 +132,13 @@ fi if [ -f containers/annotation ]; then REGISTRY_REFNAME="$(sed -n 's/.*\([^<]*\)<.*/\1/p' < containers/annotation)" REGISTRY_DIGEST="$(sed -n 's/.*\(.*\)<.*/\1/p' < containers/annotation)" - sed -i"" \ - -e "s#%BASE_REFNAME%#${REGISTRY_REFNAME}#g" \ - -e "s#%BASE_DIGEST%#${REGISTRY_DIGEST}#g" \ - "${files[@]}" + + if [ -n "$REGISTRY_DIGEST" ]; then + sed -i"" \ + -e "s#%BASE_REFNAME%#${REGISTRY_REFNAME}#g" \ + -e "s#%BASE_DIGEST%#${REGISTRY_DIGEST}#g" \ + "${files[@]}" + fi fi sed -i"" \ diff --git a/obs-service-kiwi_metainfo_helper.changes b/obs-service-kiwi_metainfo_helper.changes index f56fa9d..93d98e0 100644 --- a/obs-service-kiwi_metainfo_helper.changes +++ b/obs-service-kiwi_metainfo_helper.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Sep 30 14:13:12 UTC 2024 - Dirk Müller + +- don't replace %BASE_DIGEST% with empty string when not available + ------------------------------------------------------------------- Wed Sep 25 09:01:19 UTC 2024 - Fabian Vogt