From: Zac Medico Date: Tue, 1 Jul 2008 08:24:07 +0000 (-0000) Subject: Handle potential errors in PreservedLibsRegistry.store() now that it can X-Git-Tag: v2.2_rc2~261 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=20a3aeb85d88d767f16e1f8b27725ba0f925675a;p=portage.git 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 --- 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