Skip to content
Merged
Show file tree
Hide file tree
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
55 changes: 50 additions & 5 deletions build_files/base/10-beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,60 @@

echo "::group:: ===$(basename "$0")==="

set -eoux pipefail

if ! jq -e '.["image-tag"] | test("beta")' /usr/share/ublue-os/image-info.json >/dev/null; then
echo "Skipping beta for non-beta image"
exit 0
fi

# install sudo-rs
dnf5 -y install sudo-rs
ln -sf /usr/bin/su-rs /usr/bin/su
ln -sf /usr/bin/sudo-rs /usr/bin/sudo
ln -sf /usr/bin/visudo-rs /usr/bin/visudo
# KDE 6.5
log() {
echo -e "\n\033[1;34m==> $1\033[0m\n"
}

error() {
echo -e "\n\033[1;31mERROR: $1\033[0m\n" >&2
}

COPRS=(
"@kdesig/kde-final"
)

ENABLED_REPOS=()

# Enable COPRs and set priority
for copr in "${COPRS[@]}"; do
log "Enabling COPR: $copr"
if ! dnf5 -y copr enable "$copr"; then
error "Failed to enable COPR: $copr"
continue
fi

copr_sanitized="${copr//@/group_}"
repo_id="copr:copr.fedorainfracloud.org:${copr_sanitized////:}"
log "Setting priority=1 for $repo_id"
if ! dnf5 -y config-manager setopt "${repo_id}.priority=1"; then
error "Failed to set priority for $repo_id"
continue
fi

ENABLED_REPOS+=("--repo=$repo_id")
done

# Upgrade all installed packages from the COPR repos
if (( ${#ENABLED_REPOS[@]} > 0 )); then
log "Upgrading packages from enabled COPRs"
if ! dnf5 upgrade -y "${ENABLED_REPOS[@]}" --allowerasing; then
error "Upgrade failed"
exit 1
fi
else
log "No COPRs were successfully enabled. Nothing to upgrade."
fi

dnf5 -y remove plasma-discover-kns

dnf5 -y copr disable @kdesig/kde-final

echo "::endgroup::"
3 changes: 3 additions & 0 deletions build_files/shared/build-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ echo "::endgroup::"
# Make HWE changes
/ctx/build_files/base/09-hwe-additions.sh

# Beta
/ctx/build_files/base/10-beta.sh

# Bazaar workarounds
/ctx/build_files/base/11-bazaar.sh

Expand Down