summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/perforce.py
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2016-08-10 10:08:16 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-20 16:08:59 +0100
commitab09541d5517da9b1a23923ea8f5c26ddf745084 (patch)
treeb0b81a809ec783b7481c012b430b9f6618e87a73 /bitbake/lib/bb/fetch2/perforce.py
parenteefb4b66c8628fbf366ebc5c23cfe013c8fa3756 (diff)
downloadpoky-ab09541d5517da9b1a23923ea8f5c26ddf745084.tar.gz
bitbake: fetch2: preserve current working directory
Fix the methods in all fetchers so they don't change the current working directory of the calling process, which could lead to "changed cwd" warnings from bitbake. (Bitbake rev: 6aa78bf3bd1f75728209e2d01faef31cb8887333) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/perforce.py')
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index b8169f2cc9..50cb479096 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -168,15 +168,13 @@ class Perforce(FetchMethod):
168 168
169 bb.utils.remove(ud.pkgdir, True) 169 bb.utils.remove(ud.pkgdir, True)
170 bb.utils.mkdirhier(ud.pkgdir) 170 bb.utils.mkdirhier(ud.pkgdir)
171 os.chdir(ud.pkgdir)
172 171
173 for afile in filelist: 172 for afile in filelist:
174 p4fetchcmd = self._buildp4command(ud, d, 'print', afile) 173 p4fetchcmd = self._buildp4command(ud, d, 'print', afile)
175 bb.fetch2.check_network_access(d, p4fetchcmd) 174 bb.fetch2.check_network_access(d, p4fetchcmd)
176 runfetchcmd(p4fetchcmd, d) 175 runfetchcmd(p4fetchcmd, d, workdir=ud.pkgdir)
177 176
178 os.chdir(ud.pkgdir) 177 runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup=[ud.localpath], workdir=ud.pkgdir)
179 runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup = [ud.localpath])
180 178
181 def clean(self, ud, d): 179 def clean(self, ud, d):
182 """ Cleanup p4 specific files and dirs""" 180 """ Cleanup p4 specific files and dirs"""