summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Construct13
-rw-r--r--etc/TestSCons.py9
-rw-r--r--src/script/MANIFEST2
-rw-r--r--src/script/setup.py2
-rw-r--r--test/errors.py4
5 files changed, 20 insertions, 10 deletions
diff --git a/Construct b/Construct
index 658815d..853311c 100644
--- a/Construct
+++ b/Construct
@@ -116,6 +116,10 @@ $env = new cons( ENV => {
my @src_deps;
+my %src_file = (
+ 'scons' => 'scons.py',
+);
+
for $dir ('script', 'engine') {
my $pkg = $package_name{$dir};
@@ -130,9 +134,9 @@ for $dir ('script', 'engine') {
#
# 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");
}
#
@@ -197,7 +201,8 @@ for $dir ('script', 'engine') {
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()
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index fbc53ba..49c8f21 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -16,6 +16,7 @@ or attributes defined in this subclass.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import os.path
import TestCmd
class TestFailed(Exception):
@@ -40,7 +41,8 @@ class TestSCons(TestCmd.TestCmd):
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 = ''
@@ -51,7 +53,10 @@ class TestSCons(TestCmd.TestCmd):
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'):
diff --git a/src/script/MANIFEST b/src/script/MANIFEST
index 98e74a0..6fcf5eb 100644
--- a/src/script/MANIFEST
+++ b/src/script/MANIFEST
@@ -1,3 +1,3 @@
MANIFEST
-scons.py
+scons
setup.py
diff --git a/src/script/setup.py b/src/script/setup.py
index aa7b54d..46b09e3 100644
--- a/src/script/setup.py
+++ b/src/script/setup.py
@@ -18,4 +18,4 @@ setup(name = "scons",
author = "Steven Knight",
author_email = "knight@baldmt.com",
url = "http://www.baldmt.com/scons",
- scripts = ["scons.py"])
+ scripts = ["scons"])
diff --git a/test/errors.py b/test/errors.py
index 8399958..65dc372 100644
--- a/test/errors.py
+++ b/test/errors.py
@@ -33,9 +33,9 @@ test.write('SConstruct3', """
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'