public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_parallel_manifest/, pym/_emerge/
@ 2013-01-06 20:50 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2013-01-06 20:50 UTC (permalink / raw
  To: gentoo-commits

commit:     8192978cc3a38959a94a63f40f1e4585beb674e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  6 20:50:28 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan  6 20:50:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8192978c

MetadataRegen: call cp_all for each category

List categories individually, in order to start yielding quicker,
and in order to reduce latency in case of a signal interrupt.

---
 pym/_emerge/MetadataRegen.py                       |   20 +++++++++++---------
 .../ebuild/_parallel_manifest/ManifestScheduler.py |   17 ++++++++++-------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 8dc7ebe..213fc3d 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -33,15 +33,16 @@ class MetadataRegen(AsyncScheduler):
 		return next(self._process_iter)
 
 	def _iter_every_cp(self):
-		portage.writemsg_stdout("Listing available packages...\n")
-		every_cp = self._portdb.cp_all()
-		portage.writemsg_stdout("Regenerating cache entries...\n")
-		every_cp.reverse()
-		try:
-			while not self._terminated_tasks:
-				yield every_cp.pop()
-		except IndexError:
-			pass
+		# List categories individually, in order to start yielding quicker,
+		# and in order to reduce latency in case of a signal interrupt.
+		categories = sorted(self._portdb.settings.categories, reverse=True)
+		cp_all = self._portdb.cp_all
+
+		while categories:
+			category = categories.pop()
+			category_cps = cp_all(categories=(category,), reverse=True)
+			while category_cps:
+				yield category_cps.pop()
 
 	def _iter_metadata_processes(self):
 		portdb = self._portdb
@@ -49,6 +50,7 @@ class MetadataRegen(AsyncScheduler):
 		cp_set = self._cp_set
 		consumer = self._consumer
 
+		portage.writemsg_stdout("Regenerating cache entries...\n")
 		for cp in self._cp_iter:
 			if self._terminated.is_set():
 				break

diff --git a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
index 50c9c74..8839989 100644
--- a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
+++ b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
@@ -30,13 +30,16 @@ class ManifestScheduler(AsyncScheduler):
 		return next(self._task_iter)
 
 	def _iter_every_cp(self):
-		every_cp = self._portdb.cp_all()
-		every_cp.reverse()
-		try:
-			while not self._terminated_tasks:
-				yield every_cp.pop()
-		except IndexError:
-			pass
+		# List categories individually, in order to start yielding quicker,
+		# and in order to reduce latency in case of a signal interrupt.
+		categories = sorted(self._portdb.settings.categories, reverse=True)
+		cp_all = self._portdb.cp_all
+
+		while categories:
+			category = categories.pop()
+			category_cps = cp_all(categories=(category,), reverse=True)
+			while category_cps:
+				yield category_cps.pop()
 
 	def _iter_tasks(self):
 		portdb = self._portdb


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_parallel_manifest/, pym/_emerge/
@ 2013-01-07  0:28 Zac Medico
  0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2013-01-07  0:28 UTC (permalink / raw
  To: gentoo-commits

commit:     085444eb5ad618a35107a1276da70f3ed7ca848c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  7 00:28:04 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jan  7 00:28:04 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=085444eb

MetadataRegen: simplify _iter_every_cp

---
 pym/_emerge/MetadataRegen.py                       |   10 +++-------
 .../ebuild/_parallel_manifest/ManifestScheduler.py |   10 +++-------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 213fc3d..bdf2fa7 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -35,14 +35,10 @@ class MetadataRegen(AsyncScheduler):
 	def _iter_every_cp(self):
 		# List categories individually, in order to start yielding quicker,
 		# and in order to reduce latency in case of a signal interrupt.
-		categories = sorted(self._portdb.settings.categories, reverse=True)
 		cp_all = self._portdb.cp_all
-
-		while categories:
-			category = categories.pop()
-			category_cps = cp_all(categories=(category,), reverse=True)
-			while category_cps:
-				yield category_cps.pop()
+		for category in sorted(self._portdb.categories):
+			for cp in cp_all(categories=(category,)):
+				yield cp
 
 	def _iter_metadata_processes(self):
 		portdb = self._portdb

diff --git a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
index 8839989..38ac482 100644
--- a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
+++ b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py
@@ -32,14 +32,10 @@ class ManifestScheduler(AsyncScheduler):
 	def _iter_every_cp(self):
 		# List categories individually, in order to start yielding quicker,
 		# and in order to reduce latency in case of a signal interrupt.
-		categories = sorted(self._portdb.settings.categories, reverse=True)
 		cp_all = self._portdb.cp_all
-
-		while categories:
-			category = categories.pop()
-			category_cps = cp_all(categories=(category,), reverse=True)
-			while category_cps:
-				yield category_cps.pop()
+		for category in sorted(self._portdb.categories):
+			for cp in cp_all(categories=(category,)):
+				yield cp
 
 	def _iter_tasks(self):
 		portdb = self._portdb


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-07  0:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-06 20:50 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/_parallel_manifest/, pym/_emerge/ Zac Medico
  -- strict thread matches above, loose matches on Subject: below --
2013-01-07  0:28 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox