- Have the environment store the toolpath and re-use it to find Tools
modules during later Copy() or Tool() calls (unless overridden).
+ - Normalize the directory path names in SConsignFile() database
+ files so the same signature file can interoperate on Windows and
+ non-Windows systems.
+
From Stanislav Baranov:
- Make it possible to support with custom Alias (sub-)classes.
or /usr/local was passed as the source to a Builder or Command()
call, in which case SCons would scan the entire directory tree.
+ -- SIGNATURE CHANGES WILL CAUSE LIKELY REBUILDS AFTER UPGRADE
+
+ This release adds several changes to the signature mechanism that
+ will cause SCons to rebuild most configurations after upgrading
+ (and if switching back from 0.97 to an earlier release).
+ These changes are:
+
+ -- NORMALIZED PATHS IN SConsignFile() DATABASES ON WINDOWS
+
+ When using an SConsignFile() database, instead of individual
+ .sconsign files in each directory, the path names are
+ stored in normalized form with / (forward slash) separating
+ the elements. This may cause rebuilds on Windows systems
+ with hierarchical configurations.
+
-- CACHED Configure() RESULTS ARE STORED IN A DIFFERENT FILE
The Configure() subsystem now stores its cached results in a
import cPickle
import os
import os.path
+import string
import time
import SCons.Node
#XXX Get rid of the global array so this becomes re-entrant.
sig_files = []
+# Handle to open database object if using the DB SConsign implementation.
database = None
+if os.sep == '/':
+ norm_entry = lambda s: s
+else:
+ def norm_entry(str):
+ return string.replace(str, os.sep, '/')
+
def write():
global sig_files
for sig_file in sig_files:
try:
global database
- rawentries = database[self.dir.path]
+ rawentries = database[norm_entry(self.dir.path)]
except KeyError:
pass
else:
def write(self, sync=1):
if self.dirty:
global database
- database[self.dir.path] = cPickle.dumps(self.entries, 1)
+ database[norm_entry(self.dir.path)] = cPickle.dumps(self.entries, 1)
if sync:
try:
syncmethod = database.sync
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.SConsign
+import os
import sys
import TestCmd
import unittest
+import SCons.SConsign
+
class BuildInfo:
def __init__(self, name):
self.name = name
bbb = d1.get_entry('bbb')
assert bbb.name == 'bbb name'
- d2 = SCons.SConsign.DB(DummyNode('dir1'))
+ d2 = SCons.SConsign.DB(DummyNode('dir2'))
d2.set_entry('ccc', BuildInfo('ccc name'))
d2.set_entry('ddd', BuildInfo('ddd name'))
ccc = d2.get_entry('ccc')
assert ccc.name == 'ccc name'
ddd = d2.get_entry('ddd')
assert ddd.name == 'ddd name'
+
+ d31 = SCons.SConsign.DB(DummyNode('dir3/sub1'))
+ d31.set_entry('eee', BuildInfo('eee name'))
+ d31.set_entry('fff', BuildInfo('fff name'))
+ eee = d31.get_entry('eee')
+ assert eee.name == 'eee name'
+ fff = d31.get_entry('fff')
+ assert fff.name == 'fff name'
+
+ d32 = SCons.SConsign.DB(DummyNode('dir3%ssub2' % os.sep))
+ d32.set_entry('ggg', BuildInfo('ggg name'))
+ d32.set_entry('hhh', BuildInfo('hhh name'))
+ ggg = d32.get_entry('ggg')
+ assert ggg.name == 'ggg name'
+ hhh = d32.get_entry('hhh')
+ assert hhh.name == 'hhh name'
finally:
SCons.SConsign.database = save_database