Split out a Scheduler._execute_pkg() method from _merge().
authorZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 11:12:01 +0000 (11:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 4 Jul 2008 11:12:01 +0000 (11:12 -0000)
svn path=/main/trunk/; revision=10926

pym/_emerge/__init__.py

index 07008d636a88e84d489221764658e910f6e75e0f..4a9fbd710d991863be090c14a58572f6a8e0113c 100644 (file)
@@ -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