aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2008-02-06 01:34:08 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2008-02-06 01:34:08 +0000
commit05810ef9f0e1dc761317f909146f1a201c876a64 (patch)
treed031cc326238db112a2e9a808ca130941203900e
parentffdaa7d17062bf450a040b34056aaf0e096a9599 (diff)
downloadmgarepo-05810ef9f0e1dc761317f909146f1a201c876a64.tar
mgarepo-05810ef9f0e1dc761317f909146f1a201c876a64.tar.gz
mgarepo-05810ef9f0e1dc761317f909146f1a201c876a64.tar.bz2
mgarepo-05810ef9f0e1dc761317f909146f1a201c876a64.tar.xz
mgarepo-05810ef9f0e1dc761317f909146f1a201c876a64.zip
Fixed URL normalization to make it compatible with py2.4
In py2.4 the function urlparse doesn't return a "named" tuple.
-rw-r--r--CHANGES1
-rw-r--r--RepSys/mirror.py12
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):