From 0585a15848b66c181da6072472de0dafd01b1766 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 5 Nov 2018 00:43:24 +0000 Subject: [PATCH] build: Use rpm-ostree compose --print-only to expand ${basearch} This way we can use `${basearch}` in the ref. Also the way we were doing it before didn't work with treefile inheritance. Reinstates support for https://github.com/coreos/fedora-coreos-config/pull/24 --- src/cmdlib.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 8fe2bd4bdc..e5571b652c 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -61,10 +61,14 @@ prepare_build() { echo "Using manifest: ${manifest}" + manifest_tmp_json=${workdir}/tmp/manifest.json + rpm-ostree compose tree --repo=repo --print-only ${manifest} > ${manifest_tmp_json} + # Abuse the rojig/name as the name of the VM images - export name=$(manifest_get '["rojig"]["name"]') + export name=$(jq -r '.rojig.name' < ${manifest_tmp_json}) # TODO - allow this to be unset - export ref=$(manifest_get '["ref"]') + export ref=$(jq -r '.ref' < ${manifest_tmp_json}) + rm -f ${manifest_tmp_json} # This dir is no longer used rm builds/work -rf @@ -90,11 +94,6 @@ prepare_build() { export TMPDIR=$(pwd)/tmp } -# We'll rewrite this in a real language I promise -manifest_get() { - python3 -c 'import sys,yaml; print(yaml.safe_load(open(sys.argv[1]))'"$1"')' "${manifest}" -} - runcompose() { local treecompose_args="" if ! grep -q '^# disable-unified-core' "${manifest}"; then