Skip to content

Commit

Permalink
Merge pull request #342 from cbgbt/multi-release
Browse files Browse the repository at this point in the history
rpm2img: use latest rpm release for inventory
  • Loading branch information
cbgbt committed Aug 2, 2024
2 parents a06d188 + a3a5d21 commit 361c3ea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion twoliter/embedded/rpm2img
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,19 @@ if [[ -n "${CORE_KIT_VERSION}" && -n "${CORE_KIT_VENDOR}" ]]; then
CORE_KIT_GIT_SHA="$(dnf --repofrompath \
core-kit,file://"${CORE_KIT_PATH}" \
--repo=core-kit repoquery \
--queryformat '%{Release}' 2>/dev/null | awk '/^1/{print $1}' | cut -d '.' -f 3)"
--queryformat '%{Buildtime} %{Release}' 2>/dev/null | \
sort -k 1,2 | \
awk -F '.' 'END {print $--NF}')"
if [[ -z "${CORE_KIT_GIT_SHA}" ]]; then
echo "Could not find Git sha for bottlerocket-core-kit" >&2
exit 1
fi
# If the Git sha contains whitespace, we may have accidentally grabbed multiple
if [[ "${CORE_KIT_GIT_SHA}" =~ [[:space:]] ]]; then
echo "Extracted invalid Git sha from bottlerocket-core-kit: '${CORE_KIT_GIT_SHA}'" >&2
exit 1
fi

# Query the bottlerocket-core-kit repo of RPMs for all package names.
CORE_KIT_INVENTORY_QUERY="%{NAME}"
# shellcheck disable=SC2312 # Array is validated elsewhere.
Expand Down

0 comments on commit 361c3ea

Please sign in to comment.