From ab09541d5517da9b1a23923ea8f5c26ddf745084 Mon Sep 17 00:00:00 2001 From: Matt Madison Date: Wed, 10 Aug 2016 10:08:16 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/perforce.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'bitbake/lib/bb/fetch2/perforce.py') 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): bb.utils.remove(ud.pkgdir, True) bb.utils.mkdirhier(ud.pkgdir) - os.chdir(ud.pkgdir) for afile in filelist: p4fetchcmd = self._buildp4command(ud, d, 'print', afile) bb.fetch2.check_network_access(d, p4fetchcmd) - runfetchcmd(p4fetchcmd, d) + runfetchcmd(p4fetchcmd, d, workdir=ud.pkgdir) - os.chdir(ud.pkgdir) - runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup = [ud.localpath]) + runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup=[ud.localpath], workdir=ud.pkgdir) def clean(self, ud, d): """ Cleanup p4 specific files and dirs""" -- cgit v1.2.3-54-g00ecf