summaryrefslogtreecommitdiff
path: root/raveos-mirrorlist
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-mirrorlist')
-rw-r--r--raveos-mirrorlist/PKGBUILD12
-rw-r--r--raveos-mirrorlist/raveos-mirrorlist.install45
2 files changed, 46 insertions, 11 deletions
diff --git a/raveos-mirrorlist/PKGBUILD b/raveos-mirrorlist/PKGBUILD
index 50a2db7..147545b 100644
--- a/raveos-mirrorlist/PKGBUILD
+++ b/raveos-mirrorlist/PKGBUILD
@@ -3,15 +3,15 @@
# raveos-mirrorlist
# ------------------
# A raveos-core-repo elsodleges + tartalek (GitHub Releases) szerverlistaja.
-# Telepiteskor/frissiteskor a .install script automatikusan atallitja a
-# meglevo /etc/pacman.conf [raveos-core-repo] szekciojat inline Server=
-# sorrol Include=-ra, hogy a mar telepitett rendszerek is megkapjak a
-# GitHub tartalek mirrort - de csak akkor, ha a fajl meg a regi, eredeti
-# allapotban van (kezzel modositott configot nem nyul).
+# Telepiteskor/frissiteskor a .install script:
+# - atallitja a meglevo [raveos-core-repo] szekciot Include=-ra (GitHub tartalek),
+# - athelyezi a [raveos-core-repo] szekciot a [core] ELE (a pacman az ELSO
+# repot valasztja azonos nevu csomagra, verziotol fuggetlenul),
+# - torli a gnome csomagokat az IgnorePkg-bol (a repo-sorrend mar nyer).
pkgname=raveos-mirrorlist
pkgver=1.0.0
-pkgrel=4
+pkgrel=5
pkgdesc="RaveOS core-repo mirrorlist (elsodleges + GitHub tartalek szerver)"
arch=('any')
url="https://git.rp1.hu/RaveOS"
diff --git a/raveos-mirrorlist/raveos-mirrorlist.install b/raveos-mirrorlist/raveos-mirrorlist.install
index ce67191..c44a35e 100644
--- a/raveos-mirrorlist/raveos-mirrorlist.install
+++ b/raveos-mirrorlist/raveos-mirrorlist.install
@@ -10,17 +10,52 @@ _patch_pacman_conf() {
conf=/etc/pacman.conf
[ -f "$conf" ] || return 0
- # Csak akkor nyulunk hozza, ha pontosan a regi, egysoros Server= allapotot
- # talaljuk (meg nincs Include-ra atallitva) - igy nem irunk felul kezzel
- # modositott konfigot.
+ # 1) Regi, egysoros Server= allapot -> Include= (GitHub tartalek szerverrel).
if grep -qF 'Server = https://page.rp1.hu/x86_64/' "$conf" \
&& ! grep -qF 'Include = /etc/pacman.d/raveos-core-mirrorlist' "$conf"; then
sed -i \
'\|^Server = https://page.rp1.hu/x86_64/$|c\Include = /etc/pacman.d/raveos-core-mirrorlist' \
"$conf"
- # Ha a masodlagos Server sor is mar ott volt kulon sorban, azt kivesszuk,
- # mert most mar az Include fajl adja mindket szervert.
sed -i '\|^Server = https://github.com/rave-os/RaveOS-core-repo-mirror/releases/download/core-repo-x86_64/$|d' "$conf"
echo "raveos-mirrorlist: /etc/pacman.conf frissitve (raveos-core-repo -> Include mirrorlist, GitHub tartalek szerverrel)"
fi
+
+ # 2) [raveos-core-repo] szekcio athelyezese a [core] ELE.
+ # A pacman az ELSO repot valasztja azonos nevu csomagra, verziotol
+ # fuggetlenul - ha a raveos repo hatul van, az official csomagok nyernek.
+ core_line=$(grep -n '^\[core\]' "$conf" | head -n1 | cut -d: -f1)
+ rav_line=$(grep -n '^\[raveos-core-repo\]' "$conf" | head -n1 | cut -d: -f1)
+ if [ -n "$core_line" ] && [ -n "$rav_line" ] && [ "$rav_line" -gt "$core_line" ]; then
+ [ -f "$conf.raveos-bak" ] || cp -f "$conf" "$conf.raveos-bak" 2>/dev/null || true
+ if awk '
+ NR==FNR {
+ if ($0 ~ /^\[raveos-core-repo\]/) grab=1
+ else if (grab && $0 ~ /^\[/) grab=0
+ if (grab) block = block $0 "\n"
+ next
+ }
+ {
+ if (skip) {
+ if ($0 ~ /^\[/) { skip=0; print; next }
+ next
+ }
+ if ($0 ~ /^\[raveos-core-repo\]/) { skip=1; next }
+ if ($0 ~ /^\[core\]/ && !moved) { printf "%s", block; moved=1 }
+ print
+ }
+ ' "$conf" "$conf" > "$conf.raveos-new" && mv -f "$conf.raveos-new" "$conf"; then
+ echo "raveos-mirrorlist: [raveos-core-repo] athelyezve a [core] ele (repo-sorrend javitas)"
+ else
+ rm -f "$conf.raveos-new"
+ echo "raveos-mirrorlist: FIGYELEM - a [raveos-core-repo] athelyezes nem sikerult"
+ fi
+ fi
+
+ # 3) IgnorePkg: a gnome lista torlese (a repo-sorrend mar nyer; az IgnorePkg
+ # blokkolna a sajat frissiteseinket). A kernel pin meghagyva.
+ if grep -q '^IgnorePkg' "$conf"; then
+ sed -i 's/^IgnorePkg.*/IgnorePkg = linux-cachyos linux-cachyos-headers/' "$conf"
+ fi
+
+ echo "raveos-mirrorlist: kesz - futtass meg egy 'pacman -Syu'-t a GNOME 50 pin ervenyesitesehez"
}