Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm2img: use latest rpm release for inventory #342

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

# 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
Loading