Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix: fix problem with installing `topgrade' package
Browse files Browse the repository at this point in the history
  • Loading branch information
c0deplayer committed Jan 27, 2024
1 parent 4767b9c commit c548fd4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 0 additions & 1 deletion config/common_modules/bling.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
type: bling
install:
- 1password
- ublue-update
- dconf-update-service
1 change: 1 addition & 0 deletions config/common_modules/scripts.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
type: script
scripts:
- ublue-update.sh
- system76-scheduler.sh
- brave-browser.sh
- systemwide-themes.sh
Expand Down
38 changes: 38 additions & 0 deletions config/scripts/ublue-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# Tell build process to exit if there are any errors.
set -euo pipefail

get_config_value() {
sed -n '/^'"$1"'=/{s/'"$1"'=//;p}' "$2"
}

set_config_value() {
CURRENT=$(get_config_value "$1" "$3")
sed -i 's/'"$1"'='"$CURRENT"'/'"$1"'='"$2"'/g' "$3"
}

# Fetch bling COPR
REPO="https://copr.fedorainfracloud.org/coprs/ublue-os/bling/repo/fedora-${OS_VERSION}/ublue-os-bling-fedora-${OS_VERSION}.repo"
wget "${REPO//[$'\t\r\n ']/}" -P "/etc/yum.repos.d/"

# Check if ublue-os-update-services rpm is installed, these services conflict with ublue-update
if rpm -q ublue-os-update-services >/dev/null; then
rpm-ostree override remove ublue-os-update-services
fi

# Change the conflicting update policy for rpm-ostreed
RPM_OSTREE_CONFIG="/etc/rpm-ostreed.conf"

if [[ -f "$RPM_OSTREE_CONFIG" ]]; then
if [[ $(get_config_value "AutomaticUpdatePolicy" "$RPM_OSTREE_CONFIG") == "stage" ]]; then
set_config_value "AutomaticUpdatePolicy" "none" "$RPM_OSTREE_CONFIG"
fi
fi
systemctl disable rpm-ostreed-automatic.timer
# topgrade is REQUIRED by ublue-update to install
pip install --prefix=/usr topgrade
rpm-ostree install ublue-update

# Remove bling COPR
rm /etc/yum.repos.d/ublue-os-bling-fedora-*.repo
2 changes: 1 addition & 1 deletion config/silverflow-nvidia-39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ modules:
- from-file: common_modules/yafti.yml
- from-file: common_modules/fonts.yml
- from-file: common_modules/bling.yml
- from-file: common_modules/scripts.yml
- from-file: common_modules/systemd.yml
- from-file: common_modules/image-cleaner.yml
- from-file: common_modules/scripts.yml

0 comments on commit c548fd4

Please sign in to comment.