summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/osc.py
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2016-08-10 10:08:16 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-19 16:50:22 +0100
commit6aa78bf3bd1f75728209e2d01faef31cb8887333 (patch)
treeb69f9370c155f3e63d73630f29e176bab27a7c48 /lib/bb/fetch2/osc.py
parent435c6fb838b9f38c0477bcc2f07c8ce22999132b (diff)
downloadbitbake-contrib-6aa78bf3bd1f75728209e2d01faef31cb8887333.tar.gz
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. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/osc.py')
-rw-r--r--lib/bb/fetch2/osc.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/bb/fetch2/osc.py b/lib/bb/fetch2/osc.py
index d051dfdaf..295abf953 100644
--- a/lib/bb/fetch2/osc.py
+++ b/lib/bb/fetch2/osc.py
@@ -88,23 +88,21 @@ class Osc(FetchMethod):
oscupdatecmd = self._buildosccommand(ud, d, "update")
logger.info("Update "+ ud.url)
# update sources there
- os.chdir(ud.moddir)
logger.debug(1, "Running %s", oscupdatecmd)
bb.fetch2.check_network_access(d, oscupdatecmd, ud.url)
- runfetchcmd(oscupdatecmd, d)
+ runfetchcmd(oscupdatecmd, d, workdir=ud.moddir)
else:
oscfetchcmd = self._buildosccommand(ud, d, "fetch")
logger.info("Fetch " + ud.url)
# check out sources there
bb.utils.mkdirhier(ud.pkgdir)
- os.chdir(ud.pkgdir)
logger.debug(1, "Running %s", oscfetchcmd)
bb.fetch2.check_network_access(d, oscfetchcmd, ud.url)
- runfetchcmd(oscfetchcmd, d)
+ runfetchcmd(oscfetchcmd, d, workdir=ud.pkgdir)
- os.chdir(os.path.join(ud.pkgdir + ud.path))
# tar them up to a defined filename
- runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d, cleanup = [ud.localpath])
+ runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d,
+ cleanup=[ud.localpath], workdir=os.path.join(ud.pkgdir + ud.path))
def supports_srcrev(self):
return False