diff options
author | 2008-12-28 00:22:31 +0530 | |
---|---|---|
committer | 2008-12-28 00:22:31 +0530 | |
commit | b6056a474925b3e990530b252d586a541e5588e7 (patch) | |
tree | 462b5fd1bac8a3f3e3cd41e9e6ce76f57a7218d7 | |
parent | Add support for gentoo-portage (diff) | |
download | gard-b6056a474925b3e990530b252d586a541e5588e7.tar.gz gard-b6056a474925b3e990530b252d586a541e5588e7.tar.bz2 gard-b6056a474925b3e990530b252d586a541e5588e7.zip |
Add support for distfiles over rsync - to be tested
-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): |