mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: fetch2/perforce: Fix localfile name if labels are used
I could apply the label "release_1.0" to a super project that contains
many sub projects. If my recipes have SRC_URI's that use that label but
grab different sub-folders, than there's a bug where the cached localfile
(tar.gz) will not be unique and reused at the wrong times.
SRC_URI = "p4://perforce::1234@//depot/SuperProject/MiniProjectAAA/...;label=release_1.0 \
p4://perforce::1234@//depot/SuperProject/MiniProjectBBB/...;label=release_1.0"
(Bitbake rev: 3b5b1703b77490116dda895b29737cea51a3d6a0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
ff5fba8462
commit
7ca8b65c3c
@@ -103,22 +103,19 @@ class Perforce(FetchMethod):
|
|||||||
def urldata_init(self, ud, d):
|
def urldata_init(self, ud, d):
|
||||||
(host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
|
(host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
|
||||||
|
|
||||||
# If a label is specified, we use that as our filename
|
|
||||||
|
|
||||||
if "label" in parm:
|
|
||||||
ud.localfile = "%s.tar.gz" % (parm["label"])
|
|
||||||
return
|
|
||||||
|
|
||||||
base = path
|
base = path
|
||||||
which = path.find('/...')
|
which = path.find('/...')
|
||||||
if which != -1:
|
if which != -1:
|
||||||
base = path[:which-1]
|
base = path[:which]
|
||||||
|
|
||||||
base = self._strip_leading_slashes(base)
|
base = self._strip_leading_slashes(base)
|
||||||
|
|
||||||
|
if "label" in parm:
|
||||||
|
version = parm["label"]
|
||||||
|
else:
|
||||||
|
version = Perforce.getcset(d, path, host, user, pswd, parm)
|
||||||
|
|
||||||
cset = Perforce.getcset(d, path, host, user, pswd, parm)
|
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), version), d)
|
||||||
|
|
||||||
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
|
|
||||||
|
|
||||||
def download(self, ud, d):
|
def download(self, ud, d):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user