From 9d7f8e2a206f8266fd0766b6161dbd1bf6b787a7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 19 Nov 2013 14:32:08 +0000 Subject: bitbake: 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. (Bitbake rev: 6a48474de9505a3700863f31839a7c53c5e18a8d) Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/perforce.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/fetch2/perforce.py') diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py index fc4074d5a3..ac1bfc7df8 100644 --- a/bitbake/lib/bb/fetch2/perforce.py +++ b/bitbake/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 -- cgit v1.2.3-54-g00ecf