Install scons, not scons.py
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 20 Sep 2001 18:42:04 +0000 (18:42 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 20 Sep 2001 18:42:04 +0000 (18:42 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@59 fdb21ef1-2011-0410-befe-b5e4ea1792b1

Construct
etc/TestSCons.py
src/script/MANIFEST
src/script/setup.py
test/errors.py

index 658815decef60bfda4f94bbfa8819ad632f60f8f..853311cc559c0cceb1d87ce78ec416f316b74952 100644 (file)
--- 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()
index fbc53baca6b29087d5f85bfd06bb9c5937b750d2..49c8f21d2e659615af610b5007c0ee707f066e3c 100644 (file)
@@ -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'):
index 98e74a074c891f54af84a0dee89bb2d51f87c0d4..6fcf5ebd3ef85eda3533391aeaa9c65df4e82ed2 100644 (file)
@@ -1,3 +1,3 @@
 MANIFEST
-scons.py
+scons
 setup.py
index aa7b54d48e3fadf14c4cb5169a77cffc0dab8081..46b09e38e1269ba1b6fdd46f18dce91e50c314c1 100644 (file)
@@ -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"])
index 8399958cfd43ec537081421da7ca651461afb085..65dc372772283269a4e6748095ea97d2322fa73e 100644 (file)
@@ -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'