summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-04-01 16:05:36 (GMT)
committerSteven Knight <knight@baldmt.com>2005-04-01 16:05:36 (GMT)
commitb4e1ccf877aecd44b8d865a06c57dd950e3344ae (patch)
treeb430db06370fb3a1bec82ce2c7c1c57252b27f9c /src
parent022b115bb9652b1ea93a106b53d77a9ef23a00a2 (diff)
downloadSCons-b4e1ccf877aecd44b8d865a06c57dd950e3344ae.zip
SCons-b4e1ccf877aecd44b8d865a06c57dd950e3344ae.tar.gz
SCons-b4e1ccf877aecd44b8d865a06c57dd950e3344ae.tar.bz2
Normalize directory paths in SConsignFile() database files. (Chad Austin)
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt4
-rw-r--r--src/RELEASE.txt15
-rw-r--r--src/engine/SCons/SConsign.py12
-rw-r--r--src/engine/SCons/SConsignTests.py22
4 files changed, 49 insertions, 4 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 7e2e68a..555139b 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -28,6 +28,10 @@ RELEASE 0.97 - XXX
- 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.
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index eabc4f6..095671d 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -58,6 +58,21 @@ RELEASE 0.97 - XXX
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
diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py
index 6610eaf..212ec8d 100644
--- a/src/engine/SCons/SConsign.py
+++ b/src/engine/SCons/SConsign.py
@@ -32,6 +32,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import cPickle
import os
import os.path
+import string
import time
import SCons.Node
@@ -41,8 +42,15 @@ import SCons.Warnings
#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:
@@ -98,7 +106,7 @@ class DB(Base):
try:
global database
- rawentries = database[self.dir.path]
+ rawentries = database[norm_entry(self.dir.path)]
except KeyError:
pass
else:
@@ -119,7 +127,7 @@ class DB(Base):
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
diff --git a/src/engine/SCons/SConsignTests.py b/src/engine/SCons/SConsignTests.py
index c2c05ac..c2f40bd 100644
--- a/src/engine/SCons/SConsignTests.py
+++ b/src/engine/SCons/SConsignTests.py
@@ -23,11 +23,13 @@
__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
@@ -111,13 +113,29 @@ class SConsignDBTestCase(unittest.TestCase):
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