Run setup.py on the unpacked .tar.gz for testing.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 17 Sep 2001 04:57:00 +0000 (04:57 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 17 Sep 2001 04:57:00 +0000 (04:57 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@52 fdb21ef1-2011-0410-befe-b5e4ea1792b1

41 files changed:
Construct
doc/Conscript
etc/Conscript
etc/TestSCons.py
runtest.py
src/MANIFEST [deleted file]
src/engine/MANIFEST [new file with mode: 0644]
src/engine/SCons/.aeignore [moved from src/scons/.aeignore with 100% similarity]
src/engine/SCons/Builder.py [moved from src/scons/Builder.py with 94% similarity]
src/engine/SCons/BuilderTests.py [moved from src/scons/BuilderTests.py with 79% similarity]
src/engine/SCons/Defaults.py [moved from src/scons/Defaults.py with 55% similarity]
src/engine/SCons/Environment.py [moved from src/scons/Environment.py with 97% similarity]
src/engine/SCons/EnvironmentTests.py [moved from src/scons/EnvironmentTests.py with 97% similarity]
src/engine/SCons/Errors.py [moved from src/scons/Errors.py with 88% similarity]
src/engine/SCons/ErrorsTests.py [moved from src/scons/ErrorsTests.py with 70% similarity]
src/engine/SCons/Job.py [moved from src/scons/Job.py with 99% similarity]
src/engine/SCons/JobTests.py [moved from src/scons/JobTests.py with 96% similarity]
src/engine/SCons/Node/.aeignore [moved from src/scons/Node/.aeignore with 100% similarity]
src/engine/SCons/Node/FS.py [moved from src/scons/Node/FS.py with 97% similarity]
src/engine/SCons/Node/FS/.aeignore [moved from src/scons/Node/FS/.aeignore with 100% similarity]
src/engine/SCons/Node/FSTests.py [moved from src/scons/Node/FSTests.py with 87% similarity]
src/engine/SCons/Node/NodeTests.py [moved from src/scons/Node/NodeTests.py with 91% similarity]
src/engine/SCons/Node/__init__.py [moved from src/scons/Node/__init__.py with 83% similarity]
src/engine/SCons/Scanner/.aeignore [moved from src/scons/Scanner/.aeignore with 100% similarity]
src/engine/SCons/Scanner/C.py [moved from src/scons/Scanner/C.py with 96% similarity]
src/engine/SCons/Scanner/CTests.py [moved from src/scons/Scanner/CTests.py with 91% similarity]
src/engine/SCons/Scanner/ScannerTests.py [moved from src/scons/Scanner/ScannerTests.py with 91% similarity]
src/engine/SCons/Scanner/__init__.py [moved from src/scons/Scanner/__init__.py with 96% similarity]
src/engine/SCons/Sig/.aeignore [moved from src/scons/Sig/.aeignore with 100% similarity]
src/engine/SCons/Sig/MD5.py [moved from src/scons/Sig/MD5.py with 89% similarity]
src/engine/SCons/Sig/MD5Tests.py [moved from src/scons/Sig/MD5Tests.py with 72% similarity]
src/engine/SCons/Sig/TimeStamp.py [moved from src/scons/Sig/TimeStamp.py with 90% similarity]
src/engine/SCons/Sig/TimeStampTests.py [moved from src/scons/Sig/TimeStampTests.py with 79% similarity]
src/engine/SCons/Sig/__init__.py [moved from src/scons/Sig/__init__.py with 50% similarity]
src/engine/SCons/__init__.py [moved from src/scons/__init__.py with 58% similarity]
src/engine/SCons/exitfuncs.py [moved from src/scons/exitfuncs.py with 92% similarity]
src/engine/setup.py [new file with mode: 0644]
src/script/MANIFEST [new file with mode: 0644]
src/script/scons.py [moved from src/scons.py with 96% similarity]
src/script/setup.py [moved from src/setup.py with 92% similarity]
test/exitfns.py

index d12673f4d6c5b194cd1773c8e5975cbac03b6060..a7e6a77ee6f36528ea0c89c1ed884d5c3b1d04a1 100644 (file)
--- a/Construct
+++ b/Construct
@@ -5,11 +5,6 @@
 #
 $project = 'scons';
 
-$env = new cons( ENV => {
-                         AEGIS_PROJECT => $ENV{AEGIS_PROJECT},
-                         PATH => $ENV{PATH},
-                       } );
-
 Default qw( . );
 
 #
@@ -65,74 +60,140 @@ pop @arr if $#arr >= 2;
 map {s/^[CD]//, s/^0*(\d\d)$/$1/} @arr;
 $version = join('.', @arr);
 
-#
-# Use %(-%) around the date so date changes don't cause rebuilds.
-#
-$sed_cmd = "sed" .
-       " %( -e 's+__DATE__+$date+' %)" .
-       " -e 's+__DEVELOPER__+$developer+'" .
-       " -e 's+__REVISION__+$revision+'" .
-       " -e 's+__VERSION__+$version+'" .
-       " %< > %>";
+chomp($python_ver = `python -c 'import sys; print sys.version[0:3]'`);
 
-#
-# Run everything in the MANIFEST through the sed command we concocted.
-#
-chomp(@files = `cat src/MANIFEST`);
 
-foreach $file (@files) {
-    Command $env "build/$file", "src/$file", $sed_cmd;
-}
+use Cwd;
+$test_dir = File::Spec->catfile(cwd, "build", "test");
 
-#
-# Use the Python distutils to generate the packages.
-#
-$tar_gz = "build/dist/$project-$version.tar.gz";
+%package_name = (
+    'script'   => $project,
+    'engine'   => "$project-pylib",
+);
 
-@setup_args = ('bdist sdist');
+$test_bin_dir = File::Spec->catfile($test_dir, "bin");
+$test_lib_dir = File::Spec->catfile($test_dir,
+                                   "lib",
+                                   "python${python_ver}",
+                                   "site-packages"),
 
-@targets = (
-    "build/dist/$project-$version.linux-i686.tar.gz",
-    $tar_gz,
+%install_dir = (
+    'script'   => $test_bin_dir,
+    'engine'   => $test_lib_dir,
 );
 
-if ($rpm) {
-    push(@setup_args, 'bdist_rpm');
+$env = new cons( ENV => {
+                         AEGIS_PROJECT => $ENV{AEGIS_PROJECT},
+                         PATH => $ENV{PATH},
+                       },
 
-    push(@targets,
-       "build/build/bdist.linux-i686/rpm/SOURCES/$project-$version.tar.gz",
-       "build/build/bdist.linux-i686/rpm/SPECS/$project.spec",
-       "build/dist/$project-$version-1.src.rpm",
-       "build/dist/$project-$version-1.noarch.rpm",
-    );
-};
+                TEST_BIN_DIR   => $test_bin_dir,
+                TEST_LIB_DIR   => $test_lib_dir,
+
+                DATE           => $date,
+                DEVELOPER      => $developer,
+                REVISION       => $revision,
+                VERSION        => $version,
+
+                SED            => 'sed',
+                                  # Use %(-%) around the date so date
+                                  # changes don't cause rebuilds.
+                SEDFLAGS       => " %( -e 's+__DATE__+%DATE+' %)" .
+                                  " -e 's+__DEVELOPER__+%DEVELOPER+'" .
+                                  " -e 's+__REVISION__+%REVISION+'" .
+                                  " -e 's+__VERSION__+%VERSION+'",
+                SEDCOM         => "%SED %SEDFLAGS %< > %>",
+               );
+
+my @src_deps;
 
+for $dir ('script', 'engine') {
 
-$env->Command([@targets],
-             map("build/$_", @files),
-             qq(rm -rf build/build build/dist/*
-                cd build && python setup.py @setup_args)
+    my $pkg = $package_name{$dir};
+    my $install = $install_dir{$dir};
+
+    my $build = "build/$dir";
+    my $src = "src/$dir";
+
+    my @files;
+    chomp(@files = `cat src/$dir/MANIFEST`);
+
+    #
+    # Run everything in the MANIFEST through the sed command we concocted.
+    #
+    my $file;
+    foreach $file (@files) {
+       $env->Command("$build/$file", "$src/$file", "%SEDCOM");
+    }
+
+    #
+    # Use the Python distutils to generate the packages.
+    #
+    my $tar_gz = "$build/dist/$pkg-$version.tar.gz";
+
+    push(@src_deps, $tar_gz);
+
+    my @setup_args = ('bdist sdist');
+
+    my @targets = (
+       "$build/dist/$pkg-$version.linux-i686.tar.gz",
+       $tar_gz,
+    );
+
+    if ($rpm) {
+       push(@setup_args, 'bdist_rpm');
+
+       # XXX "$build/build/bdist.linux-i686/rpm/SOURCES/$pkg-$version.tar.gz",
+       # XXX "$build/build/bdist.linux-i686/rpm/SPECS/$pkg.spec",
+       push(@targets,
+           "$build/dist/$pkg-$version-1.src.rpm",
+           "$build/dist/$pkg-$version-1.noarch.rpm",
+       );
+    };
+
+    $env->Command([@targets],
+             map("$build/$_", @files),
+             qq(rm -rf $build/build $build/dist/*
+                cd $build && python setup.py @setup_args)
             );
 
-$env->Depends([@targets], 'build/MANIFEST');
+    $env->Depends([@targets], "$build/MANIFEST");
 
-#
-# Unpack the .tar.gz created by the distutils into build/test, and
-# add the TestCmd.py module.  The runtest.py script will set PYTHONPATH
-# so that the tests only look under build/test.  This makes sure that
-# our tests pass with what we really packaged, not because of something
-# hanging around in the development directory.
-#
-$test_dir = "build/test";
+    $env->Install("build/dist", @targets);
 
-@test_files = map("$test_dir/$project-$version/$_", @files);
+    #
+    # Unpack the .tar.gz created by the distutils into build/unpack.
+    #
+    my $unpack = "build/unpack";
 
-Command $env [@test_files], $tar_gz, qq(
-    rm -rf $test_dir/$project-$version
-    tar zxf %< -C $test_dir
-);
+    my @unpack_files = map("$unpack/$pkg-$version/$_", @files);
 
-Export qw( env test_dir );
+    Command $env [@unpack_files], $tar_gz, qq(
+       rm -rf $unpack/$pkg-$version
+       tar zxf %< -C $unpack
+    );
+
+    #
+    # Run setup.py in the unpacked subdirectory to "install" everything
+    # into our build/test subdirectory.  Auxiliary modules that we need
+    # (TestCmd.py, TestSCons.py, unittest.py) will be copied in by
+    # etc/Conscript.  The runtest.py script will set PYTHONPATH so that
+    # the tests only look under build/test.  This makes sure that our
+    # tests pass with what we really packaged, not because of something
+    # hanging around in the development directory.
+    #
+    my %seen;
+    map($seen{$_}++, "MANIFEST", "setup.py");
+    @test_files = map(File::Spec->catfile($install, $_),
+                       grep($_ =~ /\.py$/ && ! $seen{$_}++, @files));
+
+    Command $env [@test_files], @unpack_files, qq(
+       rm -rf $install
+       cd $unpack/$pkg-$version && python setup.py install --prefix=$test_dir
+    );
+}
+
+Export qw( env );
 
 Build "etc/Conscript";
 
@@ -142,8 +203,6 @@ Build "etc/Conscript";
 if ($jw) {
     Link 'build/doc' => 'doc';
 
-    Export qw( date env revision version );
-
     Build 'build/doc/Conscript';
 }
 
@@ -172,11 +231,11 @@ if ($change) {
        chomp(@src_files);
 
        foreach $file (@src_files) {
-           $env->Command("build/$project-src/$file", $file, $sed_cmd);
+           $env->Command("build/$project-src/$file", $file, "%SEDCOM");
        }
 
        $env->Command("build/dist/$project-src-$version.tar.gz",
-                     $tar_gz,
+                     @src_deps,
                      map("build/$project-src/$_", @src_files),
                      qq(
                rm -rf build/$project-src-$version
index 0ca7999e9bb86120d144037b7edaa93528b4aa8b..9e5f0d9d44a7d9522330e30393d0ba29fd8eb9db 100644 (file)
@@ -2,17 +2,12 @@
 # Conscript file for building SCons documentation.
 #
 
-Import qw(
-    date
-    env
-    revision
-    version
-);
+Import qw( env );
 
 #
 #
 #
-$doc_tar_gz = "#build/dist/scons-doc-$version.tar.gz";
+$doc_tar_gz = "#build/dist/scons-doc-${\$env->{VERSION}}.tar.gz";
 
 #
 # We'll only try to build text files (for some documents)
@@ -33,9 +28,9 @@ print FILE <<_EOF_;
 <!--
 THIS IS AN AUTOMATICALLY-GENERATED FILE.  DO NOT EDIT.
 -->
-<!ENTITY build_date "$date">
-<!ENTITY build_version "$version">
-<!ENTITY build_revision "$revision">
+<!ENTITY build_date "${\$env->{DATE}}">
+<!ENTITY build_version "${\$env->{VERSION}}">
+<!ENTITY build_revision "${\$env->{REVISION}}">
 _EOF_
 close(FILE);
 
index 5c4efc5530e11ece483387562c3ac61883997336..c1a79424d45af7db9e7b8802bb337347ea48d38c 100644 (file)
@@ -4,8 +4,8 @@
 # of stuff to work on SCons.
 #
 
-Import qw( env test_dir );
+Import qw( env );
 
 @modules = qw(TestCmd.py TestSCons.py unittest.py);
 
-$env->Install("#$test_dir", @modules);
+$env->Install($env->{TEST_LIB_DIR}, @modules);
index b1eeae601a5b83141db33d78de9ee1a9f4f35160..dcd462a0a0bccb7ce30c3b7d099921e057d86153 100644 (file)
@@ -84,6 +84,11 @@ class TestSCons(TestCmd.TestCmd):
            print "STDERR ============"
            print self.stderr()
            raise
+       if self.status:
+           print self.progam + " returned " + (self.status >> 8)
+           print "STDERR ============"
+           print self.stderr()
+           raise TestFailed
        if stdout and not self.match(self.stdout(), stdout):
            print "Expected STDOUT =========="
            print stdout
index 965e24c9e23e372e3b65e379aa5a1a83659a1985..9542e78e163f72b86ec3c699c35123617814ec6e 100644 (file)
@@ -100,18 +100,20 @@ if build == 'aegis':
 
     version = aegis_to_version(version)
 
-    build_test = os.path.join(cwd, "build", "test")
-    scons_dir = os.path.join(build_test, "scons-" + version)
+    scons_dir = os.path.join(cwd, 'build', 'test', 'bin')
 
-    os.environ['PYTHONPATH'] = string.join([scons_dir,
-                                           build_test],
-                                          os.pathsep)
+    os.environ['PYTHONPATH'] = os.path.join(cwd,
+                                           'build',
+                                           'test',
+                                           'lib',
+                                           'python' + sys.version[0:3],
+                                           'site-packages')
 
 else:
 
-    scons_dir = os.path.join(cwd, 'src')
+    scons_dir = os.path.join(cwd, 'src', 'script')
 
-    os.environ['PYTHONPATH'] = string.join([os.path.join(cwd, 'src'),
+    os.environ['PYTHONPATH'] = string.join([os.path.join(cwd, 'src', 'engine'),
                                            os.path.join(cwd, 'etc')],
                                           os.pathsep)
 
diff --git a/src/MANIFEST b/src/MANIFEST
deleted file mode 100644 (file)
index 33e888c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-MANIFEST
-scons/__init__.py
-scons/Builder.py
-scons/Defaults.py
-scons/Environment.py
-scons/Errors.py
-scons/Job.py
-scons/exitfuncs.py
-scons/Node/__init__.py
-scons/Node/FS.py
-scons/Scanner/__init__.py
-scons/Scanner/C.py
-scons/Sig/__init__.py
-scons/Sig/MD5.py
-scons/Sig/TimeStamp.py
-scons.py
-setup.py
diff --git a/src/engine/MANIFEST b/src/engine/MANIFEST
new file mode 100644 (file)
index 0000000..51c6822
--- /dev/null
@@ -0,0 +1,16 @@
+MANIFEST
+SCons/__init__.py
+SCons/Builder.py
+SCons/Defaults.py
+SCons/Environment.py
+SCons/Errors.py
+SCons/Job.py
+SCons/exitfuncs.py
+SCons/Node/__init__.py
+SCons/Node/FS.py
+SCons/Scanner/__init__.py
+SCons/Scanner/C.py
+SCons/Sig/__init__.py
+SCons/Sig/MD5.py
+SCons/Sig/TimeStamp.py
+setup.py
similarity index 94%
rename from src/scons/Builder.py
rename to src/engine/SCons/Builder.py
index 8b19bd52ffaa58e3527af5e6d630e29022b4880b..f1ab10074f3bdaab00ac78bdcf50d50777b60f0d 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Builder
+"""SCons.Builder
 
 XXX
 
@@ -9,8 +9,8 @@ __revision__ = "Builder.py __REVISION__ __DATE__ __DEVELOPER__"
 
 
 import os
+import SCons.Node.FS
 import types
-from scons.Node.FS import Dir, File, lookup
 
 
 
@@ -23,7 +23,7 @@ class Builder:
                        action = None,
                        input_suffix = None,
                        output_suffix = None,
-                       node_class = File):
+                       node_class = SCons.Node.FS.File):
        self.name = name
        self.action = Action(action)
        self.insuffix = input_suffix
@@ -38,7 +38,7 @@ class Builder:
        return cmp(self.__dict__, other.__dict__)
 
     def __call__(self, env, target = None, source = None):
-       node = lookup(self.node_class, target)
+       node = SCons.Node.FS.lookup(self.node_class, target)
        node.builder_set(self)
        node.env_set(self)
        node.sources = source   # XXX REACHING INTO ANOTHER OBJECT
similarity index 79%
rename from src/scons/BuilderTests.py
rename to src/engine/SCons/BuilderTests.py
index 822b64c0dcf7eec18c2555aa7ac02c2b3e7b1462..67435bc07b7e4acb546678e2857fd47ff6bc0e5d 100644 (file)
@@ -4,7 +4,7 @@ import sys
 import unittest
 
 import TestCmd
-from scons.Builder import Builder, CommandAction, FunctionAction
+import SCons.Builder
 
 
 # Initial setup of the common environment for all tests,
@@ -34,16 +34,16 @@ class BuilderTestCase(unittest.TestCase):
 
        Verify that we can retrieve the supplied action attribute.
        """
-       builder = Builder(action = "foo")
+       builder = SCons.Builder.Builder(action = "foo")
        assert builder.action.command == "foo"
 
     def test_cmp(self):
        """Test simple comparisons of Builder objects
        """
-       b1 = Builder(input_suffix = '.o')
-       b2 = Builder(input_suffix = '.o')
+       b1 = SCons.Builder.Builder(input_suffix = '.o')
+       b2 = SCons.Builder.Builder(input_suffix = '.o')
        assert b1 == b2
-       b3 = Builder(input_suffix = '.x')
+       b3 = SCons.Builder.Builder(input_suffix = '.x')
        assert b1 != b3
        assert b2 != b3
 
@@ -54,7 +54,7 @@ class BuilderTestCase(unittest.TestCase):
        and one is an internal Python function.
        """
        cmd = "python %s %s xyzzy" % (act_py, outfile)
-       builder = Builder(action = cmd)
+       builder = SCons.Builder.Builder(action = cmd)
        builder.execute()
        assert test.read(outfile, 'r') == "act.py: xyzzy\n"
 
@@ -65,7 +65,7 @@ class BuilderTestCase(unittest.TestCase):
            f.close()
            return not None
 
-       builder = Builder(action = function)
+       builder = SCons.Builder.Builder(action = function)
        builder.execute(out = outfile)
        assert test.read(outfile, 'r') == "function\n"
 
@@ -75,15 +75,15 @@ class BuilderTestCase(unittest.TestCase):
        Make sure that the '.' separator is appended to the
        beginning if it isn't already present.
        """
-       builder = Builder(input_suffix = '.c')
+       builder = SCons.Builder.Builder(input_suffix = '.c')
        assert builder.insuffix == '.c'
-       builder = Builder(input_suffix = 'c')
+       builder = SCons.Builder.Builder(input_suffix = 'c')
        assert builder.insuffix == '.c'
 
     def test_name(self):
        """Test Builder creation with a specified name
        """
-       builder = Builder(name = 'foo')
+       builder = SCons.Builder.Builder(name = 'foo')
        assert builder.name == 'foo'
 
     def test_node_class(self):
@@ -91,7 +91,7 @@ class BuilderTestCase(unittest.TestCase):
        """
        class Foo:
                pass
-       builder = Builder(node_class = Foo)
+       builder = SCons.Builder.Builder(node_class = Foo)
        assert builder.node_class is Foo
 
     def test_outsuffix(self):
@@ -100,9 +100,9 @@ class BuilderTestCase(unittest.TestCase):
        Make sure that the '.' separator is appended to the
        beginning if it isn't already present.
        """
-       builder = Builder(input_suffix = '.o')
+       builder = SCons.Builder.Builder(input_suffix = '.o')
        assert builder.insuffix == '.o'
-       builder = Builder(input_suffix = 'o')
+       builder = SCons.Builder.Builder(input_suffix = 'o')
        assert builder.insuffix == '.o'
 
 
similarity index 55%
rename from src/scons/Defaults.py
rename to src/engine/SCons/Defaults.py
index 0aa2b82e0687089eb9c69eda3836d197d44a86a9..56a15f75cdf1d26c80acc17d15e6354d4907a232 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Defaults
+"""SCons.Defaults
 
 Builders and other things for the local site.  Here's where we'll
 duplicate the functionality of autoconf until we move it into the
@@ -10,11 +10,13 @@ __revision__ = "local.py __REVISION__ __DATE__ __DEVELOPER__"
 
 
 
-from scons.Builder import Builder
+import SCons.Builder
 
 
 
-Object = Builder(name = 'Object', action = 'cc -c -o %(target)s %(source)s')
-Program = Builder(name = 'Program', action = 'cc -o %(target)s %(source)s')
+Object = SCons.Builder.Builder(name = 'Object',
+                               action = 'cc -c -o %(target)s %(source)s')
+Program = SCons.Builder.Builder(name = 'Program',
+                               action = 'cc -o %(target)s %(source)s')
 
 Builders = [Object, Program]
similarity index 97%
rename from src/scons/Environment.py
rename to src/engine/SCons/Environment.py
index 9b050d16f43b49eaf68badda2ad5870370355aef..a3fe27a4f1df08d1be7096b970bcd58d71b6cbca 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Environment
+"""SCons.Environment
 
 XXX
 
@@ -59,8 +59,8 @@ class Environment:
            if not type(builders) is types.ListType:
                kw['BUILDERS'] = [builders]
        else:
-           import scons.Defaults
-           kw['BUILDERS'] = scons.Defaults.Builders[:]
+           import SCons.Defaults
+           kw['BUILDERS'] = SCons.Defaults.Builders[:]
        self.Dictionary.update(copy.deepcopy(kw))
 
        class BuilderWrapper:
similarity index 97%
rename from src/scons/EnvironmentTests.py
rename to src/engine/SCons/EnvironmentTests.py
index 2f13c8198d0f7289d56276e2663f584354357ecc..6ac4cb72fe3eda14aed39a65a5d54d059422ef0d 100644 (file)
@@ -1,9 +1,9 @@
-__revision__ = "EnivronmentTests.py __REVISION__ __DATE__ __DEVELOPER__"
+__revision__ = "EnvironmentTests.py __REVISION__ __DATE__ __DEVELOPER__"
 
 import sys
 import unittest
 
-from scons.Environment import *
+from SCons.Environment import *
 
 
 
similarity index 88%
rename from src/scons/Errors.py
rename to src/engine/SCons/Errors.py
index 2709c1912a78e84e6044f11bb76a89fb21e0ea17..52facf7678048a7c0caba089ec08b0a6e3b309bb 100644 (file)
@@ -1,7 +1,7 @@
-"""scons.Errors
+"""SCons.Errors
 
 This file contains the exception classes used to handle internal
-and user errors in scons.
+and user errors in SCons.
 
 """
 
similarity index 70%
rename from src/scons/ErrorsTests.py
rename to src/engine/SCons/ErrorsTests.py
index 8d27332fcd135ef4d705b5f61af505311232c92f..911b11b968d3d25aa4b9d456e9a98059abc155c2 100644 (file)
@@ -2,22 +2,22 @@ __revision__ = "ErrorsTests.py __REVISION__ __DATE__ __DEVELOPER__"
 
 import sys
 import unittest
-from scons.Errors import InternalError, UserError
+import SCons.Errors
 
 
 class ErrorsTestCase(unittest.TestCase):
     def test_InternalError(self):
        """Test the InternalError exception."""
         try:
-            raise InternalError, "test internal error"
-        except InternalError, e:
+            raise SCons.Errors.InternalError, "test internal error"
+        except SCons.Errors.InternalError, e:
             assert e.args == "test internal error"
 
     def test_UserError(self):
        """Test the UserError exception."""
         try:
-            raise UserError, "test user error"
-        except UserError, e:
+            raise SCons.Errors.UserError, "test user error"
+        except SCons.Errors.UserError, e:
             assert e.args == "test user error"
 
 
similarity index 99%
rename from src/scons/Job.py
rename to src/engine/SCons/Job.py
index 09bfcb8fee2bbc3046bb1442db5afb080f11d117..aa9d92a4f3682fc42cc90afcfa24ea06c0eb666f 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Job
+"""SCons.Job
 
 This module defines the Serial and Parallel classes that execute tasks to
 complete a build. The Jobs class provides a higher level interface to start,
similarity index 96%
rename from src/scons/JobTests.py
rename to src/engine/SCons/JobTests.py
index 2d9eff0157c6d41b2233fabedd303ca7e089d13c..ec4c46d5be2bbbee88cfd20a55caf329b36dedd6 100644 (file)
@@ -3,7 +3,7 @@ __revision__ = "JobTests.py __REVISION__ __DATE__ __DEVELOPER__"
 import unittest
 import random
 import math
-import scons.Job
+import SCons.Job
 import sys
 
 # a large number
@@ -134,7 +134,7 @@ class ParallelTestCase(unittest.TestCase):
             raise NoThreadsException()
 
         taskmaster = Taskmaster(num_tasks, self, Task)
-        jobs = scons.Job.Jobs(num_jobs, taskmaster)
+        jobs = SCons.Job.Jobs(num_jobs, taskmaster)
         jobs.start()
         jobs.wait()
 
@@ -152,7 +152,7 @@ class SerialTestCase(unittest.TestCase):
         "test a serial job"
 
         taskmaster = Taskmaster(num_tasks, self, Task)
-        jobs = scons.Job.Jobs(1, taskmaster)
+        jobs = SCons.Job.Jobs(1, taskmaster)
         jobs.start()
         jobs.wait()
 
@@ -170,7 +170,7 @@ class SerialExceptionTestCase(unittest.TestCase):
         "test a serial job with tasks that raise exceptions"
 
         taskmaster = Taskmaster(num_tasks, self, ExceptionTask)
-        jobs = scons.Job.Jobs(1, taskmaster)
+        jobs = SCons.Job.Jobs(1, taskmaster)
         jobs.start()
         jobs.wait()
 
@@ -186,7 +186,7 @@ class ParallelExceptionTestCase(unittest.TestCase):
         "test parallel jobs with tasks that raise exceptions"
 
         taskmaster = Taskmaster(num_tasks, self, ExceptionTask)
-        jobs = scons.Job.Jobs(num_jobs, taskmaster)
+        jobs = SCons.Job.Jobs(num_jobs, taskmaster)
         jobs.start()
         jobs.wait()
 
similarity index 97%
rename from src/scons/Node/FS.py
rename to src/engine/SCons/Node/FS.py
index 7640a7a5a7087b417c18c8df86b5410b823f52fd..e7956c2d962f3b01a5970655f69000f47b8df37b 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Node.FS
+"""SCons.Node.FS
 
 File system nodes.
 
@@ -10,7 +10,7 @@ __revision__ = "Node/FS.py __REVISION__ __DATE__ __DEVELOPER__"
 
 import os
 import os.path
-from scons.Node import Node
+import SCons.Node
 
 
 
@@ -94,7 +94,7 @@ def lookup(fsclass, name, directory = Top):
 # linked_targets
 # is_accessible
 
-class Dir(Node):
+class Dir(SCons.Node.Node):
     """A class for directories in a file system.
     """
 
@@ -130,7 +130,7 @@ class Dir(Node):
 # is_under
 # relpath
 
-class File(Node):
+class File(SCons.Node.Node):
     """A class for files in a file system.
     """
 
similarity index 87%
rename from src/scons/Node/FSTests.py
rename to src/engine/SCons/Node/FSTests.py
index 14b62c285811de118a6f5f7168683eedcdb3414d..aa8cf2a5196e4fd2830d11dec9ae459f92038bf8 100644 (file)
@@ -4,7 +4,7 @@ import os
 import sys
 import unittest
 
-from scons.Node.FS import init, lookup, Dir, File
+import SCons.Node.FS
 
 
 
@@ -39,10 +39,10 @@ class FSTestCase(unittest.TestCase):
 
        os.chdir(sub_dir)
 
-       init()
+       SCons.Node.FS.init()
 
        def Dir_test(lpath, path, abspath, up_path):
-           dir = lookup(Dir, lpath)
+           dir = SCons.Node.FS.lookup(SCons.Node.FS.Dir, lpath)
            assert(dir.path == path)
            assert(dir.abspath == abspath)
            assert(dir.up().path == up_path)
@@ -58,14 +58,14 @@ class FSTestCase(unittest.TestCase):
        Dir_test('./.',         '.',            sub_dir,                sub)
        Dir_test('foo/./bar',   'foo/bar/',     sub_dir_foo_bar,        'foo/')
 
-       d1 = lookup(Dir, 'd1')
+       d1 = SCons.Node.FS.lookup(SCons.Node.FS.Dir, 'd1')
 
-       f1 = lookup(File, 'f1', directory = d1)
+       f1 = SCons.Node.FS.lookup(SCons.Node.FS.File, 'f1', directory = d1)
 
        assert(f1.path == 'd1/f1')
 
        try:
-           f2 = lookup(File, 'f1/f2', directory = d1)
+           f2 = SCons.Node.FS.lookup(SCons.Node.FS.File, 'f1/f2', directory = d1)
        except TypeError, x:
            node = x.args[0]
            assert(node.path == 'd1/f1')
@@ -74,7 +74,7 @@ class FSTestCase(unittest.TestCase):
            raise
 
        try:
-           dir = lookup(Dir, 'd1/f1')
+           dir = SCons.Node.FS.lookup(SCons.Node.FS.Dir, 'd1/f1')
        except TypeError, x:
            node = x.args[0]
            assert(node.path == 'd1/f1')
similarity index 91%
rename from src/scons/Node/NodeTests.py
rename to src/engine/SCons/Node/NodeTests.py
index 46292bc23aec2d3277446fe5acb9b9cd2ae8d800..2249a963c412ad7097430e8e96a4913cbf4b10b9 100644 (file)
@@ -4,7 +4,7 @@ import os
 import sys
 import unittest
 
-from scons.Node import Node
+import SCons.Node
 
 
 
@@ -22,7 +22,7 @@ class NodeTestCase(unittest.TestCase):
     def test_build(self):
        """Test building a node
        """
-       node = Node()
+       node = SCons.Node.Node()
        node.builder_set(Builder())
        node.path = "xxx"       # XXX FAKE SUBCLASS ATTRIBUTE
        node.sources = "yyy"    # XXX FAKE SUBCLASS ATTRIBUTE
@@ -32,7 +32,7 @@ class NodeTestCase(unittest.TestCase):
     def test_builder_set(self):
        """Test setting a Node's Builder
        """
-       node = Node()
+       node = SCons.Node.Node()
        b = Builder()
        node.builder_set(b)
        assert node.builder == b
similarity index 83%
rename from src/scons/Node/__init__.py
rename to src/engine/SCons/Node/__init__.py
index e4eb45a0fc8a008f1275f3cc9d8bb0dd5cd4f9a0..fb77c652f3aa97848790f125b8e7fc1d387a5662 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.Node
+"""SCons.Node
 
-The Node package for the scons software construction utility.
+The Node package for the SCons software construction utility.
 
 """
 
similarity index 96%
rename from src/scons/Scanner/C.py
rename to src/engine/SCons/Scanner/C.py
index fcb3a46f76fee734dfed7f2c83ae393adaf6b090..ce6f9c628f4a7087b387dbda9e139ed5a87fb94b 100644 (file)
@@ -1,4 +1,4 @@
-"""scons.Scanner.C
+"""SCons.Scanner.C
 
 This module implements the depenency scanner for C/C++ code. 
 
@@ -7,7 +7,7 @@ This module implements the depenency scanner for C/C++ code.
 __revision__ = "Scanner/C.py __REVISION__ __DATE__ __DEVELOPER__"
 
 
-import scons.Scanner
+import SCons.Scanner
 import re
 import os.path
 
@@ -16,7 +16,7 @@ quote_re = re.compile('^[ \t]*#[ \t]*include[ \t]+"([\\w./\\\\]+)"', re.M)
 
 def CScan():
     "Return a Scanner instance for scanning C/C++ source files"
-    return scons.Scanner.Scanner(scan)
+    return SCons.Scanner.Scanner(scan)
 
 def find_files(filenames, paths):
     """
similarity index 91%
rename from src/scons/Scanner/CTests.py
rename to src/engine/SCons/Scanner/CTests.py
index 326e9b84a31fe81823b2632f0c8a16be93d45a0f..6a851206801b5073b576b9ba62523a0ee0220afd 100644 (file)
@@ -1,11 +1,11 @@
 __revision__ = "Scanner/CTests.py __REVISION__ __DATE__ __DEVELOPER__"
 
-from TestCmd import TestCmd
-import scons.Scanner.C
+import TestCmd
+import SCons.Scanner.C
 import unittest
 import sys
 
-test = TestCmd(workdir = '')
+test = TestCmd.TestCmd(workdir = '')
 
 # create some source files and headers:
 
@@ -75,7 +75,7 @@ def deps_match(deps, headers):
 class CScannerTestCase1(unittest.TestCase):
     def runTest(self):
         env = DummyEnvironment
-        s = scons.Scanner.C.CScan()
+        s = SCons.Scanner.C.CScan()
         deps = s.scan(test.workpath('f1.cpp'), env)
         self.failUnless(deps_match(deps, ['f1.h', 'f2.h']))
 
@@ -83,7 +83,7 @@ class CScannerTestCase2(unittest.TestCase):
     def runTest(self):
         env = DummyEnvironment
         env.CPPPATH = [test.workpath("d1")]
-        s = scons.Scanner.C.CScan()
+        s = SCons.Scanner.C.CScan()
         deps = s.scan(test.workpath('f1.cpp'), env)
         headers = ['f1.h', 'd1/f2.h']
         self.failUnless(deps_match(deps, headers)) 
@@ -92,7 +92,7 @@ class CScannerTestCase3(unittest.TestCase):
     def runTest(self):
         env = DummyEnvironment
         env.CPPPATH = [test.workpath("d1")]
-        s = scons.Scanner.C.CScan()
+        s = SCons.Scanner.C.CScan()
         deps = s.scan(test.workpath('f2.cpp'), env)
         headers = ['f1.h', 'd1/f2.h', 'd1/d2/f1.h']
         self.failUnless(deps_match(deps, headers))
@@ -102,7 +102,7 @@ class CScannerTestCase4(unittest.TestCase):
     def runTest(self):
         env = DummyEnvironment
         env.CPPPATH = [test.workpath("d1"), test.workpath("d1/d2")]
-        s = scons.Scanner.C.CScan()
+        s = SCons.Scanner.C.CScan()
         deps = s.scan(test.workpath('f2.cpp'), env)
         headers =  ['f1.h', 'd1/f2.h', 'd1/d2/f1.h', 'd1/d2/f4.h']
         self.failUnless(deps_match(deps, headers))
@@ -110,7 +110,7 @@ class CScannerTestCase4(unittest.TestCase):
 class CScannerTestCase5(unittest.TestCase):
     def runTest(self):
         env = DummyEnvironment
-        s = scons.Scanner.C.CScan()
+        s = SCons.Scanner.C.CScan()
         deps = s.scan(test.workpath('f3.cpp'), env)
         headers =  ['f1.h', 'f2.h', 'f3.h', 'd1/f1.h', 'd1/f2.h', 'd1/f3.h']
         self.failUnless(deps_match(deps, headers))
similarity index 91%
rename from src/scons/Scanner/ScannerTests.py
rename to src/engine/SCons/Scanner/ScannerTests.py
index 9761cd0d082533916116aeaddb883f7eba83aa26..9c7163dc2cc3fff342af0b752b0dd9a974a93d88 100644 (file)
@@ -1,7 +1,7 @@
 __revision__ = "Scanner/ScannerTests.py __REVISION__ __DATE__ __DEVELOPER__"
 
 import unittest
-import scons.Scanner
+import SCons.Scanner
 import sys
 
 class ScannerTestBase:
@@ -36,7 +36,7 @@ class DummyEnvironment:
 class ScannerPositionalTestCase(ScannerTestBase, unittest.TestCase):
     "Test the Scanner class using the position argument"
     def runTest(self):
-        s = scons.Scanner.Scanner(self.func)
+        s = SCons.Scanner.Scanner(self.func)
         env = DummyEnvironment()
         env.VARIABLE = "var1"
         self.test(s, env, 'f1.cpp', ['f1.h', 'f1.hpp'])
@@ -44,7 +44,7 @@ class ScannerPositionalTestCase(ScannerTestBase, unittest.TestCase):
 class ScannerKeywordTestCase(ScannerTestBase, unittest.TestCase):
     "Test the Scanner class using the keyword argument"
     def runTest(self):
-        s = scons.Scanner.Scanner(function = self.func)
+        s = SCons.Scanner.Scanner(function = self.func)
         env = DummyEnvironment()
         env.VARIABLE = "var2"
         self.test(s, env, 'f2.cpp', ['f2.h', 'f2.hpp'])
@@ -53,7 +53,7 @@ class ScannerPositionalArgumentTestCase(ScannerTestBase, unittest.TestCase):
     "Test the Scanner class using the position argument and optional argument"
     def runTest(self):
         arg = "this is the argument"
-        s = scons.Scanner.Scanner(self.func, arg)
+        s = SCons.Scanner.Scanner(self.func, arg)
         env = DummyEnvironment()
         env.VARIABLE = "var3"
         self.test(s, env, 'f3.cpp', ['f3.h', 'f3.hpp'], arg)
@@ -62,7 +62,7 @@ class ScannerKeywordArgumentTestCase(ScannerTestBase, unittest.TestCase):
     "Test the Scanner class using the keyword argument and optional argument"
     def runTest(self):
         arg = "this is another argument"
-        s = scons.Scanner.Scanner(function = self.func, argument = arg)
+        s = SCons.Scanner.Scanner(function = self.func, argument = arg)
         env = DummyEnvironment()
         env.VARIABLE = "var4"
         self.test(s, env, 'f4.cpp', ['f4.h', 'f4.hpp'], arg)
similarity index 96%
rename from src/scons/Scanner/__init__.py
rename to src/engine/SCons/Scanner/__init__.py
index 7ce602ccce765ef59e2fcaef443742d453444229..225c7f3fe64061c8e541c67c6bf41b468d373a5b 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.Scanner
+"""SCons.Scanner
 
-The Scanner package for the scons software construction utility.
+The Scanner package for the SCons software construction utility.
 
 """
 
similarity index 89%
rename from src/scons/Sig/MD5.py
rename to src/engine/SCons/Sig/MD5.py
index 36e4230e9a4203c2e6bef60c5b784842550f086d..9d461d96a36559e007bd32c336c95fc1a8c61298 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.Sig.MD5
+"""SCons.Sig.MD5
 
-The MD5 signature package for the scons software construction
+The MD5 signature package for the SCons software construction
 utility.
 
 """
@@ -16,7 +16,7 @@ def hexdigest(s):
     """Return a signature as a string of hex characters.
     """
     # NOTE:  This routine is a method in the Python 2.0 interface
-    # of the native md5 module, but we want scons to operate all
+    # of the native md5 module, but we want SCons to operate all
     # the way back to at least Python 1.5.2, which doesn't have it.
     h = string.hexdigits
     r = ''
similarity index 72%
rename from src/scons/Sig/MD5Tests.py
rename to src/engine/SCons/Sig/MD5Tests.py
index efcec7f968bcb2d2923a0b15cf69adef03dc1ba9..ac67f1d7ebace46c7b0543a3b6384e0c1046c00c 100644 (file)
@@ -3,7 +3,7 @@ __revision__ = "Sig/MD5Tests.py __REVISION__ __DATE__ __DEVELOPER__"
 import sys
 import unittest
 
-import scons.Sig.MD5
+import SCons.Sig.MD5
 
 
 
@@ -18,11 +18,11 @@ class my_obj:
 
     def signature(self):
        if not self.sig:
-           self.sig = scons.Sig.MD5.signature(self.value)
+           self.sig = SCons.Sig.MD5.signature(self.value)
        return self.sig
 
     def current(self, sig):
-       return scons.Sig.MD5.current(self, sig)
+       return SCons.Sig.MD5.current(self, sig)
 
 
 
@@ -40,9 +40,9 @@ class MD5TestCase(unittest.TestCase):
        Simple comparison of different "signature" values.
        """
        o111 = my_obj(value = '111')
-       assert not o111.current(scons.Sig.MD5.signature('110'))
-       assert     o111.current(scons.Sig.MD5.signature('111'))
-       assert not o111.current(scons.Sig.MD5.signature('112'))
+       assert not o111.current(SCons.Sig.MD5.signature('110'))
+       assert     o111.current(SCons.Sig.MD5.signature('111'))
+       assert not o111.current(SCons.Sig.MD5.signature('112'))
 
     def test_set(self):
        pass    # XXX
@@ -56,9 +56,9 @@ class MD5TestCase(unittest.TestCase):
        o1 = my_obj(value = '111')
        o2 = my_obj(value = '222')
        o3 = my_obj(value = '333')
-       assert '698d51a19d8a121ce581499d7b701668' == scons.Sig.MD5.collect(o1)
-       assert '8980c988edc2c78cc43ccb718c06efd5' == scons.Sig.MD5.collect(o1, o2)
-       assert '53fd88c84ff8a285eb6e0a687e55b8c7' == scons.Sig.MD5.collect(o1, o2, o3)
+       assert '698d51a19d8a121ce581499d7b701668' == SCons.Sig.MD5.collect(o1)
+       assert '8980c988edc2c78cc43ccb718c06efd5' == SCons.Sig.MD5.collect(o1, o2)
+       assert '53fd88c84ff8a285eb6e0a687e55b8c7' == SCons.Sig.MD5.collect(o1, o2, o3)
 
     def test_signature(self):
        pass    # XXX
similarity index 90%
rename from src/scons/Sig/TimeStamp.py
rename to src/engine/SCons/Sig/TimeStamp.py
index cab44bf2c973a4e392fbd09e74087135bf224fef..b8217424f64db7696f484b3c3f5e338672e45df7 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.Sig.TimeStamp
+"""SCons.Sig.TimeStamp
 
-The TimeStamp signature package for the scons software construction
+The TimeStamp signature package for the SCons software construction
 utility.
 
 """
similarity index 79%
rename from src/scons/Sig/TimeStampTests.py
rename to src/engine/SCons/Sig/TimeStampTests.py
index 4fb1920861967ab05bd0e5bc928e9e9285db3088..4cc72e4def28108eb03024d9689914c425cd0083 100644 (file)
@@ -3,7 +3,7 @@ __revision__ = "Sig/TimeStampTests.py __REVISION__ __DATE__ __DEVELOPER__"
 import sys
 import unittest
 
-import scons.Sig.TimeStamp
+import SCons.Sig.TimeStamp
 
 
 
@@ -37,9 +37,9 @@ class TimeStampTestCase(unittest.TestCase):
        Simple comparison of different timestamp values.
        """
        o1 = my_obj(value = 111)
-       assert scons.Sig.TimeStamp.current(o1, 110)
-       assert scons.Sig.TimeStamp.current(o1, 111)
-       assert not scons.Sig.TimeStamp.current(o1, 112)
+       assert SCons.Sig.TimeStamp.current(o1, 110)
+       assert SCons.Sig.TimeStamp.current(o1, 111)
+       assert not SCons.Sig.TimeStamp.current(o1, 112)
 
     def test_set(self):
        pass    # XXX
@@ -54,9 +54,9 @@ class TimeStampTestCase(unittest.TestCase):
        o1 = my_obj(value = 111)
        o2 = my_obj(value = 222)
        o3 = my_obj(value = 333)
-       assert 111 == scons.Sig.TimeStamp.collect(o1)
-       assert 222 == scons.Sig.TimeStamp.collect(o1, o2)
-       assert 333 == scons.Sig.TimeStamp.collect(o1, o2, o3)
+       assert 111 == SCons.Sig.TimeStamp.collect(o1)
+       assert 222 == SCons.Sig.TimeStamp.collect(o1, o2)
+       assert 333 == SCons.Sig.TimeStamp.collect(o1, o2, o3)
 
     def test_signature(self):
        pass    # XXX
similarity index 50%
rename from src/scons/Sig/__init__.py
rename to src/engine/SCons/Sig/__init__.py
index 411a94b2226b3daadc20318b1b1b3b30b19767ae..c3b06ed85d3e69edc4365650b807702466e3b614 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.Sig
+"""SCons.Sig
 
-The Signature package for the scons software construction utility.
+The Signature package for the SCons software construction utility.
 
 """
 
similarity index 58%
rename from src/scons/__init__.py
rename to src/engine/SCons/__init__.py
index 9e279c29ebc8dd570bc03ba5743c5c6b66219714..56c5fade8a129bc7ec9c0e8a9e855a557dacad51 100644 (file)
@@ -1,6 +1,6 @@
-"""scons
+"""SCons
 
-The main package for the scons software construction utility.
+The main package for the SCons software construction utility.
 
 """
 
similarity index 92%
rename from src/scons/exitfuncs.py
rename to src/engine/SCons/exitfuncs.py
index e26a0312eb141ed1f97ffec486997e12592fa873..86d19907c829d950d4df4c7b7483736c9289931e 100644 (file)
@@ -1,6 +1,6 @@
-"""scons.exitfuncs
+"""SCons.exitfuncs
 
-Register functions which are executed when scons exits for any reason.
+Register functions which are executed when SCons exits for any reason.
 
 """
 
diff --git a/src/engine/setup.py b/src/engine/setup.py
new file mode 100644 (file)
index 0000000..10fbef5
--- /dev/null
@@ -0,0 +1,16 @@
+__revision__ = "setup.py __REVISION__ __DATE__ __DEVELOPER__"
+
+from string import join, split
+
+from distutils.core import setup
+
+setup(name = "scons-pylib",
+      version = "__VERSION__",
+      description = "scons",
+      author = "Steven Knight",
+      author_email = "knight@baldmt.com",
+      url = "http://www.scons.org/",
+      packages = ["SCons",
+                 "SCons.Node",
+                 "SCons.Scanner",
+                 "SCons.Sig"])
diff --git a/src/script/MANIFEST b/src/script/MANIFEST
new file mode 100644 (file)
index 0000000..98e74a0
--- /dev/null
@@ -0,0 +1,3 @@
+MANIFEST
+scons.py
+setup.py
similarity index 96%
rename from src/scons.py
rename to src/script/scons.py
index 78cfece43f43c95f186c743f675eccc10ce8240a..d4337732b7c1bed07cb54533bec9cd34958463d5 100644 (file)
@@ -11,11 +11,16 @@ import string
 import sys
 import traceback
 
-from scons.Node.FS import init, Dir, File, lookup
-from scons.Environment import Environment
-import scons.Job
-from scons.Builder import Builder
-from scons.Errors import *
+import SCons.Node.FS
+import SCons.Job
+from SCons.Errors import *
+
+#
+# Modules and classes that we don't use directly in this script, but
+# which we want available for use in SConstruct and SConscript files.
+#
+from SCons.Environment import Environment
+from SCons.Builder import Builder
 
 class Task:
     "XXX: this is here only until the build engine is implemented"
@@ -361,7 +366,7 @@ def options_init():
        help = "Don't build; list files and where defined.")
 
     def opt_n(opt, arg):
-       scons.Builder.execute_actions = None
+       SCons.Builder.execute_actions = None
 
     Option(func = opt_n,
        short = 'n', long = ['no-exec', 'just-print', 'dry-run', 'recon'],
@@ -392,7 +397,7 @@ def options_init():
        help = "Build dependencies in random order.")
 
     def opt_s(opt, arg):
-       scons.Builder.print_actions = None
+       SCons.Builder.print_actions = None
 
     Option(func = opt_s,
        short = 's', long = ['silent', 'quiet'],
@@ -496,7 +501,7 @@ def main():
 
     # XXX The commented-out code here adds any "scons" subdirs in anything
     # along sys.path to sys.path.  This was an attempt at setting up things
-    # so we can import "node.FS" instead of "scons.Node.FS".  This doesn't
+    # so we can import "node.FS" instead of "SCons.Node.FS".  This doesn't
     # quite fit our testing methodology, though, so save it for now until
     # the right solutions pops up.
     #
@@ -512,7 +517,7 @@ def main():
     sys.path = include_dirs + sys.path
 
     # initialize node factory
-    init()
+    SCons.Node.FS.init()
 
     while Scripts:
         file, Scripts = Scripts[0], Scripts[1:]
@@ -532,9 +537,11 @@ def main():
        PrintUsage()
        sys.exit(0)
 
-    taskmaster = Taskmaster(map(lambda x: lookup(File, x), targets))
+    taskmaster = Taskmaster(map(
+                       lambda x: SCons.Node.FS.lookup(SCons.Node.FS.File, x),
+                       targets))
 
-    jobs = scons.Job.Jobs(num_jobs, taskmaster)
+    jobs = SCons.Job.Jobs(num_jobs, taskmaster)
     jobs.start()
     jobs.wait()
 
similarity index 92%
rename from src/setup.py
rename to src/script/setup.py
index ad93caccf9ec9382b58d1f705e519c4249122c4a..8732e3b934e8aa85313c79dfd9bbd722078f26ab 100644 (file)
@@ -10,5 +10,4 @@ setup(name = "scons",
       author = "Steven Knight",
       author_email = "knight@baldmt.com",
       url = "http://www.baldmt.com/scons",
-      packages = ["scons"],
       scripts = ["scons.py"])
index a13dd9b67fce732bc2f6ab91cc78d1eefb931420..d9a1019fed960179b13f80d51737fbc9741ac8eb 100644 (file)
@@ -8,7 +8,7 @@ import TestSCons
 test = TestSCons.TestSCons(match = TestCmd.match_exact)
 
 sconstruct = """
-from scons.exitfuncs import *
+from SCons.exitfuncs import *
 
 def x1():
     print "running x1"