[bitbake-devel] [PATCH v2] Fixes for fetcher cwd changes

Matt Madison matt at madison.systems
Wed Aug 10 17:08:15 UTC 2016


Here is a more complete patch to fix the working directory changes in
fetcher methods.  In most cases, the pattern was an os.chdir() call
followed by a runfetchcmd or other subprocess call, so I updated
runfetchcmd to take an extra keyword argument to set the cwd of the
child process.  For the remaining cases, the cwd is saved and restored.

The only exceptions are the try_mirror* methods, which look like
they're only used internally by other methods, and those callers
have been updated to preserve cwd.

This fixes my original issue with bitbake reporting 'changed cwd'
warnings from setscene tasks, and also fixes the bitbake-selftest
failures with my first patch (which were cause by dangling cwd
changes to temporary directories that got wiped after test cases
were finished).


Matt Madison (1):
  fetch2: preserve current working directory

 lib/bb/fetch2/__init__.py  | 21 +++++++++++----------
 lib/bb/fetch2/bzr.py       | 11 ++++-------
 lib/bb/fetch2/clearcase.py |  6 ++----
 lib/bb/fetch2/cvs.py       | 15 ++++++++-------
 lib/bb/fetch2/git.py       | 45 ++++++++++++++++++++-------------------------
 lib/bb/fetch2/gitannex.py  | 24 +++++++++++-------------
 lib/bb/fetch2/gitsm.py     | 23 ++++++++++-------------
 lib/bb/fetch2/hg.py        | 28 ++++++++++------------------
 lib/bb/fetch2/npm.py       | 22 +++++++---------------
 lib/bb/fetch2/osc.py       | 10 ++++------
 lib/bb/fetch2/perforce.py  |  6 ++----
 lib/bb/fetch2/repo.py      | 13 ++++++-------
 lib/bb/fetch2/svn.py       | 13 +++++--------
 13 files changed, 100 insertions(+), 137 deletions(-)

-- 
2.7.4




More information about the bitbake-devel mailing list