diff --git a/recipes-containers/sloci-image/sloci-image-native_git.bb b/recipes-containers/sloci-image/sloci-image-native_git.bb index 56e8e0f1..b3b11bd9 100644 --- a/recipes-containers/sloci-image/sloci-image-native_git.bb +++ b/recipes-containers/sloci-image/sloci-image-native_git.bb @@ -1,7 +1,10 @@ SUMMARY = "A simple CLI tool for packing rootfs into a single-layer OCI image" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://git/LICENSE;md5=948cd8e59069fad992b0469af9ad7966" -SRC_URI = "git://github.com/jirutka/sloci-image.git" +LIC_FILES_CHKSUM = "file://LICENSE;md5=948cd8e59069fad992b0469af9ad7966" +SRC_URI = "git://github.com/jirutka/sloci-image.git \ + file://0001-sloci-image-fix-variant-quoting.patch \ + " + DEPENDS = "" @@ -10,13 +13,13 @@ PV = "v0.1.0+git${SRCPV}" inherit native -S = "${WORKDIR}" +S = "${WORKDIR}/git" do_compile() { : } do_install() { - cd ${S}/git + cd ${S} make PREFIX="${exec_prefix}" DESTDIR=${D} install } diff --git a/recipes-containers/sloci-image/sloci-image/0001-sloci-image-fix-variant-quoting.patch b/recipes-containers/sloci-image/sloci-image/0001-sloci-image-fix-variant-quoting.patch new file mode 100644 index 00000000..5cb35830 --- /dev/null +++ b/recipes-containers/sloci-image/sloci-image/0001-sloci-image-fix-variant-quoting.patch @@ -0,0 +1,42 @@ +From 55aebd87ee81f851d088beea8688e3e599c2bced Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Fri, 17 Jul 2020 14:40:12 -0400 +Subject: [PATCH] sloci-image: fix variant quoting + +Bash doesn't deal very well with the quoted "variant" in the +output of the oci-image-index. We can calculate the string at +the top of the function, and just use it as a whole to avoid +needing to figure out the quote escaping. + +No changes in the output, except a properly quoted "variant" +when a variant is defined. + +Signed-off-by: Bruce Ashfield +--- + sloci-image | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sloci-image b/sloci-image +index be8e79a..e0dc469 100755 +--- a/sloci-image ++++ b/sloci-image +@@ -298,6 +298,7 @@ oci_image_config() { + # $1: digest of the image manifest json (must be in blobs directory) + oci_image_index() { + local manifest_digest="$1" ++ local variant_string=" \"variant\": $(json_string "$CFG_ARCH_VARIANT")," + + cat <<-EOF + { +@@ -309,7 +310,7 @@ oci_image_index() { + "digest": "$manifest_digest", + "platform": { + "architecture": "$(oci_arch $CFG_ARCH)", +- ${CFG_ARCH_VARIANT:+"\"variant\": $(json_string "$CFG_ARCH_VARIANT"),"} ++ ${CFG_ARCH_VARIANT:+$variant_string} + "os": "$CFG_OS" + }, + "annotations": { +-- +2.19.1 +