aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/perforce.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-19 14:32:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-21 17:20:16 +0000
commit6a48474de9505a3700863f31839a7c53c5e18a8d (patch)
tree118f3ff841a9ebd9e93bf24bc9571ced36067a5e /lib/bb/fetch2/perforce.py
parent06590cfebbcf6565a17b80cc298e3ecdfaba4656 (diff)
downloadbitbake-6a48474de9505a3700863f31839a7c53c5e18a8d.tar.gz
fetch2: Stop passing around the pointless url parameter
There is no good reason to keep passing around the url parameter when its contained within urldata (ud). This is left around due to legacy reasons, some functions take it, some don't and its time to cleanup. This is fetcher internal API, there are a tiny number of external users of the internal API (buildhistory and distrodata) which can be fixed up after this change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/perforce.py')
-rw-r--r--lib/bb/fetch2/perforce.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bb/fetch2/perforce.py b/lib/bb/fetch2/perforce.py
index fc4074d5a..ac1bfc7df 100644
--- a/lib/bb/fetch2/perforce.py
+++ b/lib/bb/fetch2/perforce.py
@@ -37,7 +37,7 @@ from bb.fetch2 import logger
from bb.fetch2 import runfetchcmd
class Perforce(FetchMethod):
- def supports(self, url, ud, d):
+ def supports(self, ud, d):
return ud.type in ['p4']
def doparse(url, d):
@@ -120,12 +120,12 @@ class Perforce(FetchMethod):
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
- def download(self, loc, ud, d):
+ def download(self, ud, d):
"""
Fetch urls
"""
- (host, depot, user, pswd, parm) = Perforce.doparse(loc, d)
+ (host, depot, user, pswd, parm) = Perforce.doparse(ud.url, d)
if depot.find('/...') != -1:
path = depot[:depot.find('/...')]
@@ -158,7 +158,7 @@ class Perforce(FetchMethod):
tmpfile, errors = bb.process.run(data.getVar('MKTEMPDIRCMD', localdata, True) or "false")
tmpfile = tmpfile.strip()
if not tmpfile:
- raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", loc)
+ raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", ud.url)
if "label" in parm:
depot = "%s@%s" % (depot, parm["label"])
@@ -167,13 +167,13 @@ class Perforce(FetchMethod):
depot = "%s@%s" % (depot, cset)
os.chdir(tmpfile)
- logger.info("Fetch " + loc)
+ logger.info("Fetch " + ud.url)
logger.info("%s%s files %s", p4cmd, p4opt, depot)
p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot))
p4file = [f.rstrip() for f in p4file.splitlines()]
if not p4file:
- raise FetchError("Fetch: unable to get the P4 files from %s" % depot, loc)
+ raise FetchError("Fetch: unable to get the P4 files from %s" % depot, ud.url)
count = 0
@@ -191,7 +191,7 @@ class Perforce(FetchMethod):
if count == 0:
logger.error()
- raise FetchError("Fetch: No files gathered from the P4 fetch", loc)
+ raise FetchError("Fetch: No files gathered from the P4 fetch", ud.url)
runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath])
# cleanup