From b6056a474925b3e990530b252d586a541e5588e7 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Sun, 28 Dec 2008 00:22:31 +0530 Subject: Add support for distfiles over rsync - to be tested --- check.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/check.py b/check.py index 3c81eeb..3695f91 100644 --- a/check.py +++ b/check.py @@ -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): -- cgit v1.2.3-65-gdbad