diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-07-01 08:24:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-07-01 08:24:07 +0000 |
commit | 20a3aeb85d88d767f16e1f8b27725ba0f925675a (patch) | |
tree | 9d7091cc9af82a261053cd957653fc306a9c23cc | |
parent | 27c45c6b94e642f5914a9e592b18fba4ffdec1f6 (diff) | |
download | portage-20a3aeb85d88d767f16e1f8b27725ba0f925675a.tar.gz portage-20a3aeb85d88d767f16e1f8b27725ba0f925675a.tar.bz2 portage-20a3aeb85d88d767f16e1f8b27725ba0f925675a.zip |
Handle potential errors in PreservedLibsRegistry.store() now that it can
be called via pruneNonExisting(), due to things such as portageq calls
where the user may not have write permission to the registry.
svn path=/main/trunk/; revision=10865
-rw-r--r-- | pym/portage/dbapi/vartree.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index d508d46c9..4ca0b9b1d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -64,9 +64,13 @@ class PreservedLibsRegistry(object): """ Store the registry data to file. No need to call this if autocommit was enabled. """ - f = atomic_ofstream(self._filename) - cPickle.dump(self._data, f) - f.close() + try: + f = atomic_ofstream(self._filename) + cPickle.dump(self._data, f) + f.close() + except EnvironmentError, e: + if e.errno != PermissionDenied.errno: + writemsg("!!! %s %s\n" % (e, self._filename), noiselevel=-1) def register(self, cpv, slot, counter, paths): """ Register new objects in the registry. If there is a record with the |