Cleaned up os.path imports a bit.
--HG-- extra : convert_revision : ee75bf9abd249ab053e804739cc50972475cd5b6
This commit is contained in:
parent
d725ff450d
commit
b96631e1a0
2 changed files with 7 additions and 11 deletions
12
SConstruct
12
SConstruct
|
@ -66,7 +66,7 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from os.path import isdir, join as joinpath
|
from os.path import isdir, isfile, join as joinpath
|
||||||
|
|
||||||
import SCons
|
import SCons
|
||||||
|
|
||||||
|
@ -521,8 +521,8 @@ Export('nonsticky_opts')
|
||||||
for base_dir in base_dir_list:
|
for base_dir in base_dir_list:
|
||||||
for root, dirs, files in os.walk(base_dir):
|
for root, dirs, files in os.walk(base_dir):
|
||||||
if 'SConsopts' in files:
|
if 'SConsopts' in files:
|
||||||
print "Reading", os.path.join(root, 'SConsopts')
|
print "Reading", joinpath(root, 'SConsopts')
|
||||||
SConscript(os.path.join(root, 'SConsopts'))
|
SConscript(joinpath(root, 'SConsopts'))
|
||||||
|
|
||||||
all_isa_list.sort()
|
all_isa_list.sort()
|
||||||
all_cpu_list.sort()
|
all_cpu_list.sort()
|
||||||
|
@ -712,7 +712,7 @@ for build_path in build_paths:
|
||||||
# $BUILD_ROOT/options/$BUILD_DIR so you can nuke
|
# $BUILD_ROOT/options/$BUILD_DIR so you can nuke
|
||||||
# $BUILD_ROOT/$BUILD_DIR without losing your options settings.
|
# $BUILD_ROOT/$BUILD_DIR without losing your options settings.
|
||||||
current_opts_file = joinpath(build_root, 'options', build_dir)
|
current_opts_file = joinpath(build_root, 'options', build_dir)
|
||||||
if os.path.isfile(current_opts_file):
|
if isfile(current_opts_file):
|
||||||
sticky_opts.files.append(current_opts_file)
|
sticky_opts.files.append(current_opts_file)
|
||||||
print "Using saved options file %s" % current_opts_file
|
print "Using saved options file %s" % current_opts_file
|
||||||
else:
|
else:
|
||||||
|
@ -720,7 +720,7 @@ for build_path in build_paths:
|
||||||
|
|
||||||
# Make sure the directory is there so we can create it later
|
# Make sure the directory is there so we can create it later
|
||||||
opt_dir = os.path.dirname(current_opts_file)
|
opt_dir = os.path.dirname(current_opts_file)
|
||||||
if not os.path.isdir(opt_dir):
|
if not isdir(opt_dir):
|
||||||
os.mkdir(opt_dir)
|
os.mkdir(opt_dir)
|
||||||
|
|
||||||
# Get default build options from source tree. Options are
|
# Get default build options from source tree. Options are
|
||||||
|
@ -728,7 +728,7 @@ for build_path in build_paths:
|
||||||
# overriden by 'default=' arg on command line.
|
# overriden by 'default=' arg on command line.
|
||||||
default_opts_file = joinpath('build_opts',
|
default_opts_file = joinpath('build_opts',
|
||||||
ARGUMENTS.get('default', build_dir))
|
ARGUMENTS.get('default', build_dir))
|
||||||
if os.path.isfile(default_opts_file):
|
if isfile(default_opts_file):
|
||||||
sticky_opts.files.append(default_opts_file)
|
sticky_opts.files.append(default_opts_file)
|
||||||
print "Options file %s not found,\n using defaults in %s" \
|
print "Options file %s not found,\n using defaults in %s" \
|
||||||
% (current_opts_file, default_opts_file)
|
% (current_opts_file, default_opts_file)
|
||||||
|
|
|
@ -32,11 +32,7 @@ import imp
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from os.path import basename
|
from os.path import basename, exists, isdir, isfile, join as joinpath
|
||||||
from os.path import isdir, join as joinpath
|
|
||||||
from os.path import exists
|
|
||||||
from os.path import isdir
|
|
||||||
from os.path import isfile
|
|
||||||
|
|
||||||
import SCons
|
import SCons
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue