From 05810ef9f0e1dc761317f909146f1a201c876a64 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Wed, 6 Feb 2008 01:34:08 +0000 Subject: Fixed URL normalization to make it compatible with py2.4 In py2.4 the function urlparse doesn't return a "named" tuple. --- CHANGES | 1 + RepSys/mirror.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 5a57363..cfed07f 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ to replace the default svn command - force svn+ssh:// URLs to be in BatchMode, in order to not have any interactivity at all with ssh +- fixed incompatibility with Python-2.4 on urlparse - fixed bad url used when using -v in getsrpm - make 'repsys submit' without package name or revision number work again - if REPSYS_CONF is set, /etc/repsys.conf and ~/.repsys/config will not be diff --git a/RepSys/mirror.py b/RepSys/mirror.py index 4fb40ce..5b114df 100644 --- a/RepSys/mirror.py +++ b/RepSys/mirror.py @@ -7,16 +7,16 @@ from RepSys.svn import SVN def _normdirurl(url): """normalize url for relocate_path needs""" parsed = urlparse.urlparse(url) - path = os.path.normpath(parsed.path) - newurl = urlparse.urlunparse((parsed.scheme, parsed.netloc, path, - parsed.params, parsed.query, parsed.fragment)) + path = os.path.normpath(parsed[2]) + newurl = urlparse.urlunparse((parsed[0], parsed[1], path, + parsed[3], parsed[4], parsed[5])) return newurl def _joinurl(url, relpath): parsed = urlparse.urlparse(url) - newpath = os.path.join(parsed.path, relpath) - newurl = urlparse.urlunparse((parsed.scheme, parsed.netloc, newpath, - parsed.params, parsed.query, parsed.fragment)) + newpath = os.path.join(parsed[2], relpath) + newurl = urlparse.urlunparse((parsed[0], parsed[1], newpath, + parsed[3], parsed[4], parsed[5])) return newurl def same_base(parent, url): -- cgit v1.2.1