From: stevenknight Date: Sat, 22 Feb 2003 14:18:53 +0000 (+0000) Subject: Fix Install test portability by converting an OSError when we prepare a target file... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b8885162644445f1e67acb1b70be01da81f969b9;p=scons.git Fix Install test portability by converting an OSError when we prepare a target file by unlinking it into a BuildError. git-svn-id: http://scons.tigris.org/svn/scons/trunk@596 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 9fa0501d..64708001 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -25,6 +25,9 @@ RELEASE 0.12 - XXX - Make the internal to_String() function more efficient. + - Make the error message the same as other build errors when there's a + problem unlinking a target file in preparation for it being built. + RELEASE 0.11 - Tue, 11 Feb 2003 05:24:33 -0600 diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index e2378b16..8d5a45f3 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1044,7 +1044,11 @@ class File(Entry): if self.exists(): if self.has_builder() and not self.precious: - Unlink(self, None, None) + try: + Unlink(self, None, None) + except OSError, e: + raise SCons.Errors.BuildError(node = self, + errstr = e.strerror) if hasattr(self, '_exists'): delattr(self, '_exists') else: diff --git a/test/Install.py b/test/Install.py index 629c136c..f69c954b 100644 --- a/test/Install.py +++ b/test/Install.py @@ -103,7 +103,7 @@ os.chmod(test.workpath('export'), 0555) f = open(f1_out, 'rb') test.run(arguments = f1_out, - stderr="scons: *** [Errno 13] Permission denied: '%s'\n" % os.path.join('export', 'f1.out'), + stderr="scons: *** [%s] Permission denied\n" % os.path.join('export', 'f1.out'), status=2) f.close()