summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorChad Nelson <cnelson711@gmail.com>2014-09-12 15:42:21 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-23 20:21:11 +0100
commit7ca8b65c3c9fdbfa2de9fbae0bcd36a32d956552 (patch)
tree8850441e5def28004112bb4dea9eb1b8cc9961f9 /bitbake/lib/bb/fetch2
parentff5fba8462151364a3834453ee5c861f471cf8d3 (diff)
downloadpoky-7ca8b65c3c9fdbfa2de9fbae0bcd36a32d956552.tar.gz
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>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index 9836bd7268..47a4a5d3d4 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -103,22 +103,19 @@ class Perforce(FetchMethod):
103 def urldata_init(self, ud, d): 103 def urldata_init(self, ud, d):
104 (host, path, user, pswd, parm) = Perforce.doparse(ud.url, d) 104 (host, path, user, pswd, parm) = Perforce.doparse(ud.url, d)
105 105
106 # If a label is specified, we use that as our filename
107
108 if "label" in parm:
109 ud.localfile = "%s.tar.gz" % (parm["label"])
110 return
111
112 base = path 106 base = path
113 which = path.find('/...') 107 which = path.find('/...')
114 if which != -1: 108 if which != -1:
115 base = path[:which-1] 109 base = path[:which]
116 110
117 base = self._strip_leading_slashes(base) 111 base = self._strip_leading_slashes(base)
112
113 if "label" in parm:
114 version = parm["label"]
115 else:
116 version = Perforce.getcset(d, path, host, user, pswd, parm)
118 117
119 cset = Perforce.getcset(d, path, host, user, pswd, parm) 118 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), version), d)
120
121 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
122 119
123 def download(self, ud, d): 120 def download(self, ud, d):
124 """ 121 """