summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Nelson <cnelson711@gmail.com>2014-09-15 08:01:42 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-23 20:20:39 +0100
commit5bf5a937b26896bedbfea78dd1d62bce5a26ac2a (patch)
tree8820219b85f166af1dceeb019795daed4b74b589
parent3b5b1703b77490116dda895b29737cea51a3d6a0 (diff)
downloadbitbake-5bf5a937b26896bedbfea78dd1d62bce5a26ac2a.tar.gz
fetch2/perforce: Use replace (1 line) instead of find (3 lines)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/perforce.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/bb/fetch2/perforce.py b/lib/bb/fetch2/perforce.py
index 47a4a5d3d..d079a33c6 100644
--- a/lib/bb/fetch2/perforce.py
+++ b/lib/bb/fetch2/perforce.py
@@ -103,19 +103,15 @@ class Perforce(FetchMethod):
def urldata_init(self, ud, d):
(host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
- base = path
- which = path.find('/...')
- if which != -1:
- base = path[:which]
-
- base = self._strip_leading_slashes(base)
+ base_path = path.replace('/...', '')
+ base_path = self._strip_leading_slashes(base_path)
if "label" in parm:
version = parm["label"]
else:
version = Perforce.getcset(d, path, host, user, pswd, parm)
- ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), version), d)
+ ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base_path.replace('/', '.'), version), d)
def download(self, ud, d):
"""