def _main(args, parser):
targets = []
+ fs = SCons.Node.FS.default_fs
# Enable deprecated warnings by default.
SCons.Warnings._warningOut = _scons_internal_warning
SCons.Action.print_actions = None
if options.cache_disable:
def disable(self): pass
- SCons.Node.FS.default_fs.CacheDir = disable
+ fs.CacheDir = disable
if options.cache_force:
- SCons.Node.FS.default_fs.cache_force = 1
+ fs.cache_force = 1
if options.cache_show:
- SCons.Node.FS.default_fs.cache_show = 1
+ fs.cache_show = 1
if options.directory:
cdir = _create_path(options.directory)
try:
else:
raise SCons.Errors.UserError, "No SConstruct file found."
- SCons.Node.FS.default_fs.set_toplevel_dir(os.getcwd())
+ fs.set_toplevel_dir(os.getcwd())
scripts = []
if options.file:
raise SCons.Errors.UserError, "No SConstruct file found."
if scripts[0] == "-":
- d = SCons.Node.FS.default_fs.getcwd()
+ d = fs.getcwd()
else:
- d = SCons.Node.FS.default_fs.File(scripts[0]).dir
- SCons.Node.FS.default_fs.set_SConstruct_dir(d)
+ d = fs.File(scripts[0]).dir
+ fs.set_SConstruct_dir(d)
class Unbuffered:
def __init__(self, file):
global repositories
for rep in repositories:
- SCons.Node.FS.default_fs.Repository(rep)
+ fs.Repository(rep)
progress_display("scons: Reading SConscript files ...")
try:
start_time = time.time()
try:
for script in scripts:
- SCons.Script.SConscript.SConscript(script)
+ SCons.Script.SConscript._SConscript(fs, script)
except SCons.Errors.StopError, e:
# We had problems reading an SConscript file, such as it
# couldn't be copied in to the BuildDir. Since we're just
sys.exit(0)
progress_display("scons: done reading SConscript files.")
- SCons.Node.FS.default_fs.chdir(SCons.Node.FS.default_fs.Top)
+ fs.chdir(fs.Top)
if options.help_msg:
# They specified -h, but there was no Help() inside the
# used -u, -U or -D, we have to look up targets relative
# to the top, but we build whatever they specified.
if target_top:
- lookup_top = SCons.Node.FS.default_fs.Dir(target_top)
+ lookup_top = fs.Dir(target_top)
target_top = None
else:
# There are no targets specified on the command line,
if target_top:
if options.climb_up == 1:
# -u, local directory and below
- target_top = SCons.Node.FS.default_fs.Dir(target_top)
+ target_top = fs.Dir(target_top)
lookup_top = target_top
elif options.climb_up == 2:
# -D, all Default() targets
lookup_top = None
elif options.climb_up == 3:
# -U, local SConscript Default() targets
- target_top = SCons.Node.FS.default_fs.Dir(target_top)
+ target_top = fs.Dir(target_top)
def check_dir(x, target_top=target_top):
if hasattr(x, 'cwd') and not x.cwd is None:
cwd = x.cwd.srcnode()
targets = SCons.Environment.DefaultTargets
if targets is None:
- targets = [SCons.Node.FS.default_fs.Dir('.')]
+ targets = [fs.Dir('.')]
if not targets:
sys.stderr.write("scons: *** No targets specified and no Default() targets found. Stop.\n")
else:
node = SCons.Node.Alias.default_ans.lookup(x)
if node is None:
- node = SCons.Node.FS.default_fs.Entry(x,
- directory = ltop,
- create = 1)
+ node = fs.Entry(x, directory=ltop, create=1)
if ttop and not node.is_under(ttop):
if isinstance(node, SCons.Node.FS.Dir) and ttop.is_under(node):
node = ttop