summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/perforce.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/perforce.py')
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index fc4074d5a3..ac1bfc7df8 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -37,7 +37,7 @@ from bb.fetch2 import logger
37from bb.fetch2 import runfetchcmd 37from bb.fetch2 import runfetchcmd
38 38
39class Perforce(FetchMethod): 39class Perforce(FetchMethod):
40 def supports(self, url, ud, d): 40 def supports(self, ud, d):
41 return ud.type in ['p4'] 41 return ud.type in ['p4']
42 42
43 def doparse(url, d): 43 def doparse(url, d):
@@ -120,12 +120,12 @@ class Perforce(FetchMethod):
120 120
121 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d) 121 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
122 122
123 def download(self, loc, ud, d): 123 def download(self, ud, d):
124 """ 124 """
125 Fetch urls 125 Fetch urls
126 """ 126 """
127 127
128 (host, depot, user, pswd, parm) = Perforce.doparse(loc, d) 128 (host, depot, user, pswd, parm) = Perforce.doparse(ud.url, d)
129 129
130 if depot.find('/...') != -1: 130 if depot.find('/...') != -1:
131 path = depot[:depot.find('/...')] 131 path = depot[:depot.find('/...')]
@@ -158,7 +158,7 @@ class Perforce(FetchMethod):
158 tmpfile, errors = bb.process.run(data.getVar('MKTEMPDIRCMD', localdata, True) or "false") 158 tmpfile, errors = bb.process.run(data.getVar('MKTEMPDIRCMD', localdata, True) or "false")
159 tmpfile = tmpfile.strip() 159 tmpfile = tmpfile.strip()
160 if not tmpfile: 160 if not tmpfile:
161 raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", loc) 161 raise FetchError("Fetch: unable to create temporary directory.. make sure 'mktemp' is in the PATH.", ud.url)
162 162
163 if "label" in parm: 163 if "label" in parm:
164 depot = "%s@%s" % (depot, parm["label"]) 164 depot = "%s@%s" % (depot, parm["label"])
@@ -167,13 +167,13 @@ class Perforce(FetchMethod):
167 depot = "%s@%s" % (depot, cset) 167 depot = "%s@%s" % (depot, cset)
168 168
169 os.chdir(tmpfile) 169 os.chdir(tmpfile)
170 logger.info("Fetch " + loc) 170 logger.info("Fetch " + ud.url)
171 logger.info("%s%s files %s", p4cmd, p4opt, depot) 171 logger.info("%s%s files %s", p4cmd, p4opt, depot)
172 p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot)) 172 p4file, errors = bb.process.run("%s%s files %s" % (p4cmd, p4opt, depot))
173 p4file = [f.rstrip() for f in p4file.splitlines()] 173 p4file = [f.rstrip() for f in p4file.splitlines()]
174 174
175 if not p4file: 175 if not p4file:
176 raise FetchError("Fetch: unable to get the P4 files from %s" % depot, loc) 176 raise FetchError("Fetch: unable to get the P4 files from %s" % depot, ud.url)
177 177
178 count = 0 178 count = 0
179 179
@@ -191,7 +191,7 @@ class Perforce(FetchMethod):
191 191
192 if count == 0: 192 if count == 0:
193 logger.error() 193 logger.error()
194 raise FetchError("Fetch: No files gathered from the P4 fetch", loc) 194 raise FetchError("Fetch: No files gathered from the P4 fetch", ud.url)
195 195
196 runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath]) 196 runfetchcmd("tar -czf %s %s" % (ud.localpath, module), d, cleanup = [ud.localpath])
197 # cleanup 197 # cleanup