my @src_deps;
+my %src_file = (
+ 'scons' => 'scons.py',
+);
+
for $dir ('script', 'engine') {
my $pkg = $package_name{$dir};
#
# Run everything in the MANIFEST through the sed command we concocted.
#
- my $file;
- foreach $file (@files) {
- $env->Command("$build/$file", "$src/$file", "%SEDCOM");
+ foreach $b (@files) {
+ my $s = $src_file{$b} || $b;
+ $env->Command("$build/$b", "$src/$s", "%SEDCOM");
}
#
my %seen;
map($seen{$_}++, "MANIFEST", "setup.py");
@test_files = map(File::Spec->catfile($install, $_),
- grep($_ =~ /\.py$/ && ! $seen{$_}++, @files));
+ grep(!$seen{$_}++ &&
+ ($_ =~ /\.py$/ || $src_file{$_}), @files));
# We can get away with calling setup.py using a directory path
# like this because we put a preamble in it that will chdir()
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import os.path
import TestCmd
class TestFailed(Exception):
If they're not overridden by keyword arguments, this
initializes the object with the following default values:
- program = 'scons.py'
+ program = 'scons' if it exists,
+ else 'scons.py'
interpreter = 'python'
workdir = ''
is not necessary.
"""
if not kw.has_key('program'):
- kw['program'] = 'scons.py'
+ if os.path.exists('scons'):
+ kw['program'] = 'scons'
+ else:
+ kw['program'] = 'scons.py'
if not kw.has_key('interpreter'):
kw['interpreter'] = 'python'
if not kw.has_key('workdir'):
MANIFEST
-scons.py
+scons
setup.py
author = "Steven Knight",
author_email = "knight@baldmt.com",
url = "http://www.baldmt.com/scons",
- scripts = ["scons.py"])
+ scripts = ["scons"])
raise InternalError, 'error inside'
""")
test.run(arguments='-f SConstruct3', stderr = r"""Traceback \((most recent call|innermost) last\):
- File ".*scons\.py", line \d+, in \?
+ File ".*scons", line \d+, in \?
main\(\)
- File ".*scons\.py", line \d+, in main
+ File ".*scons", line \d+, in main
exec f in globals\(\)
File "SConstruct3", line \d+, in \?
raise InternalError, 'error inside'