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
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# To put it into use, remove .sample from this file name.
|
||||
|
||||
# Example: add an Include line above [core].
|
||||
# Example: add an Include line above the first repository, [omarchy].
|
||||
# Maintain the repo entries in /etc/pacman.d/custom-repos.conf yourself.
|
||||
|
||||
CONF=/etc/pacman.conf
|
||||
@@ -21,4 +21,4 @@ MARKER="Include = $SNIPPET"
|
||||
[[ -r $SNIPPET ]] || exit 0
|
||||
grep -qxF "$MARKER" "$CONF" && exit 0
|
||||
|
||||
sudo sed -i "0,/^\[core\]/s||$MARKER\n\n[core]|" "$CONF"
|
||||
sudo sed -i "0,/^\[omarchy\]/s||$MARKER\n\n[omarchy]|" "$CONF"
|
||||
@@ -16,6 +16,9 @@ SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
# pacman searches repositories in the order defined here
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/edge/$arch
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
@@ -25,9 +28,6 @@ Include = /etc/pacman.d/mirrorlist
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/edge/$arch
|
||||
|
||||
# Repositories for debug symbol packages.
|
||||
#
|
||||
# These upstream debug packages will only match core/extra/multilib packages from the Omarchy edge
|
||||
|
||||
@@ -16,6 +16,9 @@ SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
# pacman searches repositories in the order defined here
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/rc/$arch
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
@@ -24,6 +27,3 @@ Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/rc/$arch
|
||||
@@ -16,6 +16,9 @@ SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
# pacman searches repositories in the order defined here
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/stable/$arch
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
@@ -24,6 +27,3 @@ Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[multilib]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[omarchy]
|
||||
Server = https://pkgs.omarchy.org/stable/$arch
|
||||
@@ -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