summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Node/FS.py2
-rw-r--r--src/engine/SCons/Node/FSTests.py7
3 files changed, 10 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 7eaf87f..74b5621 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -22,6 +22,8 @@ RELEASE 0.09 -
- Fix auto-deduction of target names so that deduced targets end
up in the same subdirectory as the source.
+ - Don't remove source files specified on the command line!
+
From Anthony Roach:
- Fixed use of command lines with spaces in their arguments,
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 5d01314..96381e3 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -773,7 +773,7 @@ class File(Entry):
def prepare(self):
"""Prepare for this file to be created."""
if self.exists():
- if not self.precious:
+ if self.builder and not self.precious:
os.unlink(self.path)
if hasattr(self, '_exists'):
delattr(self, '_exists')
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 24a508b..3bba3f4 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -493,9 +493,16 @@ class FSTestCase(unittest.TestCase):
nonexistent(fs.Dir, 'nonexistent')
nonexistent(fs.Dir, 'nonexistent/foo')
+ test.write("preserve_me", "\n")
+ assert os.path.exists(test.workpath("preserve_me"))
+ f1 = fs.File(test.workpath("preserve_me"))
+ f1.prepare()
+ assert os.path.exists(test.workpath("preserve_me"))
+
test.write("remove_me", "\n")
assert os.path.exists(test.workpath("remove_me"))
f1 = fs.File(test.workpath("remove_me"))
+ f1.builder = 1
f1.prepare()
assert not os.path.exists(test.workpath("remove_me"))