aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/perforce.py
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2018-06-05 12:13:50 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-15 09:10:48 +0100
commitefd5e35af4b08501c67e8b30f30d9457f6fdf610 (patch)
treea0810818afdb4a467f867da8be61b8e1f252f111 /lib/bb/fetch2/perforce.py
parent11b6a5d5c1b1bb0ce0c5bb3983610d13a3e8f84a (diff)
downloadbitbake-contrib-efd5e35af4b08501c67e8b30f30d9457f6fdf610.tar.gz
fetch2: unify the way fetchers determine DL_DIR and FETCHCMD
Currently there is quite some variation between the fetchers in terms of how they determine the subdirectory within DL_DIR and the base fetch command to run. Some rely on variables being set externally (e.g. from bitbake.conf in oe-core), some respect these external variables but provide fallback defaults and some use only hardcoded internal values. Try to unify the approach used across the various fetchers. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/perforce.py')
-rw-r--r--lib/bb/fetch2/perforce.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/bb/fetch2/perforce.py b/lib/bb/fetch2/perforce.py
index 3debad59f..903a8e61a 100644
--- a/lib/bb/fetch2/perforce.py
+++ b/lib/bb/fetch2/perforce.py
@@ -43,13 +43,9 @@ class Perforce(FetchMethod):
provided by the env, use it. If P4PORT is specified by the recipe, use
its values, which may override the settings in P4CONFIG.
"""
- ud.basecmd = d.getVar('FETCHCMD_p4')
- if not ud.basecmd:
- ud.basecmd = "/usr/bin/env p4"
+ ud.basecmd = d.getVar("FETCHCMD_p4") or "/usr/bin/env p4"
- ud.dldir = d.getVar('P4DIR')
- if not ud.dldir:
- ud.dldir = '%s/%s' % (d.getVar('DL_DIR'), 'p4')
+ ud.dldir = d.getVar("P4DIR") or (d.getVar("DL_DIR") + "/p4")
path = ud.url.split('://')[1]
path = path.split(';')[0]