aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-06-12 18:36:37 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-06-12 18:36:37 +0000
commit01674a4621a88b56c91ca3ad430a441cf6226c64 (patch)
treec48988c17aed75f90634a17b1e3041b07ae9031e
parent4b66a3a0f18650052127dbc9ba87f53c9ceca2cf (diff)
downloadmgarepo-01674a4621a88b56c91ca3ad430a441cf6226c64.tar
mgarepo-01674a4621a88b56c91ca3ad430a441cf6226c64.tar.gz
mgarepo-01674a4621a88b56c91ca3ad430a441cf6226c64.tar.bz2
mgarepo-01674a4621a88b56c91ca3ad430a441cf6226c64.tar.xz
mgarepo-01674a4621a88b56c91ca3ad430a441cf6226c64.zip
Don't force "/" at the end of URLs
-rw-r--r--RepSys/mirror.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/RepSys/mirror.py b/RepSys/mirror.py
index 29b8bf5..0c45c9e 100644
--- a/RepSys/mirror.py
+++ b/RepSys/mirror.py
@@ -8,7 +8,6 @@ def _normdirurl(url):
"""normalize url for relocate_path needs"""
parsed = urlparse.urlparse(url)
path = os.path.normpath(parsed.path)
- path += "/" # assuming we always deal with directories
newurl = urlparse.urlunparse((parsed.scheme, parsed.netloc, path,
parsed.params, parsed.query, parsed.fragment))
return newurl
@@ -31,7 +30,7 @@ def relocate_path(oldparent, newparent, url):
oldparent = _normdirurl(oldparent)
newparent = _normdirurl(newparent)
url = _normdirurl(url)
- subpath = url[len(oldparent):]
+ subpath = url[len(oldparent)+1:]
newurl = _joinurl(newparent, subpath) # subpath usually gets / at begining
return newurl