1 |
commit: 448bf5d0dededcbcc24c82318eb9e5f05ba10eb8 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 29 04:46:23 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 29 04:46:23 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=448bf5d0 |
7 |
|
8 |
snapshots: prepare for common mirmon runner code via specific mirrors |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
distfiles_mirrors/g.mirrors.extra | 1 + |
13 |
experimental_mirrors/g.mirrors.extra | 1 + |
14 |
mirmon-snapshots.sh | 9 ++++++++- |
15 |
releases_mirrors/g.mirrors.extra | 1 + |
16 |
snapshots_mirrors/g.mirrors.extra | 1 + |
17 |
5 files changed, 12 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/distfiles_mirrors/g.mirrors.extra b/distfiles_mirrors/g.mirrors.extra |
20 |
new file mode 100644 |
21 |
index 0000000..75c3d12 |
22 |
--- /dev/null |
23 |
+++ b/distfiles_mirrors/g.mirrors.extra |
24 |
@@ -0,0 +1 @@ |
25 |
+gentoo http://distfiles.gentoo.org/ |
26 |
|
27 |
diff --git a/experimental_mirrors/g.mirrors.extra b/experimental_mirrors/g.mirrors.extra |
28 |
new file mode 100644 |
29 |
index 0000000..75c3d12 |
30 |
--- /dev/null |
31 |
+++ b/experimental_mirrors/g.mirrors.extra |
32 |
@@ -0,0 +1 @@ |
33 |
+gentoo http://distfiles.gentoo.org/ |
34 |
|
35 |
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh |
36 |
index b1198de..0f10688 100755 |
37 |
--- a/mirmon-snapshots.sh |
38 |
+++ b/mirmon-snapshots.sh |
39 |
@@ -11,10 +11,17 @@ VARDIR=${SITEDIR}/var/${MODE} |
40 |
HTDOCS=${SITEDIR}/htdocs/${MODE} |
41 |
MIRMON=$(readlink -f "${SITEDIR}"/mirmon/mirmon) |
42 |
CONFFILE=$(readlink -f "${MODEDIR}"/mirmon.conf) |
43 |
+VAR_GMIRRORS=${VARDIR}/g.mirrors |
44 |
|
45 |
# Grab mirrors from the web |
46 |
mkdir -p "${VARDIR}" |
47 |
-"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VARDIR}"/g.mirrors.tmp && mv -f "${VARDIR}"/g.mirrors{.tmp,} |
48 |
+"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VAR_GMIRRORS}".tmp |
49 |
+ |
50 |
+EXTRA_MIRRORS=${MODEDIR}/g.mirrors.extra |
51 |
+[[ -e "${EXTRA_MIRRORS}" ]] && cat "${EXTRA_MIRRORS}" >>"${VAR_GMIRRORS}".tmp |
52 |
+ |
53 |
+# Atomic rotate into place |
54 |
+mv -f "${VAR_GMIRRORS}"{.tmp,} |
55 |
|
56 |
# fatal if the state file is NOT present. |
57 |
[[ -e ${VARDIR}/mirmon.state ]] || touch "${VARDIR}/mirmon.state" |
58 |
|
59 |
diff --git a/releases_mirrors/g.mirrors.extra b/releases_mirrors/g.mirrors.extra |
60 |
new file mode 100644 |
61 |
index 0000000..75c3d12 |
62 |
--- /dev/null |
63 |
+++ b/releases_mirrors/g.mirrors.extra |
64 |
@@ -0,0 +1 @@ |
65 |
+gentoo http://distfiles.gentoo.org/ |
66 |
|
67 |
diff --git a/snapshots_mirrors/g.mirrors.extra b/snapshots_mirrors/g.mirrors.extra |
68 |
new file mode 100644 |
69 |
index 0000000..75c3d12 |
70 |
--- /dev/null |
71 |
+++ b/snapshots_mirrors/g.mirrors.extra |
72 |
@@ -0,0 +1 @@ |
73 |
+gentoo http://distfiles.gentoo.org/ |