summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-20 20:25:31 (GMT)
committerSteven Knight <knight@baldmt.com>2004-09-20 20:25:31 (GMT)
commitfec8f3c96bedd45fe3f0c594f2bdec8389cef108 (patch)
tree6f68448cf9e1390d253fead8cd30305641c79e0a
parentddc11499f2a5074965cf5574b9a6728564c4984c (diff)
downloadSCons-fec8f3c96bedd45fe3f0c594f2bdec8389cef108.zip
SCons-fec8f3c96bedd45fe3f0c594f2bdec8389cef108.tar.gz
SCons-fec8f3c96bedd45fe3f0c594f2bdec8389cef108.tar.bz2
Fix handling when BuildDir exists but is unwriteable. Add Stop. to messages at SConscript-read time. (Kevin Quick)
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Node/FS.py2
-rw-r--r--src/engine/SCons/Script/__init__.py4
-rw-r--r--test/BuildDir-errors.py14
4 files changed, 16 insertions, 7 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 3fc014f..000c943 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -123,6 +123,9 @@ RELEASE 0.97 - XXX
function, use its strfunction() method (if any) to display the
action.
+ - Fix handling when BuildDir() exists but is unwriteable. Add
+ "Stop." to those error messages for consistency.
+
From Christoph Wiedemann:
- Add an Environment.SetDefault() method that only sets values if
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 7f60c7b..5015c84 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -1675,7 +1675,7 @@ class File(Base):
try:
Link(self, src, None)
except SCons.Errors.BuildError, e:
- desc = "Cannot duplicate `%s' in `%s': %s." % (src, self.dir, e.errstr)
+ desc = "Cannot duplicate `%s' in `%s': %s." % (src.path, self.dir.path, e.errstr)
raise SCons.Errors.StopError, desc
self.linked = 1
# The Link() action may or may not have actually
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index 160fae3..4832b02 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -912,9 +912,9 @@ def _main(args, parser):
# couldn't be copied in to the BuildDir. Since we're just
# reading SConscript files and haven't started building
# things yet, stop regardless of whether they used -i or -k
- # or anything else, but don't say "Stop." on the message.
+ # or anything else.
global exit_status
- sys.stderr.write("scons: *** %s\n" % e)
+ sys.stderr.write("scons: *** %s Stop.\n" % e)
exit_status = 2
sys.exit(exit_status)
global sconscript_time
diff --git a/test/BuildDir-errors.py b/test/BuildDir-errors.py
index 967384c..93cd3ec 100644
--- a/test/BuildDir-errors.py
+++ b/test/BuildDir-errors.py
@@ -66,6 +66,12 @@ def cat(env, source, target):
env = Environment(BUILDERS={'Build':Builder(action=cat)},
SCANNERS=[Scanner(fake_scan, skeys = ['.in'])])
+
+# Do some Node test operations to ensure no side-effects cause failures
+File('file.in').exists()
+File('file.in').is_derived()
+File('file.in').is_pseudo_derived()
+
env.Build('file.out', 'file.in')
""")
@@ -87,7 +93,7 @@ if sys.platform != 'win32':
test.run(chdir = 'ro-dir',
arguments = ".",
status = 2,
- stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied.\n" % os.path.join('src', 'SConscript'))
+ stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied. Stop.\n" % os.path.join('src', 'SConscript'))
# Verify the error when the SConscript file within the BuildDir is
# read-only. Note that we have to make the directory read-only too,
@@ -104,7 +110,7 @@ os.chmod(dir, os.stat(dir)[stat.ST_MODE] & ~stat.S_IWUSR)
test.run(chdir = 'ro-SConscript',
arguments = ".",
status = 2,
- stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied.\n" % os.path.join('src', 'SConscript'))
+ stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied. Stop.\n" % os.path.join('src', 'SConscript'))
os.chmod('ro-SConscript', os.stat('ro-SConscript')[stat.ST_MODE] | stat.S_IWUSR)
f.close()
@@ -112,7 +118,7 @@ f.close()
test.run(chdir = 'ro-SConscript',
arguments = ".",
status = 2,
- stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied.\n" % os.path.join('src', 'SConscript'))
+ stderr = "scons: *** Cannot duplicate `%s' in `build': Permission denied. Stop.\n" % os.path.join('src', 'SConscript'))
# Verify the error when the source file within the BuildDir is
# read-only. Note that we have to make the directory read-only too,
@@ -140,7 +146,7 @@ test.run(chdir = 'ro-src',
arguments = "-k .",
status = 2,
stderr = """\
-scons: *** Cannot duplicate `%s' in `build': Permission denied.
+scons: *** Cannot duplicate `%s' in `build': Permission denied. Stop.
""" % (os.path.join('src', 'file.in')))
f.close()