Skip to content

Commit

Permalink
Merge pull request #6 from LeTabouret/fix-pipeline-build-steam
Browse files Browse the repository at this point in the history
Fix build failling.
  • Loading branch information
LeTabouret authored May 26, 2024
2 parents b997b2f + 3777a96 commit 085915c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
40 changes: 23 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ INCLUDED_PACKAGES=($(jq -r "[(.all.include | (select(.\"$PACKAGE_LIST\" != null)
| sort | unique[]" /tmp/packages.json))

# 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\")[])] \
CONFLICTED_PACKAGES=($(jq -r "[(.all.conflictedpackagesupdates | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".conflictedpackagesupdates | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \
| sort | unique[]" /tmp/packages.json))

# Build list of all packages requested for override in base
CONFLICTED_PACKAGES_BASE=($(jq -r "[(.all.conflictedpackagesbase | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".conflictedpackagesbase | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \
| sort | unique[]" /tmp/packages.json))

# Build list of all packages requested for exclusion
Expand All @@ -22,18 +27,24 @@ EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null)
| sort | unique[]" /tmp/packages.json))


# Ensure exclusion list only contains packages already present on image
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]}))
# Install packages that are in base install and may generate conflicts
if [[ "${#CONFLICTED_PACKAGES_BASE[@]}" -gt 0 ]]; then
rpm-ostree install \
${CONFLICTED_PACKAGES_BASE[@]}
fi

# Remove potentially conflicting packages if they are installed
# Install conflicted packages to resolve dependencies
if [[ "${#CONFLICTED_PACKAGES[@]}" -gt 0 ]]; then
for pkg in "${CONFLICTED_PACKAGES[@]}"; do
if rpm -q $pkg &>/dev/null; then
rpm-ostree override remove $pkg
fi
done
rpm-ostree override replace \
--experimental \
--from repo=updates \
${CONFLICTED_PACKAGES[@]} \
|| true
fi

# 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

# Simple case to install where no packages need excluding
Expand All @@ -51,11 +62,6 @@ else
echo "No packages to install."
fi

# Install conflicted packages to resolve dependencies
if [[ "${#CONFLICTED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree install ${CONFLICTED_PACKAGES[@]}
fi

# 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\")[]), \
Expand All @@ -70,4 +76,4 @@ fi
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
${EXCLUDED_PACKAGES[@]}
fi
fi
18 changes: 14 additions & 4 deletions packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,25 @@
"include": {
"up": [
"virt-manager",
"libvirt",
"qemu-kvm",
"mesa-vulkan-drivers",
"gnome-shell-extension-pop-shell"
"gnome-shell-extension-pop-shell",
"steam"
]
},
"conflictedpackages": {
"conflictedpackagesbase": {
"up": [
"steam",
"libvirt"
"libatomic.i686",
"glibc.i686",
"libgcc.i686",
"libstdc++.i686"
]
},
"conflictedpackagesupdates": {
"up": [
"vulkan-loader",
"gtk2.i686"
]
},
"exclude": {
Expand Down

0 comments on commit 085915c

Please sign in to comment.