summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-04-28 21:46:23 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-04-28 21:46:23 -0700
commit448bf5d0dededcbcc24c82318eb9e5f05ba10eb8 (patch)
treed418b1de481dc951eb5e7346ac03c5d717a41f4d
parentUpdate json path (diff)
downloadgentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.tar.gz
gentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.tar.bz2
gentoo-mirrorstats-448bf5d0dededcbcc24c82318eb9e5f05ba10eb8.zip
snapshots: prepare for common mirmon runner code via specific mirrors
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--distfiles_mirrors/g.mirrors.extra1
-rw-r--r--experimental_mirrors/g.mirrors.extra1
-rwxr-xr-xmirmon-snapshots.sh9
-rw-r--r--releases_mirrors/g.mirrors.extra1
-rw-r--r--snapshots_mirrors/g.mirrors.extra1
5 files changed, 12 insertions, 1 deletions
diff --git a/distfiles_mirrors/g.mirrors.extra b/distfiles_mirrors/g.mirrors.extra
new file mode 100644
index 0000000..75c3d12
--- /dev/null
+++ b/distfiles_mirrors/g.mirrors.extra
@@ -0,0 +1 @@
+gentoo http://distfiles.gentoo.org/
diff --git a/experimental_mirrors/g.mirrors.extra b/experimental_mirrors/g.mirrors.extra
new file mode 100644
index 0000000..75c3d12
--- /dev/null
+++ b/experimental_mirrors/g.mirrors.extra
@@ -0,0 +1 @@
+gentoo http://distfiles.gentoo.org/
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
index b1198de..0f10688 100755
--- a/mirmon-snapshots.sh
+++ b/mirmon-snapshots.sh
@@ -11,10 +11,17 @@ VARDIR=${SITEDIR}/var/${MODE}
HTDOCS=${SITEDIR}/htdocs/${MODE}
MIRMON=$(readlink -f "${SITEDIR}"/mirmon/mirmon)
CONFFILE=$(readlink -f "${MODEDIR}"/mirmon.conf)
+VAR_GMIRRORS=${VARDIR}/g.mirrors
# Grab mirrors from the web
mkdir -p "${VARDIR}"
-"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VARDIR}"/g.mirrors.tmp && mv -f "${VARDIR}"/g.mirrors{.tmp,}
+"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VAR_GMIRRORS}".tmp
+
+EXTRA_MIRRORS=${MODEDIR}/g.mirrors.extra
+[[ -e "${EXTRA_MIRRORS}" ]] && cat "${EXTRA_MIRRORS}" >>"${VAR_GMIRRORS}".tmp
+
+# Atomic rotate into place
+mv -f "${VAR_GMIRRORS}"{.tmp,}
# fatal if the state file is NOT present.
[[ -e ${VARDIR}/mirmon.state ]] || touch "${VARDIR}/mirmon.state"
diff --git a/releases_mirrors/g.mirrors.extra b/releases_mirrors/g.mirrors.extra
new file mode 100644
index 0000000..75c3d12
--- /dev/null
+++ b/releases_mirrors/g.mirrors.extra
@@ -0,0 +1 @@
+gentoo http://distfiles.gentoo.org/
diff --git a/snapshots_mirrors/g.mirrors.extra b/snapshots_mirrors/g.mirrors.extra
new file mode 100644
index 0000000..75c3d12
--- /dev/null
+++ b/snapshots_mirrors/g.mirrors.extra
@@ -0,0 +1 @@
+gentoo http://distfiles.gentoo.org/