summaryrefslogtreecommitdiff
path: root/build_files
diff options
context:
space:
mode:
Diffstat (limited to 'build_files')
-rwxr-xr-xbuild_files/patch-bazzite-rollback-helper.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/build_files/patch-bazzite-rollback-helper.sh b/build_files/patch-bazzite-rollback-helper.sh
index d5b3f21..eb4341f 100755
--- a/build_files/patch-bazzite-rollback-helper.sh
+++ b/build_files/patch-bazzite-rollback-helper.sh
@@ -17,7 +17,7 @@ patched_file=$(mktemp)
awk '
/^signing_scheme\(\) \{/ {
print "signing_scheme() {"
- print " local current=$(rpm-ostree status -b --json | jq -r '\''.deployments[] | select(.booted == true) | .["container-image-reference"]'\'')"
+ print " local current=$(rpm-ostree status -b --json | jq -r '\''.deployments | map(select(.booted == true)) | first | .["container-image-reference"] // empty'\'')"
print " local scheme=\"ostree-unverified-registry\""
print " [[ \"$current\" == *\"ostree-image-signed\"* ]] && scheme=\"ostree-image-signed\""
print " echo \"$scheme:docker://\""
@@ -25,7 +25,11 @@ awk '
print ""
print "current_image_prefix() {"
print " local current"
- print " current=$(rpm-ostree status -b --json | jq -r '\''.deployments[] | select(.booted == true) | .["container-image-reference"]'\'')"
+ print " current=$(rpm-ostree status -b --json | jq -r '\''.deployments | map(select(.booted == true)) | first | .["container-image-reference"] // empty'\'')"
+ print " if [[ -z \"$current\" ]]; then"
+ print " echo \"Unable to determine the current booted image reference.\" >&2"
+ print " return 1"
+ print " fi"
print " current=\"${current#ostree-image-signed:}\""
print " current=\"${current#ostree-unverified-registry:}\""
print " current=\"${current#docker://}\""