fix: tweak build.sh handling of package.json (#525)

This commit is contained in:
Benjamin Sherman 2023-09-25 00:08:24 -05:00 committed by GitHub
parent fc90d3ab9f
commit f316e00eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,24 +12,18 @@ EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null)
| sort | unique[]" /tmp/packages.json))
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree install \
${INCLUDED_PACKAGES[@]}
else
echo "No packages to install."
fi
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]}))
fi
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then
rpm-ostree install \
${INCLUDED_PACKAGES[@]}
elif [[ "${#INCLUDED_PACKAGES[@]}" -eq 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
${EXCLUDED_PACKAGES[@]}
elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
${EXCLUDED_PACKAGES[@]} \
$(printf -- "--install=%s " ${INCLUDED_PACKAGES[@]})
else
echo "No packages to install."
fi