Supply more specific version info, including build date.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 18 Jun 2002 01:26:24 +0000 (01:26 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 18 Jun 2002 01:26:24 +0000 (01:26 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@391 fdb21ef1-2011-0410-befe-b5e4ea1792b1

README
SConstruct
src/CHANGES.txt
src/engine/SCons/Platform/__init__.py
src/engine/SCons/Scanner/__init__.py
src/engine/SCons/Script/__init__.py
src/engine/SCons/__init__.py
src/script/scons.py
test/option-v.py

diff --git a/README b/README
index 6f2441ad3713bab0b6581e6b7a5d5386f8690f66..f4a04379baf39feb04bb1424da581d62286d5fb1 100644 (file)
--- a/README
+++ b/README
@@ -51,9 +51,9 @@ part of Python until Python version 1.6, so if your system is running
 Python 1.5.2, you may not have distutils installed.  If you are running
 Python version 1.6 or later, you should be fine.
 
-NOTE TO RED HAT USERS:  All Red Hat Linux versions as late as 7.3
-still ship Python 1.5.2 as the default, so you probably do *not* have
-distutils installed, unless you have already done so manually.
+NOTE TO RED HAT USERS:  All Red Hat Linux versions as late as 7.3 (at
+least) still ship Python 1.5.2 as the default, so you probably do *not*
+have distutils installed, unless you have already done so manually.
 
 In this case, your options are:
 
@@ -93,13 +93,13 @@ system, populate the build/scons/ directory by running:
 
 If you don't have SCons version 0.07 or later already installed on your
 system, you can use SCons itself to populate the build/scons/ directory
-with a little more work:
+with a little more typing:
 
         $ SCONS_LIB_DIR=`pwd`/src/engine python src/script/scons.py build/scons
 
-Either command populates the build/scons/ directory with the necessary
-files and directory structure to use the Python-standard setup script as
-follows:
+Either command will populate the build/scons/ directory with the
+necessary files and directory structure to use the Python-standard setup
+script as follows:
 
         # cd build/scons
         # python setup.py install
@@ -109,9 +109,9 @@ directory (/usr/bin or C:\Python*\Scripts, for example) and the build
 engine in an appropriate SCons library directory (/usr/lib/scons or
 C:\Python*\SCons, for example).
 
-You should have system installation privileges (that is, "root" or
-"Administrator") when running the setup.py script to install SCons in
-the default system directories.
+You should have system installation privileges (that is, "root" on POSIX
+or "Administrator" on Windows) when running the setup.py script to
+install SCons in the default system directories.
 
 If you don't have system installation privileges, you can use the
 --prefix option to specify an alternate installation location, such as
@@ -129,11 +129,14 @@ TESTING
 
 Tests are run by the runtest.py script in this directory.
 
-There are two types of tests in this package.  Unit tests for individual
-SCons modules live underneath the src/engine/ subdirectory and are the
-same base name as the module with "Tests.py" appended--for example,
-the unit test for the Builder.py module is the BuilderTests.py script.
-End-to-end tests of SCons live in the test/ subdirectory.
+There are two types of tests in this package:
+
+    Unit tests for individual SCons modules live underneath the
+    src/engine/ subdirectory and are the same base name as the module
+    with "Tests.py" appended--for example, the unit test for the
+    Builder.py module is the BuilderTests.py script.
+
+    End-to-end tests of SCons live in the test/ subdirectory.
 
 You may specifically list one or more tests to be run:
 
@@ -168,7 +171,7 @@ system, you can build everything by simply running it:
 
 If you don't have SCons version 0.07 or later already installed on your
 system, you can build this version of SCons with itself with a little
-more work:
+more typing:
 
         $ SCONS_LIB_DIR=`pwd`/src/engine python src/script/scons.py
 
@@ -192,7 +195,7 @@ For example, if you don't have Debian packaging tools installed, it
 should just not build the .deb package, not fail the build.
 
 If you receive a build error, please report it to the scons-devel
-mailing list.
+mailing list and open a bug report on the SCons bug tracker.
 
 Note that in addition to creating the above packages, the default build
 will also unpack one or more of the packages for testing.
@@ -220,8 +223,8 @@ via the -a option) against the unpacked build/test-/* subdirectory:
 
         $ python runtest.py -p zip
 
-(The canonical invocation is to specify the runtest.py -a option so that
-all tests are run against the specified package.)
+(The canonical invocation is to also use the runtest.py -a option so
+that all tests are run against the specified package.)
 
 
 CONTENTS OF THIS PACKAGE
@@ -283,12 +286,14 @@ runtest.py
         (aeb) before running tests.
 
 SConstruct
-        The "Makefile" for the SCons distribution.  (It has been
-        pointed out that it's hard to find the SCons API in here, and
-        it looks a lot more like a straight Python script than a build
-        configuration file, but that's mainly because all of the magick
-        we have to do to deal with a variety of packaging formats
-        requires a lot of straight Python manipulation.)
+        The "Makefile" for the SCons distribution.
+
+        (It has been pointed out that it's hard to find the SCons API in
+        this SConstruct file, and that it looks a lot more like a pure
+        Python script than a build configuration file.  That's mainly
+        because all of the magick we have to perform to deal with all of
+        the different packaging formats requires a lot of pure Python
+        manipulation.)
 
 src/
         Where the actual source code is kept, of course.
index 748f06b6a9ee415a578e68a0d42740f85f66ad06..af650d2d79ff8328e7c7f23d5bc1d0d5764797fa 100644 (file)
@@ -1,6 +1,8 @@
 #
 # SConstruct file to build scons packages during development.
 #
+# See the README file for an overview of how SCons is built and tested.
+#
 
 #
 # Copyright (c) 2001, 2002 Steven Knight
@@ -39,11 +41,9 @@ default_version = '0.08'
 Default('.')
 
 #
-# An internal "whereis" routine to figure out if we have a
-# given program available.  Put it in the "cons::" package
-# so subsidiary Conscript files can get at it easily, too.
+# An internal "whereis" routine to figure out if a given program
+# is available on this system.
 #
-
 def whereis(file):
     for dir in string.split(os.environ['PATH'], os.pathsep):
         f = os.path.join(dir, file)
@@ -59,7 +59,7 @@ def whereis(file):
 #
 # We let the presence or absence of various utilities determine
 # whether or not we bother to build certain pieces of things.
-# This will allow people to still do SCons work even if they
+# This should allow people to still do SCons work even if they
 # don't have Aegis or RPM installed, for example.
 #
 aegis = whereis('aegis')
@@ -72,7 +72,7 @@ unzip = whereis('unzip')
 zip = whereis('zip')
 
 #
-# Now grab the information that we "build" into the files (using sed).
+# Now grab the information that we "build" into the files.
 #
 try:
     date = ARGUMENTS['date']
@@ -88,13 +88,17 @@ elif os.environ.has_key('LOGNAME'):
 elif os.environ.has_key('USER'):
     developer = os.environ['USER']
 
-try:
+if ARGUMENTS.has_key('build_system'):
+    build_system = ARGUMENTS['build_system']
+else:
+    build_system = string.split(os.uname()[1], '.')[0]
+
+if ARGUMENTS.has_key('version'):
     revision = ARGUMENTS['version']
-except:
-    if aesub:
-        revision = os.popen(aesub + " \\$version", "r").read()[:-1]
-    else:
-        revision = default_version
+elif aesub:
+    revision = os.popen(aesub + " \\$version", "r").read()[:-1]
+else:
+    revision = default_version
 
 a = string.split(revision, '.')
 arr = [a[0]]
@@ -120,13 +124,14 @@ revision = string.join(arr, '.')
 #version = string.join(arr, '.')
 version = default_version
 
-try:
+build_id = string.replace(revision, version + '.', '')
+
+if ARGUMENTS.has_key('change'):
     change = ARGUMENTS['change']
-except:
-    if aesub:
-        change = os.popen(aesub + " \\$change", "r").read()[:-1]
-    else:
-        change = default_version
+elif aesub:
+    change = os.popen(aesub + " \\$change", "r").read()[:-1]
+else:
+    change = default_version
 
 python_ver = sys.version[0:3]
 
@@ -139,19 +144,17 @@ for key in ['AEGIS_PROJECT', 'PYTHONPATH']:
 
 lib_project = os.path.join("lib", project)
 
-unpack_tar_gz_dir = os.path.join(os.getcwd(), "build", "unpack-tar-gz")
-
-unpack_zip_dir = os.path.join(os.getcwd(), "build", "unpack-zip")
-
-test_tar_gz_dir = os.path.join(os.getcwd(), "build", "test-tar-gz")
-test_src_tar_gz_dir = os.path.join(os.getcwd(), "build", "test-src-tar-gz")
-
-test_zip_dir = os.path.join(os.getcwd(), "build", "test-zip")
-test_src_zip_dir = os.path.join(os.getcwd(), "build", "test-src-zip")
+cwd_build = os.path.join(os.getcwd(), "build")
 
-test_rpm_dir = os.path.join(os.getcwd(), "build", "test-rpm")
+test_deb_dir        = os.path.join(cwd_build, "test-deb")
+test_rpm_dir        = os.path.join(cwd_build, "test-rpm")
+test_tar_gz_dir     = os.path.join(cwd_build, "test-tar-gz")
+test_src_tar_gz_dir = os.path.join(cwd_build, "test-src-tar-gz")
+test_zip_dir        = os.path.join(cwd_build, "test-zip")
+test_src_zip_dir    = os.path.join(cwd_build, "test-src-zip")
 
-test_deb_dir = os.path.join(os.getcwd(), "build", "test-deb")
+unpack_tar_gz_dir   = os.path.join(cwd_build, "unpack-tar-gz")
+unpack_zip_dir      = os.path.join(cwd_build, "unpack-zip")
 
 if platform == "win32":
     tar_hflag = ''
@@ -226,11 +229,13 @@ def SCons_revision(target, source, env):
         # Note:  We construct the __*__ substitution strings here
         # so that they don't get replaced when this file gets
         # copied into the tree for packaging.
-        line = string.replace(line, '_' + '_DATE__', env['DATE'])
-        line = string.replace(line, '_' + '_DEVELOPER__', env['DEVELOPER'])
-        line = string.replace(line, '_' + '_FILE__', s)
-        line = string.replace(line, '_' + '_REVISION__', env['REVISION'])
-        line = string.replace(line, '_' + '_VERSION__', version)
+        line = string.replace(line, '__BUILD'     + '__', env['BUILD'])
+        line = string.replace(line, '__BUILDSYS'  + '__', env['BUILDSYS'])
+        line = string.replace(line, '__DATE'      + '__', env['DATE'])
+        line = string.replace(line, '__DEVELOPER' + '__', env['DEVELOPER'])
+        line = string.replace(line, '__FILE'      + '__', s)
+        line = string.replace(line, '__REVISION'  + '__', env['REVISION'])
+        line = string.replace(line, '__VERSION'   + '__',  version)
         outf.write(line)
     inf.close()
     outf.close()
@@ -241,6 +246,8 @@ revbuilder = Builder(action = SCons_revision)
 env = Environment(
                    ENV                 = ENV,
  
+                   BUILD               = build_id,
+                   BUILDSYS            = build_system,
                    DATE                = date,
                    DEVELOPER           = developer,
                    REVISION            = revision,
index c186d6a7c2347db1aaa30b126721bf1caeb5a1a5..63feea258fd02dd97da3b96254afbff0d2f2f3cd 100644 (file)
@@ -59,6 +59,8 @@ RELEASE 0.08 -
   - Fix C #include scanning to detect file names with characters like
     '-' in them.
 
+  - Add more specific version / build output to the -v option.
+
   From Jeff Petkau:
 
   - Fix --implicit-cache if the scanner returns an empty list.
index 201a1b96521477f5fb6492a4da80f2db8bb9751f..a519142460ba9e3f6ee0bb36a69112eea60745d0 100644 (file)
@@ -44,8 +44,6 @@ their own platform definition.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-__version__ = "__VERSION__"
-
 import imp
 import os
 import sys
index b2e04a34f71d4bb72fa0563df88b360ae5663ead..28159c91a17bd0b19cb668dd2521c909a2d13731 100644 (file)
@@ -29,8 +29,6 @@ The Scanner package for the SCons software construction utility.
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-__version__ = "__VERSION__"
-
 
 import SCons.Node.FS
 import SCons.Util
index 879f6d1bb9a97cf393f21b67a04d66f3645e3390..347119020e65c89fa0042869b7505df1a80981ed 100644 (file)
@@ -52,7 +52,9 @@ import copy
 # "SCons" package.  Replace it with our own version directory so, if
 # if they're there, we pick up the right version of the build engine
 # modules.
-sys.path = [os.path.join(sys.prefix, 'lib', 'scons-__VERSION__')] + sys.path[1:]
+#sys.path = [os.path.join(sys.prefix,
+#                         'lib',
+#                         'scons-%d' % SCons.__version__)] + sys.path[1:]
 
 import SCons.Node
 import SCons.Node.FS
@@ -673,10 +675,19 @@ def options_init():
                 "build Default() targets from local SConscript."])
 
     def option_v(opt, arg):
+        import __main__
         import SCons
        print "SCons by Steven Knight et al.:"
-       print "\tscript version __VERSION__"
-       print "\tbuild engine version %s" % SCons.__version__
+       print "\tscript: v%s.%s, %s, by %s on %s" % (__main__.__version__,
+                                                    __main__.__build__,
+                                                    __main__.__date__,
+                                                    __main__.__developer__,
+                                                    __main__.__buildsys__)
+       print "\tengine: v%s.%s, %s, by %s on %s" % (SCons.__version__,
+                                                    SCons.__build__,
+                                                    SCons.__date__,
+                                                    SCons.__developer__,
+                                                    SCons.__buildsys__)
        print "Copyright 2001, 2002 Steven Knight"
        sys.exit(0)
 
index a3bcfdea243332ae05e7c6279183b48665e4e4ae..e4d1464b0c7d6635de6151279e601b885afaabaf 100644 (file)
@@ -30,3 +30,11 @@ The main package for the SCons software construction utility.
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
 __version__ = "__VERSION__"
+
+__build__ = "__BUILD__"
+
+__buildsys__ = "__BUILDSYS__"
+
+__date__ = "__DATE__"
+
+__developer__ = "__DEVELOPER__"
index 8e64d1db3b8f9722cf715ea89553aacd28eb7e5f..b42ed424c0ffbaf8374e7e492f20ca325e381338 100644 (file)
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
+__version__ = "__VERSION__"
+
+__build__ = "__BUILD__"
+
+__buildsys__ = "__BUILDSYS__"
+
+__date__ = "__DATE__"
+
+__developer__ = "__DEVELOPER__"
+
 import sys
 import os.path
 import os
@@ -47,7 +57,7 @@ if os.environ.has_key("SCONS_LIB_DIR"):
     libs.append(os.environ["SCONS_LIB_DIR"])
 
 if sys.platform == 'win32':
-    libs.extend([ os.path.join(sys.prefix, 'SCons-__VERSION__'),
+    libs.extend([ os.path.join(sys.prefix, 'SCons-%s' % __version__),
                   os.path.join(sys.prefix, 'SCons') ])
 else:
     prefs = []
@@ -76,7 +86,7 @@ else:
     else:
         prefs.append(sys.prefix)
 
-    libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-__VERSION__'), prefs))
+    libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-%s' % __version__), prefs))
     libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons'), prefs))
 
 sys.path = libs + sys.path[1:]
index 594a0defbbc1511fd8cfbe0b3970c85e0351c666..f114e25af667c82cbfde5720fe3b47a7e05b5a51 100644 (file)
@@ -34,8 +34,8 @@ test = TestSCons.TestSCons(match = TestCmd.match_re)
 test.write('SConstruct', "")
 
 expect = r"""SCons by Steven Knight et al.:
-\tscript version \S+
-\tbuild engine version \S+
+\tscript: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
+\tengine: v\d\.\d\d\.\S+, \d\d\d\d/\d\d/\d\d \d\d:\d\d:\d\d, by \S+ on \S+
 Copyright 2001, 2002 Steven Knight
 """