This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
forked from blue-build/legacy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix problem with installing `topgrade' package
- Loading branch information
1 parent
4767b9c
commit d4e8ec5
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
type: bling | ||
install: | ||
- 1password | ||
- ublue-update | ||
- dconf-update-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |