aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mga-mirrors/files/check_mirrors_status
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mga-mirrors/files/check_mirrors_status')
-rwxr-xr-xmodules/mga-mirrors/files/check_mirrors_status7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/mga-mirrors/files/check_mirrors_status b/modules/mga-mirrors/files/check_mirrors_status
index 7e902549..602ab163 100755
--- a/modules/mga-mirrors/files/check_mirrors_status
+++ b/modules/mga-mirrors/files/check_mirrors_status
@@ -15,6 +15,7 @@ def get_dates(base, archs_per_distro, optional=true)
r[d][a] = get_date(base, d, a)
rescue Net::OpenTimeout, Timeout::Error, ArgumentError, NoMethodError, Errno::EHOSTUNREACH => e
if !optional then
+ STDERR.puts "Failed to fetch #{version_url(url, distrib, arch)}"
raise
end
end
@@ -68,8 +69,12 @@ def parse_version(version)
DateTime.strptime(date, '%Y%m%d %H:%M')
end
+def version_url(url, distrib, arch)
+ "#{url}/distrib/#{distrib}/#{arch}/VERSION"
+end
+
def get_date(url, distrib, arch)
- return parse_version(fetch_url("#{url}/distrib/#{distrib}/#{arch}/VERSION"))
+ return parse_version(fetch_url(version_url(url, distrib, arch)))
end
def print_output(archs_per_distro, mirrors, ref_times, times)