From: Zac Medico Date: Sat, 13 Jul 2013 18:19:27 +0000 (-0700) Subject: portageq: avoid portdbapi instantiation X-Git-Tag: v2.2.0_alpha189~56 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=36106c00b650dab8b482ebc7a56b77b872bd5f40;p=portage.git portageq: avoid portdbapi instantiation The portdbapi takes time to instantiate, and for some commands we really only need the RepoConfig instance. --- diff --git a/bin/portageq b/bin/portageq index 4be9f8890..0e1cb6408 100755 --- a/bin/portageq +++ b/bin/portageq @@ -725,7 +725,7 @@ def get_repos(argv): if len(argv) < 1: print("ERROR: insufficient parameters!") return 2 - print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories())) + print(" ".join(reversed(portage.db[argv[0]]["vartree"].settings.repositories.prepos_order))) get_repos.uses_eroot = True @@ -741,7 +741,7 @@ def master_repositories(argv): print("ERROR: invalid repository: %s" % arg, file=sys.stderr) return 2 try: - repo = portage.db[argv[0]]["porttree"].dbapi.repositories[arg] + repo = portage.db[argv[0]]["vartree"].settings.repositories[arg] except KeyError: print("") return 1 @@ -761,7 +761,7 @@ def get_repo_path(argv): if portage.dep._repo_name_re.match(arg) is None: print("ERROR: invalid repository: %s" % arg, file=sys.stderr) return 2 - path = portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg) + path = portage.db[argv[0]]["vartree"].settings.repositories.treemap.get(arg) if path is None: print("") return 1 @@ -781,7 +781,7 @@ def available_eclasses(argv): print("ERROR: invalid repository: %s" % arg, file=sys.stderr) return 2 try: - repo = portage.db[argv[0]]["porttree"].dbapi.repositories[arg] + repo = portage.db[argv[0]]["vartree"].settings.repositories[arg] except KeyError: print("") return 1 @@ -801,7 +801,7 @@ def eclass_path(argv): print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr) return 2 try: - repo = portage.db[argv[0]]["porttree"].dbapi.repositories[argv[1]] + repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]] except KeyError: print("") return 1 @@ -830,7 +830,7 @@ def license_path(argv): print("ERROR: invalid repository: %s" % argv[1], file=sys.stderr) return 2 try: - repo = portage.db[argv[0]]["porttree"].dbapi.repositories[argv[1]] + repo = portage.db[argv[0]]["vartree"].settings.repositories[argv[1]] except KeyError: print("") return 1