summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD20
-rw-r--r--reflector-nomirrorlist.install17
2 files changed, 37 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000..0fc4a364
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,20 @@
+# Maintainer: Erich Eckner <arch at eckner dot net>
+# Contributor: Hans-Nikolai Viessmann <hans AT viess DOT mn>
+pkgname=reflector-nomirrorlist
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Use reflector-generated mirrorlist by default"
+arch=('any')
+url="https://aur.archlinux.org/packages/reflector-nomirrorlist/"
+license=('unknown')
+depends=('pacman' 'reflector')
+provides=('pacman-mirrorlist')
+conflicts=('pacman-mirrorlist')
+install="${pkgname}.install"
+backup=('etc/pacman.d/mirrorlist')
+source=()
+
+package() {
+ # we do nothing, everything is in .install
+ :
+}
diff --git a/reflector-nomirrorlist.install b/reflector-nomirrorlist.install
new file mode 100644
index 00000000..a30a2e0b
--- /dev/null
+++ b/reflector-nomirrorlist.install
@@ -0,0 +1,17 @@
+post_install() {
+ echo "==> generating mirrorlist using config file"
+ /usr/bin/reflector @/etc/xdg/reflector/reflector.conf
+
+ # check to make sure reflector timer is activated
+ if [[ ! -L "/etc/systemd/system/timers.target.wants/reflector.timer" ]]; then
+ echo "==$ it is suggested that you activate the reflector systemd timer"
+ echo "==$ to periodically update the mirrorlist! Do the following:"
+ echo ""
+ echo " sudo systemctl enable --now reflector.timer"
+ echo ""
+ fi
+}
+
+post_update() {
+ post_install
+}