[gentoo-portage-dev] [PATCH] emerge --verbose --quiet-repo-display: Delete deprecated code

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
[[[
emerge --verbose --quiet-repo-display: Delete deprecated code.

Use portage.repository.config.RepoConfigLoader.__iter__() instead of deprecated
PORTDIR and PORTDIR_OVERLAY.
1 call to deprecated 
portage.repository.config.RepoConfigLoader.mainRepoLocation()
has been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/_emerge/resolver/output_helpers.py
+++ pym/_emerge/resolver/output_helpers.py
@@ -39,24 +39,13 @@
 		self._unknown_repo = False
 		repo_paths = set()
 		for root_config in roots.values():
-			portdir = root_config.settings.get(PORTDIR)
-			if portdir:
-repo_paths.add(portdir)
-			overlays = root_config.settings.get(PORTDIR_OVERLAY)
-			if overlays:
-repo_paths.update(shlex_split(overlays))
+			for repo in root_config.settings.repositories:
+repo_paths.add(repo.location)
 		repo_paths = list(repo_paths)
 		self._repo_paths = repo_paths
 		self._repo_paths_real = [ os.path.realpath(repo_path) \
 			for repo_path in repo_paths ]
 
-		# pre-allocate index for PORTDIR so that it always has index 0.
-		for root_config in roots.values():
-			portdb = root_config.trees[porttree].dbapi
-			portdir = portdb.repositories.mainRepoLocation()
-			if portdir:
-self.repoStr(portdir)
-
 	def repoStr(self, repo_path_real):
 		real_index = -1
 		if repo_path_real:
@@ -80,7 +69,7 @@
 		shown_repos = self._shown_repos
 		unknown_repo = self._unknown_repo
 		if shown_repos or self._unknown_repo:
-			output.append(Portage tree and overlays:\n)
+			output.append(Repositories:\n)
 		show_repo_paths = list(shown_repos)
 		for repo_path, repo_index in shown_repos.items():
 			show_repo_paths[repo_index] = repo_path


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-portage-dev] [PATCH] emerge --verbose --quiet-repo-display: Delete deprecated code

2014-12-13 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

LGTM.

- -- 
Alexander
berna...@gentoo.org
https://secure.plaimi.net/~alexander
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlSMP2QACgkQRtClrXBQc7XZgQD9GbzeRGrm8t7F//CFcKB6vIxS
vK9W61OU+RNmcXcHP/wA/1QCjntU3rXCHQURrS3Vl+q4I94rfTbCa498IFglMRRd
=Uswa
-END PGP SIGNATURE-



Re: [gentoo-portage-dev] [PATCH] emerge --info: Always print ::repository

2014-12-13 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

LGTM.

- -- 
Alexander
berna...@gentoo.org
https://secure.plaimi.net/~alexander
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlSMP94ACgkQRtClrXBQc7WhUQEAjNuyqPvNquEjWkbeQY/nHuVi
dUOJhIa6Sa6nOKOXf1gBALZkSsyuOXQe1CNGFN/qZkEdzqjqJwubZm2VItxVg/DW
=AFac
-END PGP SIGNATURE-



Re: [gentoo-portage-dev] [PATCH] emerge --verbose --quiet-repo-display: Delete deprecated code

2014-12-13 Thread Brian Dolbec
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On Sat, 13 Dec 2014 14:30:12 +0100
Alexander Berntsen berna...@gentoo.org wrote:

 
 LGTM.
 
 - -- 
 Alexander
 berna...@gentoo.org
 https://secure.plaimi.net/~alexander
 

Yes, but hold off pushing this one for a bit.

I need to think about when we can stabilize layman with the repos.conf
support.  If this hits the tree in a regular release before a layman
release is stable. We'll be hearing a lot of flak over it.

I think we should be able to start a layman stabilization soon... need
to check on bugs, etc..
- -- 
Brian Dolbec dolsen

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0

iQJ8BAEBCgBmBQJUjFMcXxSAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2OUZEQTI0MjY5QzhCNUE3RTlFMjMxRTkw
MTg2ODIyMzFCOTI2RTRGAAoJEAGGgiMbkm5PxVMP/Ryn+yqmFMoJ/DNb2yTcExfV
n+8NEZ2IlNBWEnc0haRfsCkQmGgiSK0jAZANxYHf3y48JvoTyl1GDnYmGTHxQ5dq
CRFAo5Zw9KMcQfHIMw9Ziy/6llWD4cJ9kK5sFmT8QEAJttvzXwYvCTxIJRpsEHDZ
rvm87wyJwHoPbTCnatDgcjeGn8WEbsWf2w+c/ZYR+zvfisH4MwITiT7blUteDy1R
iJ0CBElr7m2QPEm9Pg/fJFuJk32EJCFl7CaF/97U8v3nmg3S+vv/RGJYjXEKW0//
dsxyNNU+f3Bgslkq9oTomxjo7f5LoH58M4aRdy8ZxtsQcYbfwYTXjrveQynXXlJG
w4XosjJTU6yRJ4NdBoiRdONgWnbK1rWIN/S2zAGmMQ0hsevXKi8BZiLWM/9M6RsB
aUyIppBEzuPPlLqoSVrUp2McdcyTjJ2JIxn+0GRtfFKbgSF3hUPXi7cu02Joe06D
u1328RZoynj4ix2pXVefg6gOGUfz2fU+G7yH60FT1XjzGJjhBJ4ygjbWSJ1lKNSR
MZS6CZnZi70vTKpvjtKDyTV6oLd+4J1qkU+t81mhAtECo8rbxEjen71fptEevyRv
6h9CSw+zQ/eWBSSH37qDkM2GZ76uWdOSA0yH0HmMszN4uEGm0S9G+zp3lZm5jlZ8
31LKN+vk/85IiUfspPMD
=2YxE
-END PGP SIGNATURE-


[gentoo-portage-dev] [PATCH] portageq pquery: Search ebuilds in all repositories be default

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
[[[
portageq pquery: Search ebuilds in all repositories be default.

--all-repos option is no longer supported.
1 call to deprecated portage.repository.config.RepoConfigLoader.mainRepo() 
function
has been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- bin/portageq
+++ bin/portageq
@@ -1075,14 +1075,10 @@
 			herds.extend(x.split(,))
 		xml_matchers.append(HerdMatcher(herds))
 
-	repos = []
-	if opts.all_repos:
-		repos.extend(portdb.repositories.get_repo_for_location(location)
-			for location in portdb.porttrees)
-	elif opts.repo is not None:
-		repos.append(portdb.repositories[opts.repo])
+	if opts.repo is not None:
+		repos = [portdb.repositories[opts.repo]]
 	else:
-		repos.append(portdb.repositories.mainRepo())
+		repos = list(portdb.repositories)
 
 	if not atoms:
 		names = None
@@ -1220,12 +1216,8 @@
 },
 {
 	longopt: --repo,
-	help: repo to use (default is PORTDIR if omitted)
+	help: repository to use (all repositories are used by default)
 },
-{
-	longopt: --all-repos,
-	help: search all repos
-}
 			)
 		),
 		(


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] portage.dbapi.bintree.binarytree: Delete PORTDIR-reliant microoptimization in index of binary packages

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
[[[
portage.dbapi.bintree.binarytree: Delete PORTDIR-reliant microoptimization in 
index of binary packages.

This microoptimization cannot work when no main repository exists.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/portage/dbapi/bintree.py
+++ pym/portage/dbapi/bintree.py
@@ -360,16 +360,6 @@
 repository   : ,
 			}
 
-			# It is especially important to populate keys like
-			# repository that save space when entries can
-			# inherit them from the header. If an existing
-			# pkgindex header already defines these keys, then
-			# they will appropriately override our defaults.
-			main_repo = self.settings.repositories.mainRepo()
-			if main_repo is not None and not main_repo.missing_repo_name:
-self._pkgindex_default_header_data[repository] = \
-	main_repo.name
-
 			self._pkgindex_translated_keys = (
 (DESCRIPTION   ,   DESC),
 (repository,   REPO),


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] portage.tests.dbapi.test_portdb_cache: Delete deprecated code.

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
[[[
portage.tests.dbapi.test_portdb_cache: Delete deprecated code.

9 calls to deprecated 
portage.repository.config.RepoConfigLoader.mainRepoLocation()
function have been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/portage/tests/dbapi/test_portdb_cache.py
+++ pym/portage/tests/dbapi/test_portdb_cache.py
@@ -47,7 +47,7 @@
 			(lambda: not os.path.exists(md5_cache_dir),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
-if portage.portdb.repositories.mainRepoLocation() in portage.portdb._pregen_auxdb:
+if portage.portdb.repositories['test_repo'].location in portage.portdb._pregen_auxdb:
 	sys.exit(1)
 			),),
 
@@ -56,13 +56,13 @@
 			(lambda: os.path.exists(md5_cache_dir),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
-if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb:
+if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb:
 	sys.exit(1)
 			),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
 from portage.cache.flat_hash import md5_database
-if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], md5_database):
+if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], md5_database):
 	sys.exit(1)
 			),),
 
@@ -73,13 +73,13 @@
 			(lambda: os.path.exists(md5_cache_dir),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
-if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb:
+if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb:
 	sys.exit(1)
 			),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
 from portage.cache.flat_hash import md5_database
-if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], md5_database):
+if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], md5_database):
 	sys.exit(1)
 			),),
 
@@ -90,13 +90,13 @@
 (cache-formats = pms md5-dict, layout_conf_path,,
 			(portage_python, -b, -Wd, -Wi::DeprecationWarning, -c) + (textwrap.dedent(
 import os, sys, portage
-if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb:
+if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb:
 	sys.exit(1)
 			),),
 			(portage_python, -b, -Wd, -Wi::DeprecationWarning, -c) + (textwrap.dedent(
 import os, sys, portage
 from portage.cache.metadata import database as pms_database
-if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], pms_database):
+if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], pms_database):
 	sys.exit(1)
 			),),
 
@@ -105,13 +105,13 @@
 			(BASH_BINARY, -c, rm %s % portage._shell_quote(layout_conf_path)),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
-if portage.portdb.repositories.mainRepoLocation() not in portage.portdb._pregen_auxdb:
+if portage.portdb.repositories['test_repo'].location not in portage.portdb._pregen_auxdb:
 	sys.exit(1)
 			),),
 			python_cmd + (textwrap.dedent(
 import os, sys, portage
 from portage.cache.flat_hash import md5_database
-if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories.mainRepoLocation()], md5_database):
+if not isinstance(portage.portdb._pregen_auxdb[portage.portdb.repositories['test_repo'].location], md5_database):
 	sys.exit(1)
 			),),
 		)


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] portage.tests.glsa.test_security_set: Delete deprecated code

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
[[[
portage.tests.glsa.test_security_set: Delete deprecated code.

1 call to deprecated 
portage.repository.config.RepoConfigLoader.mainRepoLocation()
function has been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/portage/tests/glsa/test_security_set.py
+++ pym/portage/tests/glsa/test_security_set.py
@@ -1,4 +1,4 @@
-# Copyright 2013 Gentoo Foundation
+# Copyright 2013-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -129,8 +129,7 @@
 		try:
 
 			portdb = playground.trees[playground.eroot][porttree].dbapi
-			glsa_dir = os.path.join(
-portdb.repositories.mainRepoLocation(), 'metadata', 'glsa')
+			glsa_dir = os.path.join(portdb.repositories['test_repo'].location, 'metadata', 'glsa')
 			portage.util.ensure_dirs(glsa_dir)
 			for glsa in glsas:
 with io.open(os.path.join(glsa_dir,


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-portage-dev] [PATCH] portage.tests.glsa.test_security_set: Delete deprecated code

2014-12-13 Thread Zac Medico
On 12/13/2014 08:59 AM, Arfrever Frehtes Taifersar Arahesis wrote:
 [[[
 portage.tests.glsa.test_security_set: Delete deprecated code.
 
 1 call to deprecated 
 portage.repository.config.RepoConfigLoader.mainRepoLocation()
 function has been deleted.
 ]]]
 
 --
 Arfrever Frehtes Taifersar Arahesis
 

LGTM.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] emerge --info: Check metadata/timestamp.chk in all repositories

2014-12-13 Thread Zac Medico
On 12/13/2014 09:33 AM, Arfrever Frehtes Taifersar Arahesis wrote:
 [[[
 emerge --info: Check metadata/timestamp.chk in all repositories.
 
 1 use of deprecated PORTDIR has been deleted.
 ]]]
 
 --
 Arfrever Frehtes Taifersar Arahesis
 

LGTM.

However, I dislike the os.path.isfile() call, because it's a redundant
stat call. Can't we just call grabfile, and ignore any exception that it
may raise?
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] emerge --info: Check metadata/timestamp.chk in all repositories

2014-12-13 Thread Arfrever Frehtes Taifersar Arahesis
New patch without os.path.isfile().

[[[
emerge --info: Check metadata/timestamp.chk in all repositories.

1 use of deprecated PORTDIR has been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/_emerge/actions.py
+++ pym/_emerge/actions.py
@@ -1452,6 +1452,7 @@
 	vardb = trees[eroot][vartree].dbapi
 	portdb = trees[eroot]['porttree'].dbapi
 	bindb = trees[eroot][bintree].dbapi
+	repos = portdb.settings.repositories
 	for x in myfiles:
 		any_match = False
 		cp_exists = bool(vardb.match(x.cp))
@@ -1554,13 +1555,10 @@
 			line += ,%10d free % (vm_info[swap.free] // 1024,)
 		append(line)
 
-	lastSync = portage.grabfile(os.path.join(
-		settings[PORTDIR], metadata, timestamp.chk))
-	if lastSync:
-		lastSync = lastSync[0]
-	else:
-		lastSync = Unknown
-	append(Timestamp of tree: %s % (lastSync,))
+	for repo in repos:
+		last_sync = portage.grabfile(os.path.join(repo.location, metadata, timestamp.chk))
+		if last_sync:
+			append(Timestamp of repository %s: %s % (repo.name, last_sync[0]))
 
 	# Searching contents for the /bin/sh provider is somewhat
 	# slow. Therefore, use the basename of the symlink target
@@ -1707,7 +1705,6 @@
 		append(%s %s % \
 			((cp + :).ljust(cp_max_len + 1), versions))
 
-	repos = portdb.settings.repositories
 	append(Repositories:\n)
 	for repo in repos:
 		append(repo.info_string())


signature.asc
Description: This is a digitally signed message part.