summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2008-09-13 06:19:51 (GMT)
committerSteven Knight <knight@baldmt.com>2008-09-13 06:19:51 (GMT)
commit70e1fb737a98deab12f49eafe94951f070a0cc6f (patch)
treeaf12a5684c8229aa9a6c0c277cbb524ca5ba70c2 /src
parent9b372f83bcc056bb7db0aef9f6b026d3a05c458d (diff)
downloadSCons-70e1fb737a98deab12f49eafe94951f070a0cc6f.zip
SCons-70e1fb737a98deab12f49eafe94951f070a0cc6f.tar.gz
SCons-70e1fb737a98deab12f49eafe94951f070a0cc6f.tar.bz2
Issue 1693: Make the directory in which the .sconsign file will live,
if the directory doesn't already exist. (Damyan Pepper, Jim Randall)
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt10
-rw-r--r--src/engine/SCons/Environment.py4
-rw-r--r--src/engine/SCons/Node/FS.py7
-rw-r--r--src/engine/SCons/Script/Main.py1
4 files changed, 20 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index c3772fc..8dbe8d5 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -78,6 +78,16 @@ RELEASE 1.X - XXX
- Make Glob() sort the returned list of Files or Nodes
to prevent spurious rebuilds.
+ From Damyan Pepper:
+
+ - Add a test case to verify that SConsignFile() files can be
+ created in previously non-existent subdirectories.
+
+ From Jim Randall:
+
+ - Make the subdirectory in which the SConsignFile() file will
+ live, if the subdirectory doesn't already exist.
+
From Ali Tofigh:
- Add a test to verify duplication of files in VariantDir subdirectories.
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 9377610..9c04ec5 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1910,6 +1910,10 @@ class Base(SubstitutionEnvironment):
name = self.subst(name)
if not os.path.isabs(name):
name = os.path.join(str(self.fs.SConstruct_dir), name)
+ name = os.path.normpath(name)
+ sconsign_dir = os.path.dirname(name)
+ if sconsign_dir and not os.path.exists(sconsign_dir):
+ self.Execute(SCons.Defaults.Mkdir(sconsign_dir))
SCons.SConsign.File(name, dbm_module)
def SideEffect(self, side_effect, target):
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 8d11e4e..b8762dc 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -59,6 +59,8 @@ import SCons.Warnings
from SCons.Debug import Trace
+do_store_info = True
+
# The max_drift value: by default, use a cached signature value for
# any file that's been untouched for more than two days.
default_max_drift = 2*24*60*60
@@ -2269,7 +2271,8 @@ class File(Base):
# This accomodates "chained builds" where a file that's a target
# in one build (SConstruct file) is a source in a different build.
# See test/chained-build.py for the use case.
- self.dir.sconsign().store_info(self.name, self)
+ if do_store_info:
+ self.dir.sconsign().store_info(self.name, self)
convert_copy_attrs = [
'bsources',
@@ -2395,7 +2398,7 @@ class File(Base):
try:
sconsign_entry = self.dir.sconsign().get_entry(self.name)
- except (KeyError, OSError):
+ except (KeyError, EnvironmentError):
import SCons.SConsign
sconsign_entry = SCons.SConsign.SConsignEntry()
sconsign_entry.binfo = self.new_binfo()
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 12e7fba..76b94e0 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -988,6 +988,7 @@ def _build_targets(fs, options, targets, target_top):
display.set_mode(not options.silent)
SCons.Action.print_actions = not options.silent
SCons.Action.execute_actions = not options.no_exec
+ SCons.Node.FS.do_store_info = not options.no_exec
SCons.SConf.dryrun = options.no_exec
if options.diskcheck: