From: g0dil Date: Mon, 7 Sep 2009 08:12:25 +0000 (+0000) Subject: Ouch ... (fix last commit) X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=4f878fb70e70b724b615b957ec55e3d853c3a61b;p=senf.git Ouch ... (fix last commit) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1390 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/site_scons/site_init.py b/site_scons/site_init.py index 45eb2bb..dac80c8 100644 --- a/site_scons/site_init.py +++ b/site_scons/site_init.py @@ -36,16 +36,14 @@ if os.path.dirname(os.path.dirname(os.path.abspath(SCons.__file__))) != sconseng if not target_top: target_top = '.' if frame: - cdir = frame.f_locals.get('cdir', '') + cdir = frame.f_locals.get('cdir', '.') # END HACK os.chdir(target_top) - for dir in reversed(os.path.normpath(cdir).split('/')): - if dir == '..': - SCons.Utio.display("scons: WARNING: failed to undo -C option") - break - if dir == '.': - continue - os.chdir('..') + cdir = os.path.normpath(cdir) + if cdir.startswith('../'): + SCons.Util.display("scons: WARNING: failed to undo -C option") + elif cdir != '.': + os.chdir('/'.join(('..' for _ in cdir.split('/')))) os.environ['SCONS_LIB_DIR'] = sconsengine os.execv(sconsscript, sys.argv)