mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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) (Bitbake rev: d865692e8b76a1da80c80788946978f150f2c34b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -48,7 +48,7 @@ class Perforce(FetchMethod):
|
|||||||
(user, pswd, host, port) = path.split('@')[0].split(":")
|
(user, pswd, host, port) = path.split('@')[0].split(":")
|
||||||
path = path.split('@')[1]
|
path = path.split('@')[1]
|
||||||
else:
|
else:
|
||||||
(host, port) = data.getVar('P4PORT', d).split(':')
|
(host, port) = d.getVar('P4PORT').split(':')
|
||||||
user = ""
|
user = ""
|
||||||
pswd = ""
|
pswd = ""
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ class Perforce(FetchMethod):
|
|||||||
if host:
|
if host:
|
||||||
p4opt += " -p %s" % (host)
|
p4opt += " -p %s" % (host)
|
||||||
|
|
||||||
p4date = data.getVar("P4DATE", d, True)
|
p4date = d.getVar("P4DATE", True)
|
||||||
if "revision" in parm:
|
if "revision" in parm:
|
||||||
depot += "#%s" % (parm["revision"])
|
depot += "#%s" % (parm["revision"])
|
||||||
elif "label" in parm:
|
elif "label" in parm:
|
||||||
@@ -89,7 +89,7 @@ class Perforce(FetchMethod):
|
|||||||
elif p4date:
|
elif p4date:
|
||||||
depot += "@%s" % (p4date)
|
depot += "@%s" % (p4date)
|
||||||
|
|
||||||
p4cmd = data.getVar('FETCHCMD_p4', d, True)
|
p4cmd = d.getVar('FETCHCMD_p4', True) or "p4"
|
||||||
logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot)
|
logger.debug(1, "Running %s%s changes -m 1 %s", p4cmd, p4opt, depot)
|
||||||
p4file, errors = bb.process.run("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
|
p4file, errors = bb.process.run("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
|
||||||
cset = p4file.strip()
|
cset = p4file.strip()
|
||||||
@@ -145,7 +145,7 @@ class Perforce(FetchMethod):
|
|||||||
if host:
|
if host:
|
||||||
p4opt += " -p %s" % (host)
|
p4opt += " -p %s" % (host)
|
||||||
|
|
||||||
p4cmd = data.getVar('FETCHCMD_p4', d, True)
|
p4cmd = d.getVar('FETCHCMD_p4', True) or "p4"
|
||||||
|
|
||||||
# create temp directory
|
# create temp directory
|
||||||
logger.debug(2, "Fetch: creating temporary directory")
|
logger.debug(2, "Fetch: creating temporary directory")
|
||||||
|
|||||||
Reference in New Issue
Block a user