* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2013-08-28 2:28 Alec Warner
0 siblings, 0 replies; 42+ messages in thread
From: Alec Warner @ 2013-08-28 2:28 UTC (permalink / raw
To: gentoo-commits
commit: dca142c8999523c028e72b2b6dd8179fd35da9fd
Author: Alec Warner <antarus <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 28 02:28:01 2013 +0000
Commit: Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 02:28:01 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=dca142c8
distfile(s) typo :(
---
mirmon-distfiles.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mirmon-distfiles.sh b/mirmon-distfiles.sh
index 02ed87b..d9a1d48 100755
--- a/mirmon-distfiles.sh
+++ b/mirmon-distfiles.sh
@@ -1,9 +1,9 @@
#!/bin/bash
-cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/distfile_mirrors
+cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/distfiles_mirrors
# Grab mirrors from the web
[[ -d ./var ]] || mkdir ./var
-./get-mirror-list-source.rb > ./var/g.mirrors
+./get-mirror-list-distfiles.rb > ./var/g.mirrors
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
# run mirmon
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2023-03-22 17:44 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2023-03-22 17:44 UTC (permalink / raw
To: gentoo-commits
commit: 005122b3fd5ec2dcabd1ce9a717937ab6950b1b0
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 17:44:06 2023 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 17:44:06 2023 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=005122b3
probe-mirmon: fix warning
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 1 +
1 file changed, 1 insertion(+)
diff --git a/probe-mirmon b/probe-mirmon
index 233b6a3..cfade50 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -117,6 +117,7 @@ sub handle_rsync {
sub munge_date {
no warnings 'numeric'; ## no critic (TestingAndDebugging::ProhibitNoWarnings)
my $timestr = shift;
+ return -1 if !$timestr;
my $timestamp = int($timestr);
my $year2020 = 1577836800;
my $year2038 = 2145916800;
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2023-03-22 16:29 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2023-03-22 16:29 UTC (permalink / raw
To: gentoo-commits
commit: a8e55ea71ba5602d791561c105310a53566f0503
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 16:29:34 2023 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 16:29:34 2023 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=a8e55ea7
probe-mirmon: cleanup
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index a40be16..233b6a3 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -76,7 +76,15 @@ sub handle_wget {
my ( $timeout, $url ) = @_;
# TODO: replace this with native HTTP
# TODO: munge the output!
- exec {'/usr/bin/wget'} 'wget', qw( -q --passive-ftp -O - -T ), $timeout, '-t', 1, $url;
+ # kill -9 wget when it gets really stuck.
+ my $tmpdir = File::Tempdir->new();
+ my $dir = $tmpdir->name;
+ my $file = $url;
+
+ $file =~ s/\W/_/g; # translate all non-letters to _
+ system {'/usr/bin/timeout'} qw(--preserve-status -s KILL -k ), ($timeout + 1), ($timeout + 0.5),
+ 'wget', qw( -q --passive-ftp -T ), $timeout, '-t', 1, '-O', "$dir/$file", $url;
+ slurp_and_output("$dir/$file");
}
sub handle_rsync {
@@ -90,20 +98,18 @@ sub handle_rsync {
# https://stackoverflow.com/a/6331618/1583179
my ($stdout, $stderr, $ret) = capture {
- system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file";
+ system {'/usr/bin/rsync'} qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file";
};
+ #print "STDOUT: $stdout\n";
+ #print "STDERR $stderr\n";
+ #print "RET: $ret\n";
if ($ret!=0) {
#warn "rsync failed, exit code $fail, $! $? $@\n";
#exit $ret;
exit 800;
}
- open my $fh, '<', "$dir/$file" or do {
- warn "Opening Downloaded timestamp Failed";
- exit 900; # rediculous exit code.
- };
-
- print munge_date(<$fh>);
+ slurp_and_output("$dir/$file");
exit 0;
}
@@ -123,3 +129,16 @@ sub munge_date {
}
return -1;
}
+
+sub slurp_and_output {
+ my $filename = shift;
+ open my $fh, '<', $filename or do {
+ warn "Opening Downloaded timestamp Failed";
+ exit 900; # rediculous exit code.
+ };
+ my $line = <$fh>;
+ #print "RAW: $line\n";
+
+ print munge_date($line), "\n";
+ exit 0;
+}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2023-03-22 16:29 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2023-03-22 16:29 UTC (permalink / raw
To: gentoo-commits
commit: fbfd5e0969fa94b51c4f73f13bf0f6d6e56e7440
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 22 16:13:15 2023 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 16:13:15 2023 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=fbfd5e09
probe-mirmon: workaround: back to wget for FTP
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/probe-mirmon b/probe-mirmon
index ff73776..a40be16 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -29,6 +29,11 @@ sub main {
if ( $url =~ m,^rsync://, ) {
handle_rsync( $timeout, $url );
}
+ elsif ( $url =~ m,^ftp://, ) {
+ # Hacky, at some point CURL stopped returning the output here; just go back to wget for now.
+ #handle_libcurl( $timeout, $url );
+ handle_wget( $timeout, $url );
+ }
else {
handle_libcurl( $timeout, $url );
}
@@ -44,6 +49,7 @@ sub handle_libcurl {
$curl->setopt(CURLOPT_TIMEOUT, $timeout);
$curl->setopt(CURLOPT_FTP_USE_EPSV, 1);
$curl->setopt(CURLOPT_URL, $url);
+ $curl->setopt(CURLOPT_VERBOSE, 1) if $url =~ m,^ftp://,;
# A filehandle, reference to a scalar or reference to a typeglob can be used here.
my $response_body;
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-05-01 17:59 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-05-01 17:59 UTC (permalink / raw
To: gentoo-commits
commit: a568c369788436b7a10b8de7cf8051f2c0130a23
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Fri May 1 17:59:16 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri May 1 17:59:16 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=a568c369
mirmon-wrapper.sh: missed case in args
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 0340ec6..e641c75 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -122,6 +122,7 @@ INVALID=
while [[ $# -gt 0 ]]; do
case "$1" in
+ # Strs:
--mode)
MODE=$2
shift 2
@@ -135,6 +136,11 @@ while [[ $# -gt 0 ]]; do
URL=$2
shift 2
;;
+ # Bools:
+ --quiet)
+ QUIET=1
+ shift
+ ;;
--debug)
DEBUG=1
shift
@@ -147,8 +153,8 @@ while [[ $# -gt 0 ]]; do
HELP=1
shift
;;
+ # End of options
--)
- # End of options
break
;;
*)
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 22:59 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 22:59 UTC (permalink / raw
To: gentoo-commits
commit: 0a9a4c6f6942417fe26a8ce2d457ed340b4098dd
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 22:59:36 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 22:59:36 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=0a9a4c6f
probe-mirmon: ensure valid return from munge
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/probe-mirmon b/probe-mirmon
index b0c3413..ff73776 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -112,6 +112,8 @@ sub munge_date {
if($timestamp >= $year2020 && $timestamp <= $year2038) {
return $timestamp;
} else {
- return Date::Parse::str2time($timestr);
+ my $timestamp = Date::Parse::str2time($timestr);
+ return $timestamp if defined($timestamp);
}
+ return -1;
}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 22:56 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 22:56 UTC (permalink / raw
To: gentoo-commits
commit: 7fcc1ed190b63b194015a60f3a9fe71a63319c9f
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 22:53:34 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 22:53:34 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=7fcc1ed1
probe-mirmon: fix typo
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/probe-mirmon b/probe-mirmon
index 5d99cda..cd97274 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -56,7 +56,7 @@ sub handle_libcurl {
exit 800 unless ($retcode == 0);
my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE);
- exit 801 unless ($response_code == 200)
+ exit 801 unless ($response_code == 200);
exit 802 unless defined($response_body);
chomp $response_body;
print(munge_date($response_body), "\n");
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 22:56 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 22:56 UTC (permalink / raw
To: gentoo-commits
commit: ea8162cb6dde42c2c827bea7c19d7f2eee9d59fd
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 22:56:36 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 22:56:36 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=ea8162cb
probe-mirmon: improve capture usage
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index cd97274..b0c3413 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -83,9 +83,8 @@ sub handle_rsync {
$file =~ s/\W/_/g; # translate all non-letters to _
# https://stackoverflow.com/a/6331618/1583179
- my $ret;
- my ($stdout, $stderr) = capture {
- $ret = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file";
+ my ($stdout, $stderr, $ret) = capture {
+ system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file";
};
if ($ret!=0) {
#warn "rsync failed, exit code $fail, $! $? $@\n";
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 22:52 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 22:52 UTC (permalink / raw
To: gentoo-commits
commit: 1090b5588fa26cedc773014c9d46cdbf91ea55f7
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 22:52:13 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 22:52:13 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=1090b558
mirmon-wrapper.sh: always shift old args
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 2cb6260..0340ec6 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -131,19 +131,21 @@ while [[ $# -gt 0 ]]; do
XML_SRC=$2
shift 2
;;
-
--url)
URL=$2
shift 2
;;
--debug)
DEBUG=1
+ shift
;;
--verbose)
VERBOSE=1
+ shift
;;
--help)
HELP=1
+ shift
;;
--)
# End of options
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 22:17 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 22:17 UTC (permalink / raw
To: gentoo-commits
commit: 89b22bd35232b7c4f10a8961c71f9f6d6077bf61
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 22:17:26 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 22:17:26 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=89b22bd3
mirmon-wrapper.sh: fix arg handling
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 04be5ce..2cb6260 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -20,7 +20,7 @@ helpmsg() {
}
usage() {
- helpmsg "Usage: ${NAME}$(printf " --%s=..." "${OPTIONS_STR[@]}" )$(printf " --%s" "${OPTIONS_BOOL[@]}")"
+ helpmsg "Usage: ${NAME}$(printf " --%s=..." "${OPTIONS_STR[@]}" )$(printf " [--%s]" "${OPTIONS_BOOL[@]}")"
exit 3
}
@@ -112,9 +112,9 @@ opts=$(getopt \
eval set --$opts
-MODE=''
-XML_SRC=''
-URL=''
+MODE=
+XML_SRC=
+URL=
HELP=
DEBUG=
VERBOSE=
@@ -138,15 +138,12 @@ while [[ $# -gt 0 ]]; do
;;
--debug)
DEBUG=1
- break
;;
--verbose)
VERBOSE=1
- break
;;
--help)
HELP=1
- break
;;
--)
# End of options
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 21:27 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 21:27 UTC (permalink / raw
To: gentoo-commits
commit: 6bf3f8110e00e69c67bbe888b92d512152dfc94b
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 21:27:14 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 21:27:14 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=6bf3f811
mirmon: explicitly use --quiet for cronjobs
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-distfiles.sh | 1 +
mirmon-experimental.sh | 1 +
mirmon-releases.sh | 1 +
mirmon-rsync.sh | 1 +
mirmon-snapshots.sh | 1 +
5 files changed, 5 insertions(+)
diff --git a/mirmon-distfiles.sh b/mirmon-distfiles.sh
index 0a245e2..e70bf26 100755
--- a/mirmon-distfiles.sh
+++ b/mirmon-distfiles.sh
@@ -1,5 +1,6 @@
#!/bin/bash
exec $(dirname "$0")/mirmon-wrapper.sh \
+ --quiet \
--mode=distfiles \
--xml-src=distfiles \
--url=https://www.gentoo.org/downloads/mirrors/
diff --git a/mirmon-experimental.sh b/mirmon-experimental.sh
index a48d57f..63b2810 100755
--- a/mirmon-experimental.sh
+++ b/mirmon-experimental.sh
@@ -1,5 +1,6 @@
#!/bin/bash
exec $(dirname "$0")/mirmon-wrapper.sh \
+ --quiet \
--mode=experimental \
--xml-src=distfiles \
--url=https://www.gentoo.org/downloads/mirrors/
diff --git a/mirmon-releases.sh b/mirmon-releases.sh
index 4839856..5462e04 100755
--- a/mirmon-releases.sh
+++ b/mirmon-releases.sh
@@ -1,5 +1,6 @@
#!/bin/bash
exec $(dirname "$0")/mirmon-wrapper.sh \
+ --quiet \
--mode=releases \
--xml-src=distfiles \
--url=https://www.gentoo.org/downloads/mirrors/
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index d97e149..6698471 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -1,5 +1,6 @@
#!/bin/bash
exec $(dirname "$0")/mirmon-wrapper.sh \
+ --quiet \
--mode=rsync \
--xml-src=rsync \
--url=https://www.gentoo.org/support/rsync-mirrors/
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
index bc591bc..e2c0fe5 100755
--- a/mirmon-snapshots.sh
+++ b/mirmon-snapshots.sh
@@ -1,5 +1,6 @@
#!/bin/bash
exec $(dirname "$0")/mirmon-wrapper.sh \
+ --quiet \
--mode=snapshots \
--xml-src=distfiles \
--url=https://www.gentoo.org/downloads/mirrors/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 21:27 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 21:27 UTC (permalink / raw
To: gentoo-commits
commit: 6167a39af9568ec73795d2568f30a43d86d2381a
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 21:26:38 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 21:26:38 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=6167a39a
mirmon-wrapper.sh: support debug/verbose/quiet
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 70 +++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 55 insertions(+), 15 deletions(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 74a12d6..04be5ce 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -2,24 +2,35 @@
NAME=$(basename "$0")
-OPTIONS=(
+OPTIONS_STR=(
"mode"
"xml-src"
"url"
)
+OPTIONS_BOOL=(
+ "help"
+ "debug"
+ "verbose"
+ "quiet"
+)
+
+
+helpmsg() {
+ echo "$*" 1>&2
+}
usage() {
- echo "Usage: ${NAME}$(printf " --%s=..." "${OPTIONS[@]}" )" 1>&2
+ helpmsg "Usage: ${NAME}$(printf " --%s=..." "${OPTIONS_STR[@]}" )$(printf " --%s" "${OPTIONS_BOOL[@]}")"
exit 3
}
dohelp() {
- echo "${NAME} TODO" 1>&2
+ helpmsg "${NAME} TODO"
exit 0
}
die() {
- echo "$*" 1>&2
+ helpmsg "$*"
exit 2
}
@@ -34,7 +45,17 @@ main() {
VAR_GMIRRORS=${VARDIR}/g.mirrors
EXTRA_MIRRORS=${CONFDIR}/g.mirrors.extra
# Lock outselves
- [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "--xml-src=${XML_SRC}" "--mode=${MODE}" "--url=${URL}" || :
+ if [ "${FLOCKER}" != "$0" ]; then
+ exec \
+ env FLOCKER="$0" flock -en "${VARDIR}/flock" \
+ "$0" \
+ ${DEBUG:+--debug} \
+ ${QUIET:+--quiet} \
+ ${VERBOSE:+--verbose} \
+ "--xml-src=${XML_SRC}" \
+ "--mode=${MODE}" \
+ "--url=${URL}"
+ fi
# Grab mirrors from the web
mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir"
@@ -52,8 +73,16 @@ main() {
test -w "${VARDIR}/mirmon.state" || die "Cannot write state file!"
fi
+ MIRMON_OPTS=(
+ -c "${CONFFILE}"
+ -get update
+ )
+ [[ $VERBOSE -eq 1 ]] && MIRMON_OPTS+=( '-v' )
+ [[ $DEBUG -eq 1 ]] && MIRMON_OPTS+=( '-d' )
+ [[ $QUIET -eq 1 ]] && MIRMON_OPTS+=( '-q' )
+
# run mirmon
- /usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update || die "mirmon failed: $?"
+ /usr/bin/perl "${MIRMON}" "${MIRMON_OPTS[@]}" || die "mirmon failed: $?"
# Set up a nice link to our mirror page directly:
sed \
@@ -74,7 +103,8 @@ main() {
}
opts=$(getopt \
- --longoptions "$(printf "%s:," "${OPTIONS[@]}" )" \
+ --longoptions "$(printf "%s:," "${OPTIONS_STR[@]}" )" \
+ --longoptions "$(printf "%s," "${OPTIONS_BOOL[@]}" )" \
--name "$(basename "$0")" \
--options "" \
-- "$@"
@@ -85,8 +115,10 @@ eval set --$opts
MODE=''
XML_SRC=''
URL=''
-HELP=0
-INVALID=0
+HELP=
+DEBUG=
+VERBOSE=
+INVALID=
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -104,6 +136,14 @@ while [[ $# -gt 0 ]]; do
URL=$2
shift 2
;;
+ --debug)
+ DEBUG=1
+ break
+ ;;
+ --verbose)
+ VERBOSE=1
+ break
+ ;;
--help)
HELP=1
break
@@ -143,12 +183,12 @@ for m in "${XML_SRC_INPUTS[@]}"; do
done
[[ $XML_SRC_VALID -eq 1 ]] || XML_SRC=''
-[[ -z "$MODE" ]] && die "--mode must be one of: ${MODE_INPUTS[*]}"
-[[ -z "$XML_SRC" ]] && die "--xml-src must be one of: ${XML_SRC_INPUTS[*]}"
-[[ -z "$URL" ]] && die "--url unset"
+[[ "$INVALID" == 1 ]] && usage
+[[ "$HELP" == 1 ]] && dohelp
-[[ $INVALID -eq 1 ]] && usage
-[[ $HELP -eq 1 ]] && dohelp
+if [[ -z "$MODE" ]]; then helpmsg "--mode must be one of: ${MODE_INPUTS[*]}" ; INVALID=1 ; fi
+if [[ -z "$XML_SRC" ]]; then helpmsg "--xml-src must be one of: ${XML_SRC_INPUTS[*]}" ; INVALID=1 ; fi
+if [[ -z "$URL" ]]; then helpmsg "--url unset" ; INVALID=1 ; fi
+[[ "$INVALID" == 1 ]] && usage
-OPTS=( ${opts} ) # for flock
main
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 21:11 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 21:11 UTC (permalink / raw
To: gentoo-commits
commit: 29f83dc5cca5e06718842753c229bff6f417e244
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 21:10:59 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 21:10:59 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=29f83dc5
probe-mirmon: handle curl error conditions better
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index 1e10ef1..5d99cda 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -53,19 +53,16 @@ sub handle_libcurl {
my $retcode = $curl->perform;
# Looking at the results...
- if ($retcode == 0) {
- #print("Transfer went ok\n");
- my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE);
- # judge result and next action based on $response_code
- #print("Received response: $response_code $response_body\n");
- chomp $response_body;
- #print("s='$response_body'\n");
- print(munge_date($response_body), "\n");
- } else {
- # Error code, type of error, error message
- #print("An error happened: $retcode ".$curl->strerror($retcode)." ".$curl->errbuf."\n");
- exit 800;
- }
+ exit 800 unless ($retcode == 0);
+
+ my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE);
+ exit 801 unless ($response_code == 200)
+ exit 802 unless defined($response_body);
+ chomp $response_body;
+ print(munge_date($response_body), "\n");
+
+ exit 0;
+ #print("An error happened: $retcode ".$curl->strerror($retcode)." ".$curl->errbuf."\n");
}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 20:29 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 20:29 UTC (permalink / raw
To: gentoo-commits
commit: 8a60a36dfca344e002faad387f58b01b09cafa22
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 20:29:38 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 20:29:38 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=8a60a36d
probe-mirmon: make even less stderr
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index 6d67fbf..1e10ef1 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -22,6 +22,7 @@ use warnings;
use Date::Parse (); # dev-perl/TimeDate
use File::Tempdir; # dev-perl/File-Tempdir
use WWW::Curl::Easy;
+use Capture::Tiny qw/capture/;
sub main {
my ( $timeout, $url ) = @_;
@@ -84,9 +85,15 @@ sub handle_rsync {
$file =~ s/\W/_/g; # translate all non-letters to _
- if ( my $fail = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file", '2>/dev/null' ) {
+ # https://stackoverflow.com/a/6331618/1583179
+ my $ret;
+ my ($stdout, $stderr) = capture {
+ $ret = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file";
+ };
+ if ($ret!=0) {
#warn "rsync failed, exit code $fail, $! $? $@\n";
- exit $fail;
+ #exit $ret;
+ exit 800;
}
open my $fh, '<', "$dir/$file" or do {
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 6:31 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 6:31 UTC (permalink / raw
To: gentoo-commits
commit: a8b0ba36853eea23c0e07bcc680bdbe877dcd68e
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 06:29:53 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 06:29:53 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=a8b0ba36
probe-mirmon: use libcurl instead of exec wget
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/probe-mirmon b/probe-mirmon
index 8c57691..6d67fbf 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -21,6 +21,7 @@ use strict;
use warnings;
use Date::Parse (); # dev-perl/TimeDate
use File::Tempdir; # dev-perl/File-Tempdir
+use WWW::Curl::Easy;
sub main {
my ( $timeout, $url ) = @_;
@@ -28,10 +29,45 @@ sub main {
handle_rsync( $timeout, $url );
}
else {
- handle_wget( $timeout, $url );
+ handle_libcurl( $timeout, $url );
}
}
+sub handle_libcurl {
+ my ( $timeout, $url ) = @_;
+
+ my $curl = WWW::Curl::Easy->new;
+
+ $curl->setopt(CURLOPT_HEADER, 0);
+ $curl->setopt(CURLOPT_CONNECTTIMEOUT, $timeout);
+ $curl->setopt(CURLOPT_TIMEOUT, $timeout);
+ $curl->setopt(CURLOPT_FTP_USE_EPSV, 1);
+ $curl->setopt(CURLOPT_URL, $url);
+
+ # A filehandle, reference to a scalar or reference to a typeglob can be used here.
+ my $response_body;
+ $curl->setopt(CURLOPT_WRITEDATA,\$response_body);
+
+ # Starts the actual request
+ my $retcode = $curl->perform;
+
+ # Looking at the results...
+ if ($retcode == 0) {
+ #print("Transfer went ok\n");
+ my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE);
+ # judge result and next action based on $response_code
+ #print("Received response: $response_code $response_body\n");
+ chomp $response_body;
+ #print("s='$response_body'\n");
+ print(munge_date($response_body), "\n");
+ } else {
+ # Error code, type of error, error message
+ #print("An error happened: $retcode ".$curl->strerror($retcode)." ".$curl->errbuf."\n");
+ exit 800;
+ }
+
+}
+
sub handle_wget {
my ( $timeout, $url ) = @_;
# TODO: replace this with native HTTP
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-30 6:02 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-30 6:02 UTC (permalink / raw
To: gentoo-commits
commit: 5324a1b1396fe2f54245109cf1de407399d87aa3
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 30 05:56:28 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Apr 30 06:01:51 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=5324a1b1
probe-mirmon: discard rsync stderr
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/probe-mirmon b/probe-mirmon
index 8dce832..8c57691 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -48,7 +48,7 @@ sub handle_rsync {
$file =~ s/\W/_/g; # translate all non-letters to _
- if ( my $fail = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file" ) {
+ if ( my $fail = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file", '2>/dev/null' ) {
#warn "rsync failed, exit code $fail, $! $? $@\n";
exit $fail;
}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 6:45 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 6:45 UTC (permalink / raw
To: gentoo-commits
commit: 0da786280a2a03ee6847c3e859cda90131d95718
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 06:43:31 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 06:43:31 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=0da78628
wrapper: fix locker args
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 4fffee0..74a12d6 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -34,7 +34,7 @@ main() {
VAR_GMIRRORS=${VARDIR}/g.mirrors
EXTRA_MIRRORS=${CONFDIR}/g.mirrors.extra
# Lock outselves
- [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "${OPTS[@]}" || :
+ [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "--xml-src=${XML_SRC}" "--mode=${MODE}" "--url=${URL}" || :
# Grab mirrors from the web
mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir"
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 6:39 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 6:39 UTC (permalink / raw
To: gentoo-commits
commit: 8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 06:39:18 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 06:39:18 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=8f37aa42
wrapper: ensure locking
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index 4c5570b..4fffee0 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -33,6 +33,8 @@ main() {
CONFFILE=$(readlink -f "${CONFDIR}"/mirmon.conf)
VAR_GMIRRORS=${VARDIR}/g.mirrors
EXTRA_MIRRORS=${CONFDIR}/g.mirrors.extra
+ # Lock outselves
+ [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "${OPTS[@]}" || :
# Grab mirrors from the web
mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir"
@@ -148,4 +150,5 @@ done
[[ $INVALID -eq 1 ]] && usage
[[ $HELP -eq 1 ]] && dohelp
+OPTS=( ${opts} ) # for flock
main
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:48 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:48 UTC (permalink / raw
To: gentoo-commits
commit: ee0addc4c7531ff8262f3715b67bf9fc9b73d259
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 05:48:28 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 05:48:28 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=ee0addc4
Git ignore not needed anymore
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
.gitignore | 5 -----
1 file changed, 5 deletions(-)
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 061ee03..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-rsync_mirrors/var/
-distfiles_mirrors/var/
-experimental_mirrors/var/
-releases_mirrors/var/
-snapshots_mirrors/var/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:41 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:41 UTC (permalink / raw
To: gentoo-commits
commit: a0841c139bd7830a56ad9e0dfb215148711a68c7
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 05:41:28 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 05:41:28 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=a0841c13
probe-mirmon: be quiet if rsync site is broken
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index ddd8546..8dce832 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -48,8 +48,8 @@ sub handle_rsync {
$file =~ s/\W/_/g; # translate all non-letters to _
- if ( my $fail = system '/usr/bin/rsync', qw( --no-motd --timeout ), $timeout, $url, "$dir/$file" ) {
- warn "rsync failed, exit code $fail, $! $? $@\n";
+ if ( my $fail = system '/usr/bin/rsync', qw( -q --no-motd --timeout ), $timeout, $url, "$dir/$file" ) {
+ #warn "rsync failed, exit code $fail, $! $? $@\n";
exit $fail;
}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:33 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:33 UTC (permalink / raw
To: gentoo-commits
commit: adddc138088d7f2157cfcdd72402b9395be4ccb0
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 05:33:48 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 05:33:48 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=adddc138
wrapper: input validations
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-wrapper.sh | 74 +++++++++++++++++++++++++++++++++++++------------------
1 file changed, 50 insertions(+), 24 deletions(-)
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
index ba731c6..2c50369 100755
--- a/mirmon-wrapper.sh
+++ b/mirmon-wrapper.sh
@@ -24,9 +24,6 @@ die() {
}
main() {
- [[ -z "$MODE" ]] && die "--mode unset"
- [[ -z "$XML_SRC" ]] && die "--xml-src unset"
- [[ -z "$URL" ]] && die "--url unset"
SITEDIR=/var/www/mirrorstats.gentoo.org
REPODIR=${SITEDIR}/gentoo-mirrorstats/
MODEDIR=${REPODIR}/${MODE}_mirrors/
@@ -35,35 +32,40 @@ main() {
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-${XML_SRC}-xml.rb > "${VAR_GMIRRORS}".tmp
-
EXTRA_MIRRORS=${MODEDIR}/g.mirrors.extra
+
+ # Grab mirrors from the web
+ mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir"
+ "${REPODIR}/get-mirrors-from-${XML_SRC}-xml.rb" > "${VAR_GMIRRORS}".tmp || die "Unable to fetch mirror list"
+
[[ -e "${EXTRA_MIRRORS}" ]] && cat "${EXTRA_MIRRORS}" >>"${VAR_GMIRRORS}".tmp
-
+
# Atomic rotate into place
- mv -f "${VAR_GMIRRORS}"{.tmp,}
-
+ mv -f "${VAR_GMIRRORS}"{.tmp,} || die "Failed to set mirror list"
+
# fatal if the state file is NOT present.
- [[ -e ${VARDIR}/mirmon.state ]] || touch "${VARDIR}/mirmon.state"
-
+ if [[ ! -e ${VARDIR}/mirmon.state ]]; then
+ touch "${VARDIR}/mirmon.state" || die "Could not create state file"
+ else
+ test -w "${VARDIR}/mirmon.state" || die "Cannot write state file!"
+ fi
+
# run mirmon
- /usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update
-
+ /usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update || die "mirmon failed: $?"
+
# Set up a nice link to our mirror page directly:
- mkdir -p ${HTDOCS}
sed \
- -e "s#mirrors</H2>#<a href="${URL}">mirrors</a></H2>#" \
+ -e "s#mirrors</H2>#<a href=\"${URL}\">mirrors</a></H2>#" \
>"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \
- && mv -f "${HTDOCS}"/index.html{.tmp,}
-
+ || die "Failed to fix URLs(sed)"
+ mv -f "${HTDOCS}"/index.html{.tmp,} || die "Failed to fix URLs(mv)"
+
# Generate a json file containing the state of each mirror
"${REPODIR}"/generate-json.py \
"${VARDIR}"/mirmon.state \
>"${HTDOCS}"/state.json.tmp \
- && mv -f "${HTDOCS}"/state.json{.tmp,}
+ || die "Failed to generate JSON (py)"
+ mv -f "${HTDOCS}"/state.json{.tmp,} || die "Failed to generate JSON (mv)"
# Done
exit 0
@@ -115,11 +117,35 @@ while [[ $# -gt 0 ]]; do
esac
done
+# Validations
+MODE_INPUTS=(
+ distfiles
+ rsync
+ snapshots
+ experimental
+ releases
+)
+MODE_VALID=0
+for m in "${MODE_INPUTS[@]}"; do
+ [[ "$m" == "$MODE" ]] && MODE_VALID=1
+done
+[[ $MODE_VALID -eq 1 ]] || MODE=''
+
+XML_SRC_INPUTS=(
+ distfiles
+ rsync
+)
+XML_SRC_VALID=0
+for m in "${XML_SRC_INPUTS[@]}"; do
+ [[ "$m" == "$XML_SRC" ]] && XML_SRC_VALID=1
+done
+[[ $XML_SRC_VALID -eq 1 ]] || XML_SRC=''
+
+[[ -z "$MODE" ]] && die "--mode must be one of: ${MODE_INPUTS[*]}"
+[[ -z "$XML_SRC" ]] && die "--xml-src must be one of: ${XML_SRC_INPUTS[*]}"
+[[ -z "$URL" ]] && die "--url unset"
+
[[ $INVALID -eq 1 ]] && usage
[[ $HELP -eq 1 ]] && dohelp
main
-
-#MODE=snapshots
-#XML_SRC=distfiles
-#URL=https://www.gentoo.org/downloads/mirrors/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:20 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:20 UTC (permalink / raw
To: gentoo-commits
commit: b0b29736aeb8eaddcf111c0a0c1da693fbbb60e0
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 04:52:08 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 04:52:08 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=b0b29736
snapshots: fix URL
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-snapshots.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
index 0f10688..5a5c127 100755
--- a/mirmon-snapshots.sh
+++ b/mirmon-snapshots.sh
@@ -12,6 +12,7 @@ HTDOCS=${SITEDIR}/htdocs/${MODE}
MIRMON=$(readlink -f "${SITEDIR}"/mirmon/mirmon)
CONFFILE=$(readlink -f "${MODEDIR}"/mirmon.conf)
VAR_GMIRRORS=${VARDIR}/g.mirrors
+URL=https://www.gentoo.org/downloads/mirrors/
# Grab mirrors from the web
mkdir -p "${VARDIR}"
@@ -32,7 +33,7 @@ mv -f "${VAR_GMIRRORS}"{.tmp,}
# Set up a nice link to our mirror page directly:
mkdir -p ${HTDOCS}
sed \
- -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \
+ -e "s#mirrors</H2>#<a href="${URL}">mirrors</a></H2>#" \
>"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \
&& mv -f "${HTDOCS}"/index.html{.tmp,}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:20 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:20 UTC (permalink / raw
To: gentoo-commits
commit: 3481f1fa6e8dba159ded86d4f09ea860e307049a
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 05:09:34 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 05:09:34 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=3481f1fa
Convert refactored runner to wrapper
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-snapshots.sh | 44 ------------------
mirmon-wrapper.sh | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+), 44 deletions(-)
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
deleted file mode 100755
index 5a5c127..0000000
--- a/mirmon-snapshots.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-set -e
-
-MODE=snapshots
-SRC=distfiles
-SITEDIR=/var/www/mirrorstats.gentoo.org
-REPODIR=${SITEDIR}/gentoo-mirrorstats/
-MODEDIR=${REPODIR}/${MODE}_mirrors/
-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
-URL=https://www.gentoo.org/downloads/mirrors/
-
-# Grab mirrors from the web
-mkdir -p "${VARDIR}"
-"${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"
-
-# run mirmon
-/usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update
-
-# Set up a nice link to our mirror page directly:
-mkdir -p ${HTDOCS}
-sed \
- -e "s#mirrors</H2>#<a href="${URL}">mirrors</a></H2>#" \
- >"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \
- && mv -f "${HTDOCS}"/index.html{.tmp,}
-
-# Generate a json file containing the state of each mirror
-"${REPODIR}"/generate-json.py \
- "${VARDIR}"/mirmon.state \
- >"${HTDOCS}"/state.json.tmp \
- && mv -f "${HTDOCS}"/state.json{.tmp,}
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh
new file mode 100755
index 0000000..ba731c6
--- /dev/null
+++ b/mirmon-wrapper.sh
@@ -0,0 +1,125 @@
+#!/bin/bash -e
+
+NAME=$(basename "$0")
+
+OPTIONS=(
+ "mode"
+ "xml-src"
+ "url"
+)
+
+usage() {
+ echo "Usage: ${NAME}$(printf " --%s=..." "${OPTIONS[@]}" )" 1>&2
+ exit 3
+}
+
+dohelp() {
+ echo "${NAME} TODO" 1>&2
+ exit 0
+}
+
+die() {
+ echo "$*" 1>&2
+ exit 2
+}
+
+main() {
+ [[ -z "$MODE" ]] && die "--mode unset"
+ [[ -z "$XML_SRC" ]] && die "--xml-src unset"
+ [[ -z "$URL" ]] && die "--url unset"
+ SITEDIR=/var/www/mirrorstats.gentoo.org
+ REPODIR=${SITEDIR}/gentoo-mirrorstats/
+ MODEDIR=${REPODIR}/${MODE}_mirrors/
+ 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-${XML_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"
+
+ # run mirmon
+ /usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update
+
+ # Set up a nice link to our mirror page directly:
+ mkdir -p ${HTDOCS}
+ sed \
+ -e "s#mirrors</H2>#<a href="${URL}">mirrors</a></H2>#" \
+ >"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \
+ && mv -f "${HTDOCS}"/index.html{.tmp,}
+
+ # Generate a json file containing the state of each mirror
+ "${REPODIR}"/generate-json.py \
+ "${VARDIR}"/mirmon.state \
+ >"${HTDOCS}"/state.json.tmp \
+ && mv -f "${HTDOCS}"/state.json{.tmp,}
+
+ # Done
+ exit 0
+}
+
+opts=$(getopt \
+ --longoptions "$(printf "%s:," "${OPTIONS[@]}" )" \
+ --name "$(basename "$0")" \
+ --options "" \
+ -- "$@"
+)
+
+eval set --$opts
+
+MODE=''
+XML_SRC=''
+URL=''
+HELP=0
+INVALID=0
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --mode)
+ MODE=$2
+ shift 2
+ ;;
+
+ --xml-src)
+ XML_SRC=$2
+ shift 2
+ ;;
+
+ --url)
+ URL=$2
+ shift 2
+ ;;
+ --help)
+ HELP=1
+ break
+ ;;
+ --)
+ # End of options
+ break
+ ;;
+ *)
+ INVALID=1
+ break
+ ;;
+ esac
+done
+
+[[ $INVALID -eq 1 ]] && usage
+[[ $HELP -eq 1 ]] && dohelp
+
+main
+
+#MODE=snapshots
+#XML_SRC=distfiles
+#URL=https://www.gentoo.org/downloads/mirrors/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-29 5:20 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-29 5:20 UTC (permalink / raw
To: gentoo-commits
commit: 2e17262f3b54e829f7aa875bdaa543703d8c6e55
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 29 05:09:59 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 29 05:09:59 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=2e17262f
snapshots: call new wrapper
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-snapshots.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
new file mode 100755
index 0000000..bc591bc
--- /dev/null
+++ b/mirmon-snapshots.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+exec $(dirname "$0")/mirmon-wrapper.sh \
+ --mode=snapshots \
+ --xml-src=distfiles \
+ --url=https://www.gentoo.org/downloads/mirrors/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 23:21 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 23:21 UTC (permalink / raw
To: gentoo-commits
commit: 97ea3377d7030d39b2f7340ebf060eb072ec2343
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 23:21:21 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 23:21:21 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=97ea3377
mirmon-snapshots.sh: test refactor of runner
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-snapshots.sh | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh
old mode 100644
new mode 100755
index 692a1ef..894e94b
--- a/mirmon-snapshots.sh
+++ b/mirmon-snapshots.sh
@@ -1,18 +1,36 @@
#!/bin/bash
-cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors
+set -e
+
+MODE=snapshots
+SRC=distfiles
+SITEDIR=/var/www/mirrorstats.gentoo.org
+REPODIR=${SITEDIR}/gentoo-mirrorstats/
+MODEDIR=${SITEDIR}/${MODE}_mirrors/
+VARDIR=${SITEDIR}/var/${MODE}
+HTDOCS=${SITEDIR}/htdocs/${MODE}
+MIRMON=$(readlink -f "${SITEDIR}"/mirmon/mirmon)
+CONFFILE=$(readlink -f "${MODEDIR}"/mirmon.conf)
+
# Grab mirrors from the web
-[[ -d ./var ]] || mkdir ./var
-../get-mirrors-from-distfiles-xml.rb > ./var/g.mirrors
+mkdir -p "${VARDIR}"
+"${REPODIR}"/get-mirrors-from-${SRC}-xml.rb > "${VARDIR}"/g.mirrors.tmp && mv -f "${VARDIR}"/g.mirrors{.tmp,}
+
# fatal if the state file is NOT present.
-[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
+[[ -e ${VARDIR}/mirmon.state ]] || touch "${VARDIR}/mirmon.state"
+
# run mirmon
-/usr/bin/perl ../../mirmon/mirmon -c ./mirmon.conf -q -get update
+/usr/bin/perl "${MIRMON}" -c "${CONFFILE}" -q -get update
+
# Set up a nice link to our mirror page directly:
-[[ -d ../../htdocs/snapshots ]] || mkdir ../../htdocs/snapshots
+mkdir -p ${HTDOCS}
sed \
-e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \
- >../../htdocs/snapshots/index.html <../../htdocs/snapshots/index-wip.html
+ >"${HTDOCS}"/index.html.tmp <"${HTDOCS}"/index-wip.html \
+ && mv -f "${HTDOCS}"/index.html{.tmp,}
+
# Generate a json file containing the state of each mirror
-../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state \
- > ../../htdocs/snapshots/state.json
+../json/generate-json.py \
+ "${VARDIR}"/mirmon.state \
+ >"${HTDOCS}"/state.json.tmp \
+ && mv -f "${HTDOCS}"/state.json{.tmp,}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 23:21 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 23:21 UTC (permalink / raw
To: gentoo-commits
commit: 017ef815975b6ffef58fbe8f27ce7e48e5053e9d
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 17:45:00 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 17:45:00 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=017ef815
gitignore: missed var for snapshot
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 2e314d5..061ee03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@ rsync_mirrors/var/
distfiles_mirrors/var/
experimental_mirrors/var/
releases_mirrors/var/
+snapshots_mirrors/var/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 17:42 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 17:42 UTC (permalink / raw
To: gentoo-commits
commit: 23444534405ec900f3eac60bb6e4e768ac59de61
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 17:42:06 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 17:42:06 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=23444534
rsync: trailing / on mirrors
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-rsync.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index 2391a0f..1e432e2 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -15,7 +15,7 @@ cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/rsync_mirrors
../get-mirrors-from-rsync-xml.rb > ./var/g.mirrors
# infra mirrors, "manually added" to list to check
for i in ${INFRA}; do
- echo "gentoo rsync://$i.gentoo.org" >> ./var/g.mirrors
+ echo "gentoo rsync://$i.gentoo.org/" >> ./var/g.mirrors
done
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 17:34 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 17:34 UTC (permalink / raw
To: gentoo-commits
commit: c28531f526f8cd385b96fe8da40615bda9360ff0
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 17:34:13 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 17:34:13 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=c28531f5
mirmor: drop GCP mirror that was tested
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-rsync.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index 93f76b2..2391a0f 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -17,8 +17,6 @@ cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/rsync_mirrors
for i in ${INFRA}; do
echo "gentoo rsync://$i.gentoo.org" >> ./var/g.mirrors
done
-# Test GCP mirror; added by antarus
-echo "gentoo rsync://35.190.132.250" >> ./var/g.mirrors
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
# run mirmon
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 16:46 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 16:46 UTC (permalink / raw
To: gentoo-commits
commit: 34db670aff7f8da1eb1c90b7ad68cec526cfb4c6
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 16:45:32 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 16:45:52 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=34db670a
probe-mirmon: fix rsync case
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
probe-mirmon | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/probe-mirmon b/probe-mirmon
index 7b57923..ddd8546 100755
--- a/probe-mirmon
+++ b/probe-mirmon
@@ -17,6 +17,8 @@
main(@ARGV);
+use strict;
+use warnings;
use Date::Parse (); # dev-perl/TimeDate
use File::Tempdir; # dev-perl/File-Tempdir
@@ -56,19 +58,20 @@ sub handle_rsync {
exit 900; # rediculous exit code.
};
- print munge_date(<fh>);
+ print munge_date(<$fh>);
exit 0;
}
sub munge_date {
- my $timestr = $_;
+ no warnings 'numeric'; ## no critic (TestingAndDebugging::ProhibitNoWarnings)
+ my $timestr = shift;
my $timestamp = int($timestr);
my $year2020 = 1577836800;
my $year2038 = 2145916800;
# If the string starts with an epoch, just use that
- if($int_timestamp >= $year2020 && $int_timestamp <= $year2038) {
- return $int_timestamp;
+ if($timestamp >= $year2020 && $timestamp <= $year2038) {
+ return $timestamp;
} else {
return Date::Parse::str2time($timestr);
}
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2020-04-28 7:54 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2020-04-28 7:54 UTC (permalink / raw
To: gentoo-commits
commit: e7bd76858e286a650870dcc7da279ced52f3d4d6
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 28 07:54:05 2020 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Tue Apr 28 07:54:05 2020 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=e7bd7685
Fixup deployment pieces
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
.gitignore | 2 ++
mirmon-experimental.sh | 0
mirmon-releases.sh | 0
3 files changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore
index 608618c..2e314d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
rsync_mirrors/var/
distfiles_mirrors/var/
+experimental_mirrors/var/
+releases_mirrors/var/
diff --git a/mirmon-experimental.sh b/mirmon-experimental.sh
old mode 100644
new mode 100755
diff --git a/mirmon-releases.sh b/mirmon-releases.sh
old mode 100644
new mode 100755
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2018-12-15 18:57 Alec Warner
0 siblings, 0 replies; 42+ messages in thread
From: Alec Warner @ 2018-12-15 18:57 UTC (permalink / raw
To: gentoo-commits
commit: 343409ae01cf6c8cf95f6a59fdeee995aa469e5b
Author: Alec Warner <antarus <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 15 18:57:27 2018 +0000
Commit: Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Sat Dec 15 18:57:40 2018 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=343409ae
Add my GCP mirror IP to the mirmon state.
Signed-off-by: Alec Warner <antarus <AT> gentoo.org>
mirmon-rsync.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index c8c5ba0..5df1c73 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -17,6 +17,8 @@ cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/rsync_mirrors
for i in ${INFRA}; do
echo "gentoo rsync://$i.gentoo.org" >> ./var/g.mirrors
done
+# Test GCP mirror; added by antarus
+echo "gentoo rsync://35.190.132.250" >> ./var/g.mirrors
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
# run mirmon
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2016-11-05 18:02 Robin H. Johnson
0 siblings, 0 replies; 42+ messages in thread
From: Robin H. Johnson @ 2016-11-05 18:02 UTC (permalink / raw
To: gentoo-commits
commit: 26b584d6b1a64dabaa1080966ef3e5b6fdce96a3
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 5 18:01:50 2016 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Nov 5 18:01:50 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=26b584d6
Drop two older infra mirrors that were removed from rsync.g.o rotation long ago.
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
mirmon-rsync.sh | 2 --
1 file changed, 2 deletions(-)
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index 1934d90..c8c5ba0 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -2,10 +2,8 @@
INFRA="
albatross
-bobolink
boobie
dipper
-magpie
quetzal
starling
swan
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2014-02-12 3:44 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2014-02-12 3:44 UTC (permalink / raw
To: gentoo-commits
commit: 43a7ea3ddf2aadb57123a16c1ad9761b285e011b
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 12 03:44:40 2014 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Wed Feb 12 03:44:40 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=43a7ea3d
remove jay from stats
---
mirmon-rsync.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/mirmon-rsync.sh b/mirmon-rsync.sh
index 674635a..0efc6e0 100755
--- a/mirmon-rsync.sh
+++ b/mirmon-rsync.sh
@@ -5,7 +5,6 @@ albatross
bobolink
boobie
dipper
-jay
magpie
quetzal
starling
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2013-08-27 9:08 Alec Warner
0 siblings, 0 replies; 42+ messages in thread
From: Alec Warner @ 2013-08-27 9:08 UTC (permalink / raw
To: gentoo-commits
commit: 754da1699462f8381702187eaf5829a472aea2ee
Author: Alec Warner <antarus <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 27 09:07:26 2013 +0000
Commit: Alec Warner <antarus <AT> gentoo <DOT> org>
CommitDate: Tue Aug 27 09:07:26 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=754da169
Unbreak mirmon-distfiles.
Theo renamed 'source_mirrors' to distfiles_mirrors but missed a few references.
---
mirmon-distfiles.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mirmon-distfiles.sh b/mirmon-distfiles.sh
index eaedc8b..02ed87b 100755
--- a/mirmon-distfiles.sh
+++ b/mirmon-distfiles.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/source_mirrors
+cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/distfile_mirrors
# Grab mirrors from the web
[[ -d ./var ]] || mkdir ./var
./get-mirror-list-source.rb > ./var/g.mirrors
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2012-12-25 17:22 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2012-12-25 17:22 UTC (permalink / raw
To: gentoo-commits
commit: 25df3fcfc6eba22719683afe6ae8260aaadace9a
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 25 17:22:07 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Dec 25 17:22:07 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=25df3fcf
remove kookaburra, add dipper
Signed-off-by: Jeremy Olexa <darkside <AT> gentoo.org>
---
mirmon-portage.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index 1fc3cd3..e2d2fda 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -4,7 +4,7 @@ INFRA="
albatross
bobolink
boobie
-kookaburra
+dipper
jay
magpie
quetzal
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2012-12-22 10:46 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2012-12-22 10:46 UTC (permalink / raw
To: gentoo-commits
commit: d2eacd3b1097e59291ebfe230b0ecd5d310a945f
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 22 10:46:09 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Sat Dec 22 10:46:09 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=d2eacd3b
remove raven from INFRA
Signed-off-by: Jeremy Olexa <darkside <AT> gentoo.org>
---
mirmon-portage.sh | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index 9f68f09..1fc3cd3 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -8,7 +8,6 @@ kookaburra
jay
magpie
quetzal
-raven
starling
swan
"
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2012-09-18 16:17 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2012-09-18 16:17 UTC (permalink / raw
To: gentoo-commits
commit: a92b857aeca7924d6c12b8389999e3fabf0a5efb
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 18 16:17:48 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Tue Sep 18 16:17:48 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=a92b857a
add jay to INFRA
---
mirmon-portage.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index 99f19de..9f68f09 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -5,6 +5,7 @@ albatross
bobolink
boobie
kookaburra
+jay
magpie
quetzal
raven
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2012-06-20 21:05 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2012-06-20 21:05 UTC (permalink / raw
To: gentoo-commits
commit: 9e28168e1070a155439bbce81dead1d68a59e86b
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 20 21:05:00 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 21:05:00 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=9e28168e
remove hawk from INFRA, add starling, quetzal
---
mirmon-portage.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index c375e86..99f19de 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -4,10 +4,11 @@ INFRA="
albatross
bobolink
boobie
-hawk
kookaburra
magpie
+quetzal
raven
+starling
swan
"
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2012-02-24 18:45 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2012-02-24 18:45 UTC (permalink / raw
To: gentoo-commits
commit: 90e2acbd02a8e6fe34cdc86fb7419063b1e1e01f
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 24 18:44:59 2012 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Fri Feb 24 18:44:59 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=90e2acbd
remove crane & vireo from INFRA, add swan
---
mirmon-portage.sh | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index 925aae5..c375e86 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -1,6 +1,15 @@
#!/bin/bash
-INFRA="albatross bobolink boobie crane hawk kookaburra magpie raven vireo"
+INFRA="
+albatross
+bobolink
+boobie
+hawk
+kookaburra
+magpie
+raven
+swan
+"
cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/portage_mirrors
# Grab mirrors from the web
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2011-06-02 13:48 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2011-06-02 13:48 UTC (permalink / raw
To: gentoo-commits
commit: 27b94819cbd814a38ce00b69444e08918901f952
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 2 13:47:58 2011 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Thu Jun 2 13:47:58 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=27b94819
also check albatross
---
mirmon-portage.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index ae67e48..925aae5 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-INFRA="bobolink boobie crane hawk kookaburra magpie raven vireo"
+INFRA="albatross bobolink boobie crane hawk kookaburra magpie raven vireo"
cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/portage_mirrors
# Grab mirrors from the web
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2011-05-19 15:09 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2011-05-19 15:09 UTC (permalink / raw
To: gentoo-commits
commit: decfc66d5835fbfaf3492481a222f48707f1da64
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Thu May 19 15:07:57 2011 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Thu May 19 15:09:42 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=decfc66d
gitignore: ignore the var directories
---
.gitignore | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fef44c4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+portage_mirrors/var/
+source_mirrors/var/
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [gentoo-commits] proj/gentoo-mirrorstats:master commit in: /
@ 2011-05-19 15:09 Jeremy Olexa
0 siblings, 0 replies; 42+ messages in thread
From: Jeremy Olexa @ 2011-05-19 15:09 UTC (permalink / raw
To: gentoo-commits
commit: 31db5f65584866de0567706cdc246dc81ebef8ae
Author: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
AuthorDate: Thu May 19 15:06:55 2011 +0000
Commit: Jeremy Olexa <darkside <AT> gentoo <DOT> org>
CommitDate: Thu May 19 15:09:42 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-mirrorstats.git;a=commit;h=31db5f65
check infra rsync mirrors
---
mirmon-portage.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/mirmon-portage.sh b/mirmon-portage.sh
index 0aa66dd..ae67e48 100755
--- a/mirmon-portage.sh
+++ b/mirmon-portage.sh
@@ -1,9 +1,15 @@
#!/bin/bash
+INFRA="bobolink boobie crane hawk kookaburra magpie raven vireo"
+
cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/portage_mirrors
# Grab mirrors from the web
[[ -d ./var ]] || mkdir ./var
./get-mirror-list-portage.rb > ./var/g.mirrors
+# infra mirrors, "manually added" to list to check
+for i in ${INFRA}; do
+ echo "gentoo rsync://$i.gentoo.org" >> ./var/g.mirrors
+done
# fatal if the state file is NOT present.
[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state
# run mirmon
^ permalink raw reply related [flat|nested] 42+ messages in thread
end of thread, other threads:[~2023-03-22 17:44 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28 2:28 [gentoo-commits] proj/gentoo-mirrorstats:master commit in: / Alec Warner
-- strict thread matches above, loose matches on Subject: below --
2023-03-22 17:44 Robin H. Johnson
2023-03-22 16:29 Robin H. Johnson
2023-03-22 16:29 Robin H. Johnson
2020-05-01 17:59 Robin H. Johnson
2020-04-30 22:59 Robin H. Johnson
2020-04-30 22:56 Robin H. Johnson
2020-04-30 22:56 Robin H. Johnson
2020-04-30 22:52 Robin H. Johnson
2020-04-30 22:17 Robin H. Johnson
2020-04-30 21:27 Robin H. Johnson
2020-04-30 21:27 Robin H. Johnson
2020-04-30 21:11 Robin H. Johnson
2020-04-30 20:29 Robin H. Johnson
2020-04-30 6:31 Robin H. Johnson
2020-04-30 6:02 Robin H. Johnson
2020-04-29 6:45 Robin H. Johnson
2020-04-29 6:39 Robin H. Johnson
2020-04-29 5:48 Robin H. Johnson
2020-04-29 5:41 Robin H. Johnson
2020-04-29 5:33 Robin H. Johnson
2020-04-29 5:20 Robin H. Johnson
2020-04-29 5:20 Robin H. Johnson
2020-04-29 5:20 Robin H. Johnson
2020-04-28 23:21 Robin H. Johnson
2020-04-28 23:21 Robin H. Johnson
2020-04-28 17:42 Robin H. Johnson
2020-04-28 17:34 Robin H. Johnson
2020-04-28 16:46 Robin H. Johnson
2020-04-28 7:54 Robin H. Johnson
2018-12-15 18:57 Alec Warner
2016-11-05 18:02 Robin H. Johnson
2014-02-12 3:44 Jeremy Olexa
2013-08-27 9:08 Alec Warner
2012-12-25 17:22 Jeremy Olexa
2012-12-22 10:46 Jeremy Olexa
2012-09-18 16:17 Jeremy Olexa
2012-06-20 21:05 Jeremy Olexa
2012-02-24 18:45 Jeremy Olexa
2011-06-02 13:48 Jeremy Olexa
2011-05-19 15:09 Jeremy Olexa
2011-05-19 15:09 Jeremy Olexa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox