diff options
author | Matt Madison <matt@madison.systems> | 2016-08-10 10:08:16 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-20 16:08:59 +0100 |
commit | ab09541d5517da9b1a23923ea8f5c26ddf745084 (patch) | |
tree | b0b81a809ec783b7481c012b430b9f6618e87a73 /bitbake/lib/bb/fetch2/osc.py | |
parent | eefb4b66c8628fbf366ebc5c23cfe013c8fa3756 (diff) | |
download | poky-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/osc.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/osc.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py index d051dfdafa..295abf953b 100644 --- a/bitbake/lib/bb/fetch2/osc.py +++ b/bitbake/lib/bb/fetch2/osc.py | |||
@@ -88,23 +88,21 @@ class Osc(FetchMethod): | |||
88 | oscupdatecmd = self._buildosccommand(ud, d, "update") | 88 | oscupdatecmd = self._buildosccommand(ud, d, "update") |
89 | logger.info("Update "+ ud.url) | 89 | logger.info("Update "+ ud.url) |
90 | # update sources there | 90 | # update sources there |
91 | os.chdir(ud.moddir) | ||
92 | logger.debug(1, "Running %s", oscupdatecmd) | 91 | logger.debug(1, "Running %s", oscupdatecmd) |
93 | bb.fetch2.check_network_access(d, oscupdatecmd, ud.url) | 92 | bb.fetch2.check_network_access(d, oscupdatecmd, ud.url) |
94 | runfetchcmd(oscupdatecmd, d) | 93 | runfetchcmd(oscupdatecmd, d, workdir=ud.moddir) |
95 | else: | 94 | else: |
96 | oscfetchcmd = self._buildosccommand(ud, d, "fetch") | 95 | oscfetchcmd = self._buildosccommand(ud, d, "fetch") |
97 | logger.info("Fetch " + ud.url) | 96 | logger.info("Fetch " + ud.url) |
98 | # check out sources there | 97 | # check out sources there |
99 | bb.utils.mkdirhier(ud.pkgdir) | 98 | bb.utils.mkdirhier(ud.pkgdir) |
100 | os.chdir(ud.pkgdir) | ||
101 | logger.debug(1, "Running %s", oscfetchcmd) | 99 | logger.debug(1, "Running %s", oscfetchcmd) |
102 | bb.fetch2.check_network_access(d, oscfetchcmd, ud.url) | 100 | bb.fetch2.check_network_access(d, oscfetchcmd, ud.url) |
103 | runfetchcmd(oscfetchcmd, d) | 101 | runfetchcmd(oscfetchcmd, d, workdir=ud.pkgdir) |
104 | 102 | ||
105 | os.chdir(os.path.join(ud.pkgdir + ud.path)) | ||
106 | # tar them up to a defined filename | 103 | # tar them up to a defined filename |
107 | runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath]) | 104 | runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, |
105 | cleanup=[ud.localpath], workdir=os.path.join(ud.pkgdir + ud.path)) | ||
108 | 106 | ||
109 | def supports_srcrev(self): | 107 | def supports_srcrev(self): |
110 | return False | 108 | return False |