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/clearcase.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/clearcase.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/clearcase.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/clearcase.py b/bitbake/lib/bb/fetch2/clearcase.py index ba83e7cb60..70e280a8dd 100644 --- a/bitbake/lib/bb/fetch2/clearcase.py +++ b/bitbake/lib/bb/fetch2/clearcase.py | |||
@@ -202,11 +202,10 @@ class ClearCase(FetchMethod): | |||
202 | 202 | ||
203 | def _remove_view(self, ud, d): | 203 | def _remove_view(self, ud, d): |
204 | if os.path.exists(ud.viewdir): | 204 | if os.path.exists(ud.viewdir): |
205 | os.chdir(ud.ccasedir) | ||
206 | cmd = self._build_ccase_command(ud, 'rmview'); | 205 | cmd = self._build_ccase_command(ud, 'rmview'); |
207 | logger.info("cleaning up [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname) | 206 | logger.info("cleaning up [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname) |
208 | bb.fetch2.check_network_access(d, cmd, ud.url) | 207 | bb.fetch2.check_network_access(d, cmd, ud.url) |
209 | output = runfetchcmd(cmd, d) | 208 | output = runfetchcmd(cmd, d, workdir=ud.ccasedir) |
210 | logger.info("rmview output: %s", output) | 209 | logger.info("rmview output: %s", output) |
211 | 210 | ||
212 | def need_update(self, ud, d): | 211 | def need_update(self, ud, d): |
@@ -241,11 +240,10 @@ class ClearCase(FetchMethod): | |||
241 | raise e | 240 | raise e |
242 | 241 | ||
243 | # Set configspec: Setting the configspec effectively fetches the files as defined in the configspec | 242 | # Set configspec: Setting the configspec effectively fetches the files as defined in the configspec |
244 | os.chdir(ud.viewdir) | ||
245 | cmd = self._build_ccase_command(ud, 'setcs'); | 243 | cmd = self._build_ccase_command(ud, 'setcs'); |
246 | logger.info("fetching data [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname) | 244 | logger.info("fetching data [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname) |
247 | bb.fetch2.check_network_access(d, cmd, ud.url) | 245 | bb.fetch2.check_network_access(d, cmd, ud.url) |
248 | output = runfetchcmd(cmd, d) | 246 | output = runfetchcmd(cmd, d, workdir=ud.viewdir) |
249 | logger.info("%s", output) | 247 | logger.info("%s", output) |
250 | 248 | ||
251 | # Copy the configspec to the viewdir so we have it in our source tarball later | 249 | # Copy the configspec to the viewdir so we have it in our source tarball later |