From 0afcc466ed8c7d03b059f4a5b54b6e67bd6d2814 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 20 Sep 2001 18:42:04 +0000 Subject: [PATCH] Install scons, not scons.py git-svn-id: http://scons.tigris.org/svn/scons/trunk@59 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- Construct | 13 +++++++++---- etc/TestSCons.py | 9 +++++++-- src/script/MANIFEST | 2 +- src/script/setup.py | 2 +- test/errors.py | 4 ++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Construct b/Construct index 658815de..853311cc 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 fbc53bac..49c8f21d 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 98e74a07..6fcf5ebd 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 aa7b54d4..46b09e38 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 8399958c..65dc3727 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' -- 2.26.2