diff options
Diffstat (limited to 'modules/mga-mirrors/files/check_mirrors_status')
-rwxr-xr-x | modules/mga-mirrors/files/check_mirrors_status | 7 |
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) |