From 20a3aeb85d88d767f16e1f8b27725ba0f925675a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Jul 2008 08:24:07 +0000 Subject: 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 --- pym/portage/dbapi/vartree.py | 10 +++++++--- 1 file 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 -- cgit v1.2.3-1-g7c22