diff --git a/build.sh b/build.sh index 9111daed..df2b3fb7 100755 --- a/build.sh +++ b/build.sh @@ -6,23 +6,23 @@ RELEASE="$(rpm -E %fedora)" PACKAGE_LIST="up" FEDORA_MAJOR_VERSION=$RELEASE -# build list of all packages requested for inclusion +# Build list of all packages requested for inclusion INCLUDED_PACKAGES=($(jq -r "[(.all.include | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \ (select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \ | sort | unique[]" /tmp/packages.json)) -# build list of all packages requested for override +# Build list of all packages requested for override CONFLICTED_PACKAGES=($(jq -r "[(.all.conflictedpackages | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \ (select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".conflictedpackages | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \ | sort | unique[]" /tmp/packages.json)) -# build list of all packages requested for exclusion +# Build list of all packages requested for exclusion EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \ (select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \ | sort | unique[]" /tmp/packages.json)) -# ensure exclusion list only contains packages already present on image +# Ensure exclusion list only contains packages already present on image if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) fi @@ -36,12 +36,12 @@ if [[ "${#CONFLICTED_PACKAGES[@]}" -gt 0 ]]; then done fi -# simple case to install where no packages need excluding +# Simple case to install where no packages need excluding if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then rpm-ostree install \ ${INCLUDED_PACKAGES[@]} -# install/excluded packages both at same time +# Install/excluded packages both at same time elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then rpm-ostree override remove \ ${EXCLUDED_PACKAGES[@]} \ @@ -49,18 +49,14 @@ elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; else echo "No packages to install." - fi # Install conflicted packages to resolve dependencies if [[ "${#CONFLICTED_PACKAGES[@]}" -gt 0 ]]; then - rpm-ostree override replace \ - --experimental \ - --from repo=updates \ - ${CONFLICTED_PACKAGES[@]} || true + rpm-ostree install ${CONFLICTED_PACKAGES[@]} fi -# check if any excluded packages are still present +# Check if any excluded packages are still present # (this can happen if an included package pulls in a dependency) EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \ (select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \ @@ -70,8 +66,8 @@ if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) fi -# remove any exluded packages which are still present on image +# Remove any excluded packages which are still present on image if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then rpm-ostree override remove \ ${EXCLUDED_PACKAGES[@]} -fi \ No newline at end of file +fi diff --git a/packages.json b/packages.json index d9435f1e..e5e931ad 100644 --- a/packages.json +++ b/packages.json @@ -10,7 +10,8 @@ }, "conflictedpackages": { "up": [ - "steam" + "steam", + "libvirt" ] }, "exclude": {