From: Zac Medico Date: Fri, 4 Jul 2008 11:12:01 +0000 (-0000) Subject: Split out a Scheduler._execute_pkg() method from _merge(). X-Git-Tag: v2.2_rc2~212 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f71f67b12272b5a1f9b2d85fa56a449204317dee;p=portage.git Split out a Scheduler._execute_pkg() method from _merge(). svn path=/main/trunk/; revision=10926 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 07008d636..4a9fbd710 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -7504,31 +7504,13 @@ class Scheduler(object): # blockers continue - if not pkg.installed: - self._pkg_count.curval += 1 - - merge = MergeListItem(args_set=self._args_set, - binpkg_opts=self._binpkg_opts, - build_opts=self._build_opts, - emerge_opts=self.myopts, - failed_fetches=self._failed_fetches, - find_blockers=self._find_blockers(pkg), logger=self._logger, - mtimedb=self._mtimedb, pkg=pkg, pkg_count=self._pkg_count, - prefetcher=self._prefetchers.get(pkg), - scheduler=self._sched_iface, - settings=self.pkgsettings[pkg.root], - world_atom=self._world_atom) - - retval = merge.execute() + retval = self._execute_pkg(pkg) if retval != os.EX_OK: if not self._build_opts.fetchonly: return retval - self.curval += 1 - if pkg.installed: - # There's nothing left to do for uninstall. continue self._restart_if_necessary(pkg) @@ -7547,6 +7529,30 @@ class Scheduler(object): self._task_queues.prefetch.clear() return os.EX_OK + def _execute_pkg(self, pkg): + + if not pkg.installed: + self._pkg_count.curval += 1 + + merge = MergeListItem(args_set=self._args_set, + binpkg_opts=self._binpkg_opts, + build_opts=self._build_opts, + emerge_opts=self.myopts, + failed_fetches=self._failed_fetches, + find_blockers=self._find_blockers(pkg), logger=self._logger, + mtimedb=self._mtimedb, pkg=pkg, pkg_count=self._pkg_count, + prefetcher=self._prefetchers.get(pkg), + scheduler=self._sched_iface, + settings=self.pkgsettings[pkg.root], + world_atom=self._world_atom) + + retval = merge.execute() + + if retval == os.EX_OK: + self.curval += 1 + + return retval + def _save_resume_list(self): """ Do this before verifying the ebuild Manifests since it might