diff options
-rw-r--r-- | check.py | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -8,6 +8,7 @@ import re import tempfile import subprocess import os +import urlparse class GardCheck: # Base class which provides some helper functions @@ -112,9 +113,23 @@ class GardCheck: # Check distfiles mirrors class DistfilesCheck(GardCheck): def lag(self): - - path = '/distfiles/timestamp.chk' - return self.get_lag(self.url + path) + scheme = urlparse.urlparse(self.url).scheme + if scheme == 'http' or scheme == 'ftp': + path = '/distfiles/timestamp.chk' + lag = self.get_lag(self.url + path) + else: + # XXX: to be tested! + file = 'timestamp.x' + path = 'distfiles/' + file + + self.get_file_rsync(path) + + url = 'file://%s/%s' % (os.path.abspath(''), file) + lag = self.get_lag(url) + + os.remove(file) + + return lag # Check experimental mirrors class ExperimentalCheck(GardCheck): |