From: Zac Medico Date: Sat, 26 Mar 2011 23:25:15 +0000 (-0700) Subject: MergeProcess: query blockers in the main process X-Git-Tag: v2.2.0_alpha29~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dfc5e174bdbcb21a16c5d5bb464ea4fc43b456a5;p=portage.git MergeProcess: query blockers in the main process Metadata cache queries may not work for some databases from within a subprocess. For example, sqlite is known to misbehave. --- diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py index 43111cb16..ea7c3e6d6 100644 --- a/pym/portage/dbapi/_MergeProcess.py +++ b/pym/portage/dbapi/_MergeProcess.py @@ -114,9 +114,15 @@ class MergeProcess(SpawnProcess): elog_reader_fd, elog_writer_fd = os.pipe() fcntl.fcntl(elog_reader_fd, fcntl.F_SETFL, fcntl.fcntl(elog_reader_fd, fcntl.F_GETFL) | os.O_NONBLOCK) + blockers = None + if self.blockers is not None: + # Query blockers in the main process, since metadata cache + # queries may not work for some databases from within a + # subprocess. For example, sqlite is known to misbehave. + blockers = self.blockers() mylink = self.dblink(self.mycat, self.mypkg, settings=self.settings, treetype=self.treetype, vartree=self.vartree, - blockers=self.blockers, scheduler=self.scheduler, + blockers=blockers, scheduler=self.scheduler, pipe=elog_writer_fd) fd_pipes[elog_writer_fd] = elog_writer_fd self._elog_reg_id = self.scheduler.register(elog_reader_fd, diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 4be783ddd..45b5a6983 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -3076,9 +3076,7 @@ class dblink(object): return 1 # check for package collisions - blockers = None - if self._blockers is not None: - blockers = self._blockers() + blockers = self._blockers if blockers is None: blockers = [] collisions, plib_collisions = \