summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/sloci-image/sloci-image-native_git.bb11
-rw-r--r--recipes-containers/sloci-image/sloci-image/0001-sloci-image-fix-variant-quoting.patch42
2 files changed, 49 insertions, 4 deletions
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 @@
1SUMMARY = "A simple CLI tool for packing rootfs into a single-layer OCI image" 1SUMMARY = "A simple CLI tool for packing rootfs into a single-layer OCI image"
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://git/LICENSE;md5=948cd8e59069fad992b0469af9ad7966" 3LIC_FILES_CHKSUM = "file://LICENSE;md5=948cd8e59069fad992b0469af9ad7966"
4SRC_URI = "git://github.com/jirutka/sloci-image.git" 4SRC_URI = "git://github.com/jirutka/sloci-image.git \
5 file://0001-sloci-image-fix-variant-quoting.patch \
6 "
7
5 8
6DEPENDS = "" 9DEPENDS = ""
7 10
@@ -10,13 +13,13 @@ PV = "v0.1.0+git${SRCPV}"
10 13
11inherit native 14inherit native
12 15
13S = "${WORKDIR}" 16S = "${WORKDIR}/git"
14 17
15do_compile() { 18do_compile() {
16 : 19 :
17} 20}
18 21
19do_install() { 22do_install() {
20 cd ${S}/git 23 cd ${S}
21 make PREFIX="${exec_prefix}" DESTDIR=${D} install 24 make PREFIX="${exec_prefix}" DESTDIR=${D} install
22} 25}
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 @@
1From 55aebd87ee81f851d088beea8688e3e599c2bced Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Fri, 17 Jul 2020 14:40:12 -0400
4Subject: [PATCH] sloci-image: fix variant quoting
5
6Bash doesn't deal very well with the quoted "variant" in the
7output of the oci-image-index. We can calculate the string at
8the top of the function, and just use it as a whole to avoid
9needing to figure out the quote escaping.
10
11No changes in the output, except a properly quoted "variant"
12when a variant is defined.
13
14Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
15---
16 sloci-image | 3 ++-
17 1 file changed, 2 insertions(+), 1 deletion(-)
18
19diff --git a/sloci-image b/sloci-image
20index be8e79a..e0dc469 100755
21--- a/sloci-image
22+++ b/sloci-image
23@@ -298,6 +298,7 @@ oci_image_config() {
24 # $1: digest of the image manifest json (must be in blobs directory)
25 oci_image_index() {
26 local manifest_digest="$1"
27+ local variant_string=" \"variant\": $(json_string "$CFG_ARCH_VARIANT"),"
28
29 cat <<-EOF
30 {
31@@ -309,7 +310,7 @@ oci_image_index() {
32 "digest": "$manifest_digest",
33 "platform": {
34 "architecture": "$(oci_arch $CFG_ARCH)",
35- ${CFG_ARCH_VARIANT:+"\"variant\": $(json_string "$CFG_ARCH_VARIANT"),"}
36+ ${CFG_ARCH_VARIANT:+$variant_string}
37 "os": "$CFG_OS"
38 },
39 "annotations": {
40--
412.19.1
42