frame = sys._getframe()
target_top = marker = []
while frame and target_top is marker:
- target_top = frame.f_locals.get('target_top',marker)
frame = frame.f_back
+ if frame : target_top = frame.f_locals.get('target_top',marker)
if target_top is marker:
SCons.Util.display("scons: WARNING: scons -u <target> will probably fail")
if not target_top:
target_top = '.'
+ if frame:
+ cdir = frame.f_locals.get('cdir', '.')
# END HACK
-
+
os.chdir(target_top)
+ cdir = os.path.normpath(cdir)
+ if cdir.startswith('../'):
+ SCons.Util.display("scons: WARNING: failed to undo -C option")
+ elif cdir != '.' and not cdir.startswith('/'):
+ os.chdir('/'.join(('..' for _ in cdir.split('/'))))
os.environ['SCONS_LIB_DIR'] = sconsengine
os.execv(sconsscript, sys.argv)