diff options
author | Steven Knight <knight@baldmt.com> | 2005-10-08 03:04:43 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-10-08 03:04:43 (GMT) |
commit | af9c2236034aec3e408ae4dd6f2eb8bbc7e24f2f (patch) | |
tree | e0233acdd42ad10c17372dd883e8a1e78dc7fadb /src | |
parent | ea890f45633f896cf9cb3459c57e955de9a51231 (diff) | |
download | SCons-af9c2236034aec3e408ae4dd6f2eb8bbc7e24f2f.zip SCons-af9c2236034aec3e408ae4dd6f2eb8bbc7e24f2f.tar.gz SCons-af9c2236034aec3e408ae4dd6f2eb8bbc7e24f2f.tar.bz2 |
Handle failure to chmod() the .sconsign.dblite file, if it's owned by another UID.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/dblite.py | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 516fe98..52fd977 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -337,6 +337,9 @@ RELEASE 0.97 - XXX - Fix a signature refactoring bug that caused Qt header files to get re-generated every time. + - Don't fail when writing signatures if the .sconsign.dblite file is + owned by a different user (e.g. root) from a previous run. + From Chen Lee: - Handle Visual Studio project and solution files in Unicode. diff --git a/src/engine/SCons/dblite.py b/src/engine/SCons/dblite.py index 505a793..7a8846e 100644 --- a/src/engine/SCons/dblite.py +++ b/src/engine/SCons/dblite.py @@ -79,8 +79,13 @@ class dblite: cPickle.dump(self._dict, f, 1) f.close() # Win32 doesn't allow renaming if the file exists, so unlink it first, - # chmod'ing it to make sure we can do so. - os.chmod(self._file_name, 0777) + # chmod'ing it to make sure we can do so. On UNIX, we may not be able + # to chmod the file if it's owned by someone else (e.g. from a previous + # run as root). We should still be able to unlink() the file if the + # directory's writable, though, so ignore any OSError exception thrown + # by the chmod() call. + try: os.chmod(self._file_name, 0777) + except OSError: pass os.unlink(self._file_name) os.rename(self._tmp_name, self._file_name) self._needs_sync = 00000 |