Prioritize the Omarchy package repository
This commit is contained in:
1 parent
b83d3df084
commit
34016cfb27
5 files changed
+41
-11
No files matched your search
@@ -0,0 +1,30 @@
|
||||
echo "Prioritize the Omarchy package repository over Arch repositories"
|
||||
|
||||
# Move the existing section rather than replacing pacman.conf so channel URLs,
|
||||
# custom repositories, and administrator options survive the migration.
|
||||
pacman_config=$(mktemp)
|
||||
trap 'rm -f "$pacman_config"' EXIT
|
||||
|
||||
awk '
|
||||
/^[[:space:]]*\[[^]]+\]/ {
|
||||
section = $0
|
||||
sub(/^[[:space:]]*\[/, "", section)
|
||||
sub(/\].*$/, "", section)
|
||||
if (section != "options") repositories = 1
|
||||
}
|
||||
!repositories { prefix = prefix $0 "\n"; next }
|
||||
section == "omarchy" { omarchy = omarchy $0 "\n"; next }
|
||||
{ others = others $0 "\n" }
|
||||
END { printf "%s%s%s", prefix, omarchy, others }
|
||||
' /etc/pacman.conf >"$pacman_config"
|
||||
|
||||
if ! cmp -s /etc/pacman.conf "$pacman_config"; then
|
||||
sudo cp -a /etc/pacman.conf /etc/pacman.conf.bak
|
||||
sudo install -m 644 -o root -g root "$pacman_config" /etc/pacman.conf
|
||||
fi
|
||||
|
||||
# Migrations run after the upgrade. Explicitly select OPR now, including when
|
||||
# Arch's installed build has an equal or higher version number.
|
||||
if omarchy-pkg-present quickshell; then
|
||||
sudo pacman -S --noconfirm omarchy/quickshell
|
||||
fi
|
||||
Reference in new issue
Block a user