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 d4e8ec5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
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
31 changes: 31 additions & 0 deletions config/scripts/ublue-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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"
}

# 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

0 comments on commit d4e8ec5

Please sign in to comment.