_emerge.MetadataRegen.MetadataRegen._iter_metadata_processes():
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Sat, 11 Feb 2012 22:14:43 +0000 (23:14 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Sat, 11 Feb 2012 22:14:43 +0000 (23:14 +0100)
Regenerate metadata for given cpv in each repository.

pym/_emerge/MetadataRegen.py

index efe300421601d3fdb6d00c2b2f6aa978a39de32b..e0c80925f55b9d07816164af83cb74976ae9db87 100644 (file)
@@ -1,8 +1,9 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import portage
 from portage import os
+from portage.dep import _repo_separator
 from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
 from _emerge.PollScheduler import PollScheduler
 
@@ -61,26 +62,27 @@ class MetadataRegen(PollScheduler):
                                break
                        cp_set.add(cp)
                        portage.writemsg_stdout("Processing %s\n" % cp)
-                       cpv_list = portdb.cp_list(cp)
-                       for cpv in cpv_list:
-                               if self._terminated_tasks:
-                                       break
-                               valid_pkgs.add(cpv)
-                               ebuild_path, repo_path = portdb.findname2(cpv)
-                               if ebuild_path is None:
-                                       raise AssertionError("ebuild not found for '%s'" % cpv)
-                               metadata, ebuild_hash = portdb._pull_valid_cache(
-                                       cpv, ebuild_path, repo_path)
-                               if metadata is not None:
-                                       if consumer is not None:
-                                               consumer(cpv, repo_path, metadata, ebuild_hash)
-                                       continue
-
-                               yield EbuildMetadataPhase(cpv=cpv,
-                                       ebuild_hash=ebuild_hash,
-                                       metadata_callback=portdb._metadata_callback,
-                                       portdb=portdb, repo_path=repo_path,
-                                       settings=portdb.doebuild_settings)
+                       for repo in portdb.repositories:
+                               cpv_list = portdb.cp_list(cp, mytree=[repo.location])
+                               for cpv in cpv_list:
+                                       if self._terminated_tasks:
+                                               break
+                                       valid_pkgs.add(cpv)
+                                       ebuild_path, repo_path = portdb.findname2(cpv, myrepo=repo.name)
+                                       if ebuild_path is None:
+                                               raise AssertionError("ebuild not found for '%s%s%s'" % (cpv, _repo_separator, repo.name))
+                                       metadata, ebuild_hash = portdb._pull_valid_cache(
+                                               cpv, ebuild_path, repo_path)
+                                       if metadata is not None:
+                                               if consumer is not None:
+                                                       consumer(cpv, repo_path, metadata, ebuild_hash)
+                                               continue
+
+                                       yield EbuildMetadataPhase(cpv=cpv,
+                                               ebuild_hash=ebuild_hash,
+                                               metadata_callback=portdb._metadata_callback,
+                                               portdb=portdb, repo_path=repo_path,
+                                               settings=portdb.doebuild_settings)
 
        def _keep_scheduling(self):
                return self._remaining_tasks and not self._terminated_tasks