summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2011-03-01 01:01:47 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2011-03-01 01:01:47 (GMT)
commitefb0071db2ef9b2ef9687e1353724ed18db1ee9b (patch)
tree88104462b1961c598053143bfacb03286dcb821b /src
parentf6027721b125af34862d1ba7ca5ba2205a09e1fe (diff)
downloadSCons-efb0071db2ef9b2ef9687e1353724ed18db1ee9b.zip
SCons-efb0071db2ef9b2ef9687e1353724ed18db1ee9b.tar.gz
SCons-efb0071db2ef9b2ef9687e1353724ed18db1ee9b.tar.bz2
New debug option --debug=duplicate to debug Variant-dir duplication
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt4
-rw-r--r--src/RELEASE.txt2
-rw-r--r--src/engine/SCons/Node/FS.py7
-rw-r--r--src/engine/SCons/Script/Main.py2
-rw-r--r--src/engine/SCons/Script/SConsOptions.py2
5 files changed, 16 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 31fa245..2aa48b3 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -14,6 +14,10 @@ RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
- New --debug=prepare option to show each target as it's being
prepared, whether or not anything needs to be done for it.
+ From Gary Oberbrunner:
+ - New debug option --debug=duplicate to print a line for each
+ unlink/relink (or copy) of a variant file from its source file.
+
From David Garcia Garzon:
- Fix Delete to be able to delete broken symlinks and dir
symlinks.
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index f9d550e..306403d 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -73,6 +73,8 @@
IMPROVEMENTS
+ - New debugging options to print unlink/relinking of variant files
+ (--debug=duplicate) and preparation of targets (--debug=prepare).
- SCons can now generate MSVS 9.0 and 10.0 Projects and Solutions.
- MSVS Solution generation is improved.
- Fortran 03 is supported (preliminary)
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index bb49f95..86649f3 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -56,6 +56,7 @@ import SCons.Warnings
from SCons.Debug import Trace
do_store_info = True
+print_duplicate = 0
class EntryProxyAttributeError(AttributeError):
@@ -2787,6 +2788,8 @@ class File(Base):
def _rmv_existing(self):
self.clear_memoized_values()
+ if print_duplicate:
+ print "dup: removing existing target %s"%self
e = Unlink(self, [], None)
if isinstance(e, SCons.Errors.BuildError):
raise e
@@ -2827,6 +2830,8 @@ class File(Base):
def do_duplicate(self, src):
self._createDir()
+ if print_duplicate:
+ print "dup: relinking variant '%s' from '%s'"%(self, src)
Unlink(self, None, None)
e = Link(self, src, None)
if isinstance(e, SCons.Errors.BuildError):
@@ -2860,6 +2865,8 @@ class File(Base):
else:
# The source file does not exist. Make sure no old
# copy remains in the variant directory.
+ if print_duplicate:
+ print "dup: no src for %s, unlinking old variant copy"%self
if Base.exists(self) or self.islink():
self.fs.unlink(self.path)
# Return None explicitly because the Base.exists() call
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 0513e41..0e029b5 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -656,6 +656,8 @@ def _set_debug_values(options):
options.tree_printers.append(TreePrinter())
if "prepare" in debug_values:
SCons.Taskmaster.print_prepare = 1
+ if "duplicate" in debug_values:
+ SCons.Node.FS.print_duplicate = 1
def _create_path(plist):
path = '.'
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index fc5f08d..3066c65 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -596,7 +596,7 @@ def Parser(version):
"tree" : '; please use --tree=all instead',
}
- debug_options = ["count", "explain", "findlibs",
+ debug_options = ["count", "duplicate", "explain", "findlibs",
"includes", "memoizer", "memory", "objects",
"pdb", "prepare", "presub", "stacktrace",
"time"] + list(deprecated_debug_options.keys())