summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2017-05-26 23:53:54 -0700
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-07-21 08:15:19 +0200
commite5f718182f3c95e0219ae57f72facefeb7be98ef (patch)
tree7cd5e990cde0b6cf34e5f388ee0f3c805b9143f0
parentd689b785c49badb82db189c0765e4aa91bc28cd8 (diff)
downloadopenembedded-core-contrib-e5f718182f3c95e0219ae57f72facefeb7be98ef.tar.gz
recipeparse.py: restore cwd when the parsing is done
If we don't restore the current working directory, it may cause trouble for the calling function. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--layerindex/recipeparse.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/layerindex/recipeparse.py b/layerindex/recipeparse.py
index dd85bc38a6..f2a5235c8a 100644
--- a/layerindex/recipeparse.py
+++ b/layerindex/recipeparse.py
@@ -70,10 +70,13 @@ def init_parser(settings, branch, bitbakepath, enable_tracking=False, nocheckout
if not os.path.exists(settings.TEMP_BASE_DIR):
os.makedirs(settings.TEMP_BASE_DIR)
tempdir = tempfile.mkdtemp(dir=settings.TEMP_BASE_DIR)
+ saved_cwd = os.getcwd()
os.chdir(tempdir)
tinfoil = utils.setup_tinfoil(bitbakepath, enable_tracking)
+ os.chdir(saved_cwd)
+
# Ensure TMPDIR exists (or insane.bbclass will blow up trying to write to the QA log)
oe_tmpdir = tinfoil.config_data.getVar('TMPDIR', True)
if not os.path.exists(oe_tmpdir):