diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-11 15:25:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-11 15:26:25 +0100 |
commit | 50067e069c8cbc0d339819494f22ae7623d47aa6 (patch) | |
tree | 3cdbfc1a51234e7620ff0a18eb0633cdd2ec3f97 /bitbake/lib/bb/fetch2 | |
parent | 56cd778eb021a3632aa6b2cb1ec53182512fd38e (diff) | |
download | poky-50067e069c8cbc0d339819494f22ae7623d47aa6.tar.gz |
bitbake: fetch2/perforce: Ensure command has a default
Ensure there is default command available if FETCHCMD_p4 isn't set.
Also clean up the getVar references whilst here.
(Bitbake rev: d150226d11d5f041f78c8c3ce4abc5465dbc81d8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/perforce.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py index 9329d72779..9836bd7268 100644 --- a/bitbake/lib/bb/fetch2/perforce.py +++ b/bitbake/lib/bb/fetch2/perforce.py | |||
@@ -48,7 +48,7 @@ class Perforce(FetchMethod): | |||
48 | (user, pswd, host, port) = path.split('@')[0].split(":") | 48 | (user, pswd, host, port) = path.split('@')[0].split(":") |
49 | path = path.split('@')[1] | 49 | path = path.split('@')[1] |
50 | else: | 50 | else: |
51 | (host, port) = data.getVar('P4PORT', d).split(':') | 51 | (host, port) = d.getVar('P4PORT').split(':') |
52 | user = "" | 52 | user = "" |
53 | pswd = "" | 53 | pswd = "" |
54 | 54 | ||
@@ -81,7 +81,7 @@ class Perforce(FetchMethod): | |||
81 | if host: | 81 | if host: |
82 | p4opt += " -p %s" % (host) | 82 | p4opt += " -p %s" % (host) |
83 | 83 | ||
84 | p4date = data.getVar("P4DATE", d, True) | 84 | p4date = d.getVar("P4DATE", True) |
85 | if "revision" in parm: | 85 | if "revision" in parm: |
86 | depot += "#%s" % (parm["revision"]) | 86 | depot += "#%s" % (parm["revision"]) |
87 | elif "label" in parm: | 87 | elif "label" in parm: |
@@ -89,7 +89,7 @@ class Perforce(FetchMethod): | |||
89 | elif p4date: | 89 | elif p4date: |
90 | depot += "@%s" % (p4date) | 90 | depot += "@%s" % (p4date) |
91 | 91 | ||
92 | p4cmd = data.getVar('FETCHCMD_p4', d, True) | 92 | p4cmd = d.getVar('FETCHCMD_p4', True) or "p4" |
93 | logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot) | 93 | logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot) |
94 | p4file, errors = bb.process.run("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) | 94 | p4file, errors = bb.process.run("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot)) |
95 | cset = p4file.strip() | 95 | cset = p4file.strip() |
@@ -145,7 +145,7 @@ class Perforce(FetchMethod): | |||
145 | if host: | 145 | if host: |
146 | p4opt += " -p %s" % (host) | 146 | p4opt += " -p %s" % (host) |
147 | 147 | ||
148 | p4cmd = data.getVar('FETCHCMD_p4', d, True) | 148 | p4cmd = d.getVar('FETCHCMD_p4', True) or "p4" |
149 | 149 | ||
150 | # create temp directory | 150 | # create temp directory |
151 | logger.debug(2, "Fetch: creating temporary directory") | 151 | logger.debug(2, "Fetch: creating temporary directory") |