Skip to content

Commit

Permalink
support for LSR_EXTRA_PKGS
Browse files Browse the repository at this point in the history
use LSR_EXTRA_PKGS to pass in extra packages for ostree image builds
  • Loading branch information
richm committed Mar 8, 2024
1 parent df5947b commit 96631a4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/tox_lsr/test_scripts/build_ostree_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ fi
get_distro_ver "$image_name"

if [ -f .ostree/get_ostree_data.sh ]; then
PKGS_JSON="$(.ostree/get_ostree_data.sh packages testing "$lsr_distro_ver" json)"
# read -d "" causes read to exit 1
read -r -d "" -a pkgs <<< "$(.ostree/get_ostree_data.sh packages testing "$lsr_distro_ver" raw)" || :
read -r -a extra_pkgs <<< "${LSR_EXTRA_PKGS:-}"
PKGS_JSON="["
comma=""
for pkg in "${pkgs[@]}" "${extra_pkgs[@]}"; do
PKGS_JSON="${PKGS_JSON}${comma}\"$pkg\""
comma=","
done
PKGS_JSON="${PKGS_JSON}]"
fi

if [ ! -f "$OSBUILD_DIR/distro/${osbuild_distro_ver}.ipp.yml" ]; then
Expand All @@ -56,5 +65,5 @@ fi
make -C "$OSBUILD_DIR" BUILDDIR="$CACHE_DIR" OUTPUTDIR="$IMAGE_DIR" DESTDIR="$IMAGE_DIR" \
"${osbuild_distro_ver}-qemu-lsr-ostree.x86_64.qcow2" \
${extra_distro:-} ${use_vm:-} \
DEFINES=extra_rpms="${PKGS_JSON}"
DEFINES=extra_rpms="${PKGS_JSON:-}"
mv "$IMAGE_DIR/${osbuild_distro_ver}-qemu-lsr-ostree.x86_64.qcow2" "$IMAGE_FILE"

0 comments on commit 96631a4

Please sign in to comment.