aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2012-10-08 06:15:51 (GMT)
committerBrian Dolbec <dolsen@gentoo.org>2012-10-08 06:15:51 (GMT)
commit729923d4a2d5a22f6509de438953ef6035d38e20 (patch)
tree531bb1dbba640b7c7c4d233d9f8286ff51a6a67d
parentUpdate doctest data for config changes. (diff)
downloadlayman-729923d4a2d5a22f6509de438953ef6035d38e20.zip
layman-729923d4a2d5a22f6509de438953ef6035d38e20.tar.gz
layman-729923d4a2d5a22f6509de438953ef6035d38e20.tar.bz2
Fix bug 372583. Don't add redundant trailing slashes on src uri's where trailing slashes are required.
-rw-r--r--layman/overlays/bzr.py9
-rw-r--r--layman/overlays/darcs.py9
-rw-r--r--layman/overlays/git.py5
-rw-r--r--layman/overlays/mercurial.py9
-rw-r--r--layman/overlays/svn.py8
5 files changed, 32 insertions, 8 deletions
diff --git a/layman/overlays/bzr.py b/layman/overlays/bzr.py
index fb1fb24..5bda251 100644
--- a/layman/overlays/bzr.py
+++ b/layman/overlays/bzr.py
@@ -56,12 +56,17 @@ class BzrOverlay(OverlaySource):
cfg_opts = self.config["bzr_addopts"]
target = path([base, self.parent.name])
+ if self.src.endswith("/"):
+ src = self.src
+ else:
+ src = self.src + '/'
+
# bzr get SOURCE TARGET
if len(cfg_opts):
args = ['branch', cfg_opts,
- self.src + '/', target]
+ src, target]
else:
- args = ['branch', self.src + '/', target]
+ args = ['branch', src, target]
return self.postsync(
self.run_command(self.command(), args, cmd=self.type),
cwd=target)
diff --git a/layman/overlays/darcs.py b/layman/overlays/darcs.py
index d3eec6a..634681b 100644
--- a/layman/overlays/darcs.py
+++ b/layman/overlays/darcs.py
@@ -55,13 +55,18 @@ class DarcsOverlay(OverlaySource):
cfg_opts = self.config["darcs_addopts"]
target = path([base, self.parent.name])
+ if self.src.endswith("/"):
+ src = self.src
+ else:
+ src = self.src + '/'
+
# darcs get --partial SOURCE TARGET
if len(cfg_opts):
args = ['get', '--partial', cfg_opts,
- self.src + '/', target]
+ src, target]
else:
args = ['get', '--partial',
- self.src + '/', target]
+ src, target]
return self.postsync(
self.run_command(self.command(), args, cmd=self.type),
diff --git a/layman/overlays/git.py b/layman/overlays/git.py
index e15f26d..81e650c 100644
--- a/layman/overlays/git.py
+++ b/layman/overlays/git.py
@@ -53,7 +53,10 @@ class GitOverlay(OverlaySource):
def fix_git_source(source):
# http:// should get trailing slash, other protocols shouldn't
if source.split(':')[0] == 'http':
- return source + '/'
+ if source.endswith('/'):
+ return source
+ else:
+ return source + '/'
return source
cfg_opts = self.config["git_addopts"]
diff --git a/layman/overlays/mercurial.py b/layman/overlays/mercurial.py
index 0d8250e..5034993 100644
--- a/layman/overlays/mercurial.py
+++ b/layman/overlays/mercurial.py
@@ -56,11 +56,16 @@ class MercurialOverlay(OverlaySource):
cfg_opts = self.config["mercurial_addopts"]
target = path([base, self.parent.name])
+ if self.src.endswith("/"):
+ src = self.src
+ else:
+ src = self.src + '/'
+
# hg clone SOURCE TARGET
if len(cfg_opts):
- args = ['clone', cfg_opts, self.src + '/', target]
+ args = ['clone', cfg_opts, src, target]
else:
- args = ['clone', self.src + '/', target]
+ args = ['clone', src, target]
return self.postsync(
self.run_command(self.command(), args, cmd=self.type),
diff --git a/layman/overlays/svn.py b/layman/overlays/svn.py
index 9785025..4804925 100644
--- a/layman/overlays/svn.py
+++ b/layman/overlays/svn.py
@@ -67,7 +67,13 @@ class SvnOverlay(OverlaySource):
args.append('-q')
if len(cfg_opts):
args.append(cfg_opts)
- args.append(self.src + '/@')
+
+ if self.src.endswith("/"):
+ src = self.src + '@'
+ else:
+ src = self.src + '/@'
+
+ args.append(src)
args.append(self.target)
return self.postsync(