public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-07-08 16:36 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-07-08 16:36 UTC (permalink / raw
  To: gentoo-commits

commit:     d1b230a62f6a58b8e06cfbae2105a5a269d37b24
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  8 16:36:17 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jul  8 16:36:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d1b230a6

RepoConfig: ignore missing name if no location

This happens if there is an orphan entry in repos.conf.

---
 pym/portage/repository/config.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 38ed6a1..4461901 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -290,7 +290,9 @@ class RepoConfigLoader(object):
 		ignored_repos = tuple((repo_name, tuple(paths)) \
 			for repo_name, paths in ignored_map.items())
 
-		self.missing_repo_names = frozenset(repo.location for repo in prepos.values() if repo.missing_repo_name)
+		self.missing_repo_names = frozenset(repo.location
+			for repo in prepos.values()
+			if repo.location is not None and repo.missing_repo_name)
 
 		#Parse layout.conf and read masters key.
 		for repo in prepos.values():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-09-12 21:27 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-09-12 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     53860ffa675b0cf1930589ff9fa15b5ffaa2cf75
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Wed Aug 31 23:42:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 21:23:09 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=53860ffa

refactoring; unhide part of the parsing functionality

---
 pym/portage/repository/config.py |  200 +++++++++++++++++++-------------------
 1 files changed, 99 insertions(+), 101 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a12bd7b..020297c 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -179,107 +179,101 @@ class RepoConfig(object):
 
 class RepoConfigLoader(object):
 	"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
-	def __init__(self, paths, settings):
-		"""Load config from files in paths"""
-		def parse(paths, prepos, ignored_map, ignored_location_map):
-			"""Parse files in paths to load config"""
-			parser = SafeConfigParser()
-			try:
-				parser.read(paths)
-			except ParsingError as e:
-				writemsg(_("!!! Error while reading repo config file: %s\n") % e, noiselevel=-1)
-			prepos['DEFAULT'] = RepoConfig("DEFAULT", parser.defaults())
-			for sname in parser.sections():
-				optdict = {}
-				for oname in parser.options(sname):
-					optdict[oname] = parser.get(sname, oname)
-
-				repo = RepoConfig(sname, optdict)
-				if repo.location and not os.path.exists(repo.location):
-					writemsg(_("!!! Invalid repos.conf entry '%s'"
-						" (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)
-					continue
 
-				if repo.name in prepos:
-					old_location = prepos[repo.name].location
-					if old_location is not None and repo.location is not None and old_location != repo.location:
-						ignored_map.setdefault(repo.name, []).append(old_location)
-						ignored_location_map[old_location] = repo.name
-					prepos[repo.name].update(repo)
-				else:
-					prepos[repo.name] = repo
-
-		def add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
-			"""Add overlays in PORTDIR_OVERLAY as repositories"""
-			overlays = []
-			if portdir:
-				portdir = normalize_path(portdir)
-				overlays.append(portdir)
-			port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
-			overlays.extend(port_ov)
-			default_repo_opts = {}
-			if prepos['DEFAULT'].aliases is not None:
-				default_repo_opts['aliases'] = \
-					' '.join(prepos['DEFAULT'].aliases)
-			if prepos['DEFAULT'].eclass_overrides is not None:
-				default_repo_opts['eclass-overrides'] = \
-					' '.join(prepos['DEFAULT'].eclass_overrides)
-			if prepos['DEFAULT'].masters is not None:
-				default_repo_opts['masters'] = \
-					' '.join(prepos['DEFAULT'].masters)
-			if overlays:
-				#overlay priority is negative because we want them to be looked before any other repo
-				base_priority = 0
-				for ov in overlays:
-					if os.path.isdir(ov):
-						repo_opts = default_repo_opts.copy()
-						repo_opts['location'] = ov
-						repo = RepoConfig(None, repo_opts)
-						repo_conf_opts = prepos.get(repo.name)
-						if repo_conf_opts is not None:
-							if repo_conf_opts.aliases is not None:
-								repo_opts['aliases'] = \
-									' '.join(repo_conf_opts.aliases)
-							if repo_conf_opts.eclass_overrides is not None:
-								repo_opts['eclass-overrides'] = \
-									' '.join(repo_conf_opts.eclass_overrides)
-							if repo_conf_opts.masters is not None:
-								repo_opts['masters'] = \
-									' '.join(repo_conf_opts.masters)
-						repo = RepoConfig(repo.name, repo_opts)
-						if repo.name in prepos:
-							old_location = prepos[repo.name].location
-							if old_location is not None and old_location != repo.location:
-								ignored_map.setdefault(repo.name, []).append(old_location)
-								ignored_location_map[old_location] = repo.name
-								if old_location == portdir:
-									portdir = repo.user_location
-							prepos[repo.name].update(repo)
-							repo = prepos[repo.name]
-						else:
-							prepos[repo.name] = repo
-
-						if ov == portdir and portdir not in port_ov:
-							repo.priority = -1000
-						else:
-							repo.priority = base_priority
-							base_priority += 1
+	@staticmethod
+	def _add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
+		"""Add overlays in PORTDIR_OVERLAY as repositories"""
+		overlays = []
+		if portdir:
+			portdir = normalize_path(portdir)
+			overlays.append(portdir)
+		port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
+		overlays.extend(port_ov)
+		default_repo_opts = {}
+		if prepos['DEFAULT'].aliases is not None:
+			default_repo_opts['aliases'] = \
+				' '.join(prepos['DEFAULT'].aliases)
+		if prepos['DEFAULT'].eclass_overrides is not None:
+			default_repo_opts['eclass-overrides'] = \
+				' '.join(prepos['DEFAULT'].eclass_overrides)
+		if prepos['DEFAULT'].masters is not None:
+			default_repo_opts['masters'] = \
+				' '.join(prepos['DEFAULT'].masters)
+		if overlays:
+			#overlay priority is negative because we want them to be looked before any other repo
+			base_priority = 0
+			for ov in overlays:
+				if os.path.isdir(ov):
+					repo_opts = default_repo_opts.copy()
+					repo_opts['location'] = ov
+					repo = RepoConfig(None, repo_opts)
+					repo_conf_opts = prepos.get(repo.name)
+					if repo_conf_opts is not None:
+						if repo_conf_opts.aliases is not None:
+							repo_opts['aliases'] = \
+								' '.join(repo_conf_opts.aliases)
+						if repo_conf_opts.eclass_overrides is not None:
+							repo_opts['eclass-overrides'] = \
+								' '.join(repo_conf_opts.eclass_overrides)
+						if repo_conf_opts.masters is not None:
+							repo_opts['masters'] = \
+								' '.join(repo_conf_opts.masters)
+					repo = RepoConfig(repo.name, repo_opts)
+					if repo.name in prepos:
+						old_location = prepos[repo.name].location
+						if old_location is not None and old_location != repo.location:
+							ignored_map.setdefault(repo.name, []).append(old_location)
+							ignored_location_map[old_location] = repo.name
+							if old_location == portdir:
+								portdir = repo.user_location
+						prepos[repo.name].update(repo)
+						repo = prepos[repo.name]
+					else:
+						prepos[repo.name] = repo
 
+					if ov == portdir and portdir not in port_ov:
+						repo.priority = -1000
 					else:
-						writemsg(_("!!! Invalid PORTDIR_OVERLAY"
-							" (not a dir): '%s'\n") % ov, noiselevel=-1)
+						repo.priority = base_priority
+						base_priority += 1
+
+				else:
+					writemsg(_("!!! Invalid PORTDIR_OVERLAY"
+						" (not a dir): '%s'\n") % ov, noiselevel=-1)
 
-			return portdir
+		return portdir
 
-		def repo_priority(r):
-			"""
-			Key funtion for comparing repositories by priority.
-			None is equal priority zero.
-			"""
-			x = prepos[r].priority
-			if x is None:
-				return 0
-			return x
+	@staticmethod
+	def _parse(paths, prepos, ignored_map, ignored_location_map):
+		"""Parse files in paths to load config"""
+		parser = SafeConfigParser()
+		try:
+			parser.read(paths)
+		except ParsingError as e:
+			writemsg(_("!!! Error while reading repo config file: %s\n") % e, noiselevel=-1)
+		prepos['DEFAULT'] = RepoConfig("DEFAULT", parser.defaults())
+		for sname in parser.sections():
+			optdict = {}
+			for oname in parser.options(sname):
+				optdict[oname] = parser.get(sname, oname)
+
+			repo = RepoConfig(sname, optdict)
+			if repo.location and not os.path.exists(repo.location):
+				writemsg(_("!!! Invalid repos.conf entry '%s'"
+					" (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)
+				continue
+
+			if repo.name in prepos:
+				old_location = prepos[repo.name].location
+				if old_location is not None and repo.location is not None and old_location != repo.location:
+					ignored_map.setdefault(repo.name, []).append(old_location)
+					ignored_location_map[old_location] = repo.name
+				prepos[repo.name].update(repo)
+			else:
+				prepos[repo.name] = repo
+
+	def __init__(self, paths, settings):
+		"""Load config from files in paths"""
 
 		prepos = {}
 		location_map = {}
@@ -289,10 +283,12 @@ class RepoConfigLoader(object):
 
 		portdir = settings.get('PORTDIR', '')
 		portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
-		parse(paths, prepos, ignored_map, ignored_location_map)
+
+		self._parse(paths, prepos, ignored_map, ignored_location_map)
+
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.
-		portdir = add_overlays(portdir, portdir_overlay, prepos,
+		portdir = self._add_overlays(portdir, portdir_overlay, prepos,
 			ignored_map, ignored_location_map)
 		if portdir and portdir.strip():
 			portdir = os.path.realpath(portdir)
@@ -352,9 +348,11 @@ class RepoConfigLoader(object):
 
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key
-		prepos_order = [repo.name for key, repo in prepos.items() \
+
+		prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0)
+
+		prepos_order = [repo.name for (key, repo) in prepos_order
 			if repo.name == key and repo.location is not None]
-		prepos_order.sort(key=repo_priority)
 
 		if portdir in location_map:
 			portdir_repo = prepos[location_map[portdir]]



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-09-12 21:27 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-09-12 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     af7933ee4df1d62a6567510dc7e84a0cf13a09ef
Author:     Brian Harring <ferringb <AT> gmail <DOT> com>
AuthorDate: Thu Sep  1 21:50:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 12 21:23:10 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=af7933ee

add layout.conf awareness of thin-manifests

For any repo that wants thin (just src_uri digests), they just need to add

thin-manifests = true

to their layout.conf.  Again, this should only be used in repositories
were the backing vcs provides checksums for the ebuild data.

---
 pym/portage/repository/config.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9e308a8..17839d7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -42,7 +42,7 @@ class RepoConfig(object):
 	"""Stores config of one repository"""
 
 	__slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo',
-		'missing_repo_name', 'name', 'priority', 'sync', 'format', 'load_manifest']
+		'missing_repo_name', 'name', 'priority', 'sync', 'format', 'thin_manifest']
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts
@@ -111,7 +111,11 @@ class RepoConfig(object):
 			missing = False
 		self.name = name
 		self.missing_repo_name = missing
-		self.load_manifest = manifest.Manifest
+		self.thin_manifest = False
+
+	def load_manifest(self, *args, **kwds):
+		kwds['thin'] = self.thin_manifest
+		return manifest.Manifest(*args, **kwds)
 
 	def update(self, new_repo):
 		"""Update repository with options in another RepoConfig"""
@@ -327,6 +331,9 @@ class RepoConfigLoader(object):
 					aliases.extend(repo.aliases)
 				repo.aliases = tuple(sorted(set(aliases)))
 
+			if layout_data.get('thin-manifests', '').lower() == 'true':
+				repo.thin_manifest = True
+
 		#Take aliases into account.
 		new_prepos = {}
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-09-17 18:08 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-09-17 18:08 UTC (permalink / raw
  To: gentoo-commits

commit:     dc23070e710acecf9b0229f81a980719605d9409
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 17 18:06:48 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Sep 17 18:06:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dc23070e

RepoConfigLoader: handle ValueError from shlex

This will handle the issue reported in bug #383269, comment #5.

---
 pym/portage/repository/config.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5cfe82f..8b1e641 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -194,7 +194,14 @@ class RepoConfigLoader(object):
 		if portdir:
 			portdir = normalize_path(portdir)
 			overlays.append(portdir)
-		port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
+		try:
+			port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
+		except ValueError as e:
+			#File "/usr/lib/python3.2/shlex.py", line 168, in read_token
+			#	raise ValueError("No closing quotation")
+			writemsg(_("!!! Invalid PORTDIR_OVERLAY:"
+				" %s: %s\n") % (e, portdir_overlay), noiselevel=-1)
+			port_ov = []
 		overlays.extend(port_ov)
 		default_repo_opts = {}
 		if prepos['DEFAULT'].aliases is not None:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-09-30 22:05 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-09-30 22:05 UTC (permalink / raw
  To: gentoo-commits

commit:     b33e1b6d26f9c4df6a1b6773e5471e2caa1012b3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 30 22:05:00 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Sep 30 22:05:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b33e1b6d

repos.conf: implement trust-authoritative-cache

This controls whether or not the layout.conf
"authoritative-cache = true" setting will be trusted for a particular
repo. It can be enabled globally by setting
"trust-authoritative-cache = true" in the [DEFAULT] section of
repos.conf.

---
 pym/portage/repository/config.py |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 424b89d..846de39 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -43,7 +43,8 @@ class RepoConfig(object):
 
 	__slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo',
 		'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manifest', 'thin_manifest',
-		'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cache_is_authoritative']
+		'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cache_is_authoritative',
+		'trust_authoritative_cache']
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts
@@ -119,6 +120,11 @@ class RepoConfig(object):
 		self.disable_manifest = False
 		self.cache_is_authoritative = False
 
+		trust_authoritative_cache = repo_opts.get('trust-authoritative-cache')
+		if trust_authoritative_cache is not None:
+			trust_authoritative_cache = trust_authoritative_cache.lower() == 'true'
+		self.trust_authoritative_cache = trust_authoritative_cache
+
 	def load_manifest(self, *args, **kwds):
 		kwds['thin'] = self.thin_manifest
 		kwds['allow_missing'] = self.allow_missing_manifest
@@ -135,6 +141,8 @@ class RepoConfig(object):
 			self.eclass_overrides = new_repo.eclass_overrides
 		if new_repo.masters is not None:
 			self.masters = new_repo.masters
+		if new_repo.trust_authoritative_cache is not None:
+			self.trust_authoritative_cache = new_repo.trust_authoritative_cache
 		if new_repo.name is not None:
 			self.name = new_repo.name
 			self.missing_repo_name = new_repo.missing_repo_name
@@ -222,6 +230,12 @@ class RepoConfigLoader(object):
 		if prepos['DEFAULT'].masters is not None:
 			default_repo_opts['masters'] = \
 				' '.join(prepos['DEFAULT'].masters)
+		if prepos['DEFAULT'].trust_authoritative_cache is not None:
+			if prepos['DEFAULT'].trust_authoritative_cache:
+				default_repo_opts['trust-authoritative-cache'] = 'true'
+			else:
+				default_repo_opts['trust-authoritative-cache'] = 'false'
+
 		if overlays:
 			#overlay priority is negative because we want them to be looked before any other repo
 			base_priority = 0
@@ -241,6 +255,12 @@ class RepoConfigLoader(object):
 						if repo_conf_opts.masters is not None:
 							repo_opts['masters'] = \
 								' '.join(repo_conf_opts.masters)
+						if repo_conf_opts.trust_authoritative_cache is not None:
+							if repo_conf_opts.trust_authoritative_cache:
+								repo_opts['trust-authoritative-cache'] = 'true'
+							else:
+								repo_opts['trust-authoritative-cache'] = 'false'
+
 					repo = RepoConfig(repo.name, repo_opts)
 					if repo.name in prepos:
 						old_location = prepos[repo.name].location
@@ -359,6 +379,8 @@ class RepoConfigLoader(object):
 			repo.create_manifest = manifest_policy != 'false'
 			repo.disable_manifest = manifest_policy == 'false'
 			repo.cache_is_authoritative = layout_data.get('authoritative-cache', 'false').lower() == 'true'
+			if not repo.trust_authoritative_cache:
+				repo.cache_is_authoritative = False
 
 		#Take aliases into account.
 		new_prepos = {}



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-03 18:33 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-03 18:33 UTC (permalink / raw
  To: gentoo-commits

commit:     6a534da500cb95c692993d6348a31d62ec8a152b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  3 18:33:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct  3 18:33:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6a534da5

Warn for questionable layout.conf manifest-hashes

---
 pym/portage/repository/config.py |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 779d432..713494c 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -3,6 +3,7 @@
 
 import io
 import logging
+import warnings
 import sys
 import re
 
@@ -15,7 +16,8 @@ try:
 except ImportError:
 	from ConfigParser import SafeConfigParser, ParsingError
 from portage import os
-from portage.const import USER_CONFIG_PATH, REPO_NAME_LOC
+from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
+	REPO_NAME_LOC, USER_CONFIG_PATH)
 from portage.env.loaders import KeyValuePairFileLoader
 from portage.util import normalize_path, writemsg, writemsg_level, shlex_split
 from portage.localization import _
@@ -385,6 +387,26 @@ class RepoConfigLoader(object):
 			manifest_hashes = layout_data.get('manifest-hashes')
 			if manifest_hashes is not None:
 				manifest_hashes = frozenset(manifest_hashes.upper().split())
+				if MANIFEST2_REQUIRED_HASH not in manifest_hashes:
+					warnings.warn(("Repository named '%s' has a "
+						"'manifest-hashes' setting that does not contain "
+						"the '%s' hash which is required by this "
+						"portage version. You will have to upgrade portage "
+						"if you want to generate valid manifests for this "
+						"repository: %s" % (repo.name,
+						MANIFEST2_REQUIRED_HASH,
+						layout_filename)))
+				unsupported_hashes = manifest_hashes.difference(
+					MANIFEST2_HASH_FUNCTIONS)
+				if unsupported_hashes:
+					warnings.warn(("Repository named '%s' has a "
+						"'manifest-hashes' setting that contains one "
+						"or more hash types '%s' which are not supported by "
+						"this portage version. You will have to upgrade "
+						"portage if you want to generate valid manifests for "
+						"this repository: %s" % (repo.name,
+						" ".join(sorted(unsupported_hashes)),
+						layout_filename)))
 			repo.manifest_hashes = manifest_hashes
 
 			repo.cache_is_authoritative = layout_data.get('authoritative-cache', 'false').lower() == 'true'



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-03 20:14 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-03 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     b8ebdffd672d9ef5dcaa2470e86cf9184b83fc44
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  3 20:14:08 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct  3 20:14:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b8ebdffd

Suppress warnings with DeprecationWarning.

These manifest-hashes warnings are irrelevant to regular users, so suppress
them by default.

---
 pym/portage/repository/config.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 713494c..979b859 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -395,7 +395,7 @@ class RepoConfigLoader(object):
 						"if you want to generate valid manifests for this "
 						"repository: %s" % (repo.name,
 						MANIFEST2_REQUIRED_HASH,
-						layout_filename)))
+						layout_filename)), DeprecationWarning)
 				unsupported_hashes = manifest_hashes.difference(
 					MANIFEST2_HASH_FUNCTIONS)
 				if unsupported_hashes:
@@ -406,7 +406,7 @@ class RepoConfigLoader(object):
 						"portage if you want to generate valid manifests for "
 						"this repository: %s" % (repo.name,
 						" ".join(sorted(unsupported_hashes)),
-						layout_filename)))
+						layout_filename)), DeprecationWarning)
 			repo.manifest_hashes = manifest_hashes
 
 			repo.cache_is_authoritative = layout_data.get('authoritative-cache', 'false').lower() == 'true'



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-04 15:33 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-04 15:33 UTC (permalink / raw
  To: gentoo-commits

commit:     61cc6d8f20de04d4b4f46618411a0fb568d0b0ab
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  4 15:33:41 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 15:33:41 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=61cc6d8f

RepoConfig: sort __slots__

---
 pym/portage/repository/config.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 979b859..e3027a7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -43,10 +43,12 @@ def _gen_valid_repo(name):
 class RepoConfig(object):
 	"""Stores config of one repository"""
 
-	__slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo',
-		'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manifest', 'thin_manifest',
-		'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cache_is_authoritative',
-		'trust_authoritative_cache', 'manifest_hashes']
+	__slots__ = ('aliases', 'allow_missing_manifest',
+		'cache_is_authoritative', 'create_manifest', 'disable_manifest',
+		'eclass_overrides', 'eclass_locations', 'format', 'location',
+		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
+		'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
+		'trust_authoritative_cache', 'user_location')
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-05  1:11 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-10-05  1:11 UTC (permalink / raw
  To: gentoo-commits

commit:     165d248d44308f9b7620d7eb2e3d3a265ef2b812
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Wed Oct  5 01:09:53 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Wed Oct  5 01:09:53 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=165d248d

Mark some messages for translation.

---
 pym/portage/repository/config.py |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index e3027a7..9f4ac2b 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -390,25 +390,29 @@ class RepoConfigLoader(object):
 			if manifest_hashes is not None:
 				manifest_hashes = frozenset(manifest_hashes.upper().split())
 				if MANIFEST2_REQUIRED_HASH not in manifest_hashes:
-					warnings.warn(("Repository named '%s' has a "
+					warnings.warn((_("Repository named '%(repo_name)s' has a "
 						"'manifest-hashes' setting that does not contain "
-						"the '%s' hash which is required by this "
+						"the '%(hash)s' hash which is required by this "
 						"portage version. You will have to upgrade portage "
 						"if you want to generate valid manifests for this "
-						"repository: %s" % (repo.name,
-						MANIFEST2_REQUIRED_HASH,
-						layout_filename)), DeprecationWarning)
+						"repository: %(layout_filename)s") %
+						{"repo_name":repo.name,
+						"hash":MANIFEST2_REQUIRED_HASH,
+						"layout_filename":layout_filename}),
+						DeprecationWarning)
 				unsupported_hashes = manifest_hashes.difference(
 					MANIFEST2_HASH_FUNCTIONS)
 				if unsupported_hashes:
-					warnings.warn(("Repository named '%s' has a "
+					warnings.warn((_("Repository named '%(repo_name)s' has a "
 						"'manifest-hashes' setting that contains one "
-						"or more hash types '%s' which are not supported by "
+						"or more hash types '%(hashes)s' which are not supported by "
 						"this portage version. You will have to upgrade "
 						"portage if you want to generate valid manifests for "
-						"this repository: %s" % (repo.name,
-						" ".join(sorted(unsupported_hashes)),
-						layout_filename)), DeprecationWarning)
+						"this repository: %(layout_filename)s") %
+						{"repo_name":repo.name,
+						"hashes":" ".join(sorted(unsupported_hashes)),
+						"layout_filename":layout_filename}),
+						DeprecationWarning)
 			repo.manifest_hashes = manifest_hashes
 
 			repo.cache_is_authoritative = layout_data.get('authoritative-cache', 'false').lower() == 'true'



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-08 21:41 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-10-08 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     ab2a6cc357ba3c8272a4a1556e2c0bcd4bee102e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sat Oct  8 21:37:35 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 21:37:35 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab2a6cc3

RepoConfigLoader: Recursively expand masters.

---
 pym/portage/repository/config.py |   48 +++++++++++++++++++++----------------
 1 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9f4ac2b..8f7e809 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -474,32 +474,38 @@ class RepoConfigLoader(object):
 		self._prepos_changed = True
 		self._repo_location_list = []
 
-		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
-		for repo_name, repo in prepos.items():
-			if repo_name == "DEFAULT":
-				continue
+		def get_masters(repo_name, repo, recurse=True):
+			master_repos = []
 			if repo.masters is None:
 				if self.mainRepo() and repo_name != self.mainRepo().name:
-					repo.masters = self.mainRepo(),
+					master_repos = [self.mainRepo()]
 				else:
-					repo.masters = ()
+					master_repos = []
 			else:
-				if repo.masters and isinstance(repo.masters[0], RepoConfig):
-					# This one has already been processed
-					# because it has an alias.
-					continue
-				master_repos = []
-				for master_name in repo.masters:
-					if master_name not in prepos:
-						layout_filename = os.path.join(repo.user_location,
-							"metadata", "layout.conf")
-						writemsg_level(_("Unavailable repository '%s' " \
-							"referenced by masters entry in '%s'\n") % \
-							(master_name, layout_filename),
-							level=logging.ERROR, noiselevel=-1)
+				for master in repo.masters:
+					if isinstance(master, RepoConfig):
+						master_repos.append(master)
 					else:
-						master_repos.append(prepos[master_name])
-				repo.masters = tuple(master_repos)
+						if master not in prepos:
+							layout_filename = os.path.join(repo.user_location,
+								"metadata", "layout.conf")
+							writemsg_level(_("Unavailable repository '%s' " \
+								"referenced by masters entry in '%s'\n") % \
+								(master_name, layout_filename),
+								level=logging.ERROR, noiselevel=-1)
+						else:
+							master = prepos[master]
+							if recurse:
+								master_repos.extend(get_masters(master.name, master) + [master])
+							else:
+								master_repos.append(master)
+			return master_repos
+
+		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
+		for repo_name, repo in prepos.items():
+			if repo_name == "DEFAULT":
+				continue
+			repo.masters = tuple(get_masters(repo_name, repo))
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-08 23:23 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-08 23:23 UTC (permalink / raw
  To: gentoo-commits

commit:     5628dac1538985af640102654bce60a8e526daeb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  8 23:23:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 23:23:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5628dac1

get_masters: protect against infinite recursion

We can't have portage crash because of circular deps in layout.conf.

---
 pym/portage/repository/config.py |   53 +++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1d042ac..c5da4f6 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -484,38 +484,45 @@ class RepoConfigLoader(object):
 		self._prepos_changed = True
 		self._repo_location_list = []
 
-		def get_masters(repo_name, repo, recurse=True):
+		def get_masters(start_repo):
 			master_repos = []
-			if repo.masters is None:
-				if self.mainRepo() and repo_name != self.mainRepo().name:
-					master_repos = [self.mainRepo()]
+			stack = [start_repo]
+			traversed = set()
+			while stack:
+				repo = stack.pop()
+				if repo.name in traversed:
+					continue
+				traversed.add(repo.name)
+				if repo is not start_repo:
+					master_repos.append(repo)
+				if repo.masters is None:
+					main_repo = self.mainRepo()
+					if main_repo is not None and \
+						main_repo is not start_repo:
+						stack.append(main_repo)
 				else:
-					master_repos = []
-			else:
-				for master in repo.masters:
-					if isinstance(master, RepoConfig):
-						master_repos.append(master)
-					else:
-						if master not in prepos:
-							layout_filename = os.path.join(repo.user_location,
-								"metadata", "layout.conf")
-							writemsg_level(_("Unavailable repository '%s' " \
-								"referenced by masters entry in '%s'\n") % \
-								(master_name, layout_filename),
-								level=logging.ERROR, noiselevel=-1)
+					for master in repo.masters:
+						if isinstance(master, RepoConfig):
+							stack.append(master)
 						else:
-							master = prepos[master]
-							if recurse:
-								master_repos.extend(get_masters(master.name, master) + [master])
+							if master not in prepos:
+								layout_filename = os.path.join(repo.user_location,
+									"metadata", "layout.conf")
+								writemsg_level(_("Unavailable repository '%s' " \
+									"referenced by masters entry in '%s'\n") % \
+									(master, layout_filename),
+									level=logging.ERROR, noiselevel=-1)
 							else:
-								master_repos.append(master)
-			return master_repos
+								stack.append(prepos[master])
+
+			master_repos.reverse()
+			return tuple(master_repos)
 
 		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
-			repo.masters = tuple(get_masters(repo_name, repo))
+			repo.masters = get_masters(repo)
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-09 19:10 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-09 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     fd5807d6467be549717b35e67fc01be7a57bf432
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  9 18:57:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  9 18:57:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fd5807d6

Revert "get_masters: protect against infinite recursion"

This reverts commit 5628dac1538985af640102654bce60a8e526daeb.
Reverting all masters recursion code for now (see bug #386569).

---
 pym/portage/repository/config.py |   53 ++++++++++++++++---------------------
 1 files changed, 23 insertions(+), 30 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index c5da4f6..1d042ac 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -484,45 +484,38 @@ class RepoConfigLoader(object):
 		self._prepos_changed = True
 		self._repo_location_list = []
 
-		def get_masters(start_repo):
+		def get_masters(repo_name, repo, recurse=True):
 			master_repos = []
-			stack = [start_repo]
-			traversed = set()
-			while stack:
-				repo = stack.pop()
-				if repo.name in traversed:
-					continue
-				traversed.add(repo.name)
-				if repo is not start_repo:
-					master_repos.append(repo)
-				if repo.masters is None:
-					main_repo = self.mainRepo()
-					if main_repo is not None and \
-						main_repo is not start_repo:
-						stack.append(main_repo)
+			if repo.masters is None:
+				if self.mainRepo() and repo_name != self.mainRepo().name:
+					master_repos = [self.mainRepo()]
 				else:
-					for master in repo.masters:
-						if isinstance(master, RepoConfig):
-							stack.append(master)
+					master_repos = []
+			else:
+				for master in repo.masters:
+					if isinstance(master, RepoConfig):
+						master_repos.append(master)
+					else:
+						if master not in prepos:
+							layout_filename = os.path.join(repo.user_location,
+								"metadata", "layout.conf")
+							writemsg_level(_("Unavailable repository '%s' " \
+								"referenced by masters entry in '%s'\n") % \
+								(master_name, layout_filename),
+								level=logging.ERROR, noiselevel=-1)
 						else:
-							if master not in prepos:
-								layout_filename = os.path.join(repo.user_location,
-									"metadata", "layout.conf")
-								writemsg_level(_("Unavailable repository '%s' " \
-									"referenced by masters entry in '%s'\n") % \
-									(master, layout_filename),
-									level=logging.ERROR, noiselevel=-1)
+							master = prepos[master]
+							if recurse:
+								master_repos.extend(get_masters(master.name, master) + [master])
 							else:
-								stack.append(prepos[master])
-
-			master_repos.reverse()
-			return tuple(master_repos)
+								master_repos.append(master)
+			return master_repos
 
 		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
 		for repo_name, repo in prepos.items():
 			if repo_name == "DEFAULT":
 				continue
-			repo.masters = get_masters(repo)
+			repo.masters = tuple(get_masters(repo_name, repo))
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-09 19:10 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-09 19:10 UTC (permalink / raw
  To: gentoo-commits

commit:     80a9cd59ed8df549ff0991705040d5270c8d0d03
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  9 19:09:22 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct  9 19:09:22 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=80a9cd59

Revert "RepoConfigLoader: Recursively expand masters."

This reverts commit ab2a6cc357ba3c8272a4a1556e2c0bcd4bee102e.
Reverting all masters recursion code for now (see bug #386569).

---
 pym/portage/repository/config.py |   48 ++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1d042ac..8f55177 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -484,38 +484,32 @@ class RepoConfigLoader(object):
 		self._prepos_changed = True
 		self._repo_location_list = []
 
-		def get_masters(repo_name, repo, recurse=True):
-			master_repos = []
+		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
+		for repo_name, repo in prepos.items():
+			if repo_name == "DEFAULT":
+				continue
 			if repo.masters is None:
 				if self.mainRepo() and repo_name != self.mainRepo().name:
-					master_repos = [self.mainRepo()]
+					repo.masters = self.mainRepo(),
 				else:
-					master_repos = []
+					repo.masters = ()
 			else:
-				for master in repo.masters:
-					if isinstance(master, RepoConfig):
-						master_repos.append(master)
+				if repo.masters and isinstance(repo.masters[0], RepoConfig):
+					# This one has already been processed
+					# because it has an alias.
+					continue
+				master_repos = []
+				for master_name in repo.masters:
+					if master_name not in prepos:
+						layout_filename = os.path.join(repo.user_location,
+							"metadata", "layout.conf")
+						writemsg_level(_("Unavailable repository '%s' " \
+							"referenced by masters entry in '%s'\n") % \
+							(master_name, layout_filename),
+							level=logging.ERROR, noiselevel=-1)
 					else:
-						if master not in prepos:
-							layout_filename = os.path.join(repo.user_location,
-								"metadata", "layout.conf")
-							writemsg_level(_("Unavailable repository '%s' " \
-								"referenced by masters entry in '%s'\n") % \
-								(master_name, layout_filename),
-								level=logging.ERROR, noiselevel=-1)
-						else:
-							master = prepos[master]
-							if recurse:
-								master_repos.extend(get_masters(master.name, master) + [master])
-							else:
-								master_repos.append(master)
-			return master_repos
-
-		#The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
-		for repo_name, repo in prepos.items():
-			if repo_name == "DEFAULT":
-				continue
-			repo.masters = tuple(get_masters(repo_name, repo))
+						master_repos.append(prepos[master_name])
+				repo.masters = tuple(master_repos)
 
 		#The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-16  6:18 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-16  6:18 UTC (permalink / raw
  To: gentoo-commits

commit:     6e2da854b5bebba5b0a8e913e3b6495770de995c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 16 06:18:39 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Oct 16 06:18:39 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6e2da854

RepoConfig: sort __slots__

---
 pym/portage/repository/config.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index cf268f8..12829c3 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -44,11 +44,11 @@ class RepoConfig(object):
 	"""Stores config of one repository"""
 
 	__slots__ = ('aliases', 'allow_missing_manifest',
-		'create_manifest', 'disable_manifest',
+		'cache_format', 'create_manifest', 'disable_manifest',
 		'eclass_overrides', 'eclass_locations', 'format', 'location',
 		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
 		'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
-		'user_location', 'cache_format')
+		'user_location')
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-25 21:44 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-25 21:44 UTC (permalink / raw
  To: gentoo-commits

commit:     a34ac493d13ba5ad20b07f25f4e4f054e303eecb
Author:     Brian Harring <ferringb <AT> chromium <DOT> org>
AuthorDate: Tue Oct 25 05:40:16 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 21:36:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a34ac493

layout.conf: add profile-format awareness

Note the portage-1-compat mode; this isn't settable externally, is
purely an internal mode for tracking if a repository is in portage-1
compat mode, rather than explicit portage-1 mode.

This compat mode will be removed once portage becomes strict.

---
 pym/portage/repository/config.py |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index fe2bd33..377ba47 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -48,7 +48,8 @@ class RepoConfig(object):
 		'eclass_overrides', 'eclass_locations', 'format', 'location',
 		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
 		'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
-		'update_changelog', 'user_location')
+		'update_changelog', 'user_location', 'portage1_profiles',
+		'portage1_profiles_compat')
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts
@@ -128,6 +129,8 @@ class RepoConfig(object):
 		self.manifest_hashes = None
 		self.update_changelog = False
 		self.cache_format = None
+		self.portage1_profiles = True
+		self.portage1_profiles_compat = False
 
 	def get_pregenerated_cache(self, auxdbkeys, readonly=True, force=False):
 		format = self.cache_format
@@ -380,6 +383,10 @@ class RepoConfigLoader(object):
 				'update-changelog'):
 				setattr(repo, value.lower().replace("-", "_"), layout_data[value])
 
+			repo.portage1_profiles = any(x.startswith("portage-1") \
+				for x in layout_data['profile-formats'])
+			repo.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)
+
 		#Take aliases into account.
 		new_prepos = {}
 		for repo_name, repo in prepos.items():
@@ -639,4 +646,18 @@ def parse_layout_conf(repo_location, repo_name=None):
 	data['update-changelog'] = layout_data.get('update-changelog', 'false').lower() \
 		== 'false'
 
+	raw_formats = layout_data.get('profile-formats')
+	if raw_formats is None:
+		raw_formats = ('portage-1-compat',)
+	else:
+		raw_formats = set(raw_formats.split())
+		unknown = raw_formats.difference(['pms', 'portage-1'])
+		warnings.warn((_("Repository named '%(repo_name)s' has unsupported "
+			"profiles in use ('profile-format' setting in '%(layout_filename)s;"
+			" please upgrade portage.") %
+			dict(repo_name=repo_name, layout_filename=layout_filename)),
+			DeprecationWarning)
+		raw_formats = tuple(raw_formats.intersection(['pms', 'portage-1']))
+	data['profile-formats'] = raw_formats
+
 	return data, layout_errors



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-25 21:44 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-25 21:44 UTC (permalink / raw
  To: gentoo-commits

commit:     0be173a54a5248cfd70a3543d7099d2dd3ee254b
Author:     Brian Harring <ferringb <AT> chromium <DOT> org>
AuthorDate: Tue Oct 25 00:38:33 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 21:36:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0be173a5

split out layout.conf parsing so it's usable elsewhere

---
 pym/portage/repository/config.py |  155 +++++++++++++++++++++-----------------
 1 files changed, 86 insertions(+), 69 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index fddba6c..fe2bd33 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -358,82 +358,27 @@ class RepoConfigLoader(object):
 			if not repo.location:
 				continue
 			layout_filename = os.path.join(repo.location, "metadata", "layout.conf")
-			layout_file = KeyValuePairFileLoader(layout_filename, None, None)
-			layout_data, layout_errors = layout_file.load()
-
-			# Only set masters here if is None, so that repos.conf settings
-			# will override those from layout.conf. This gives the
-			# user control over inherited repositories and their settings
-			# (the user must ensure that any required dependencies such as
-			# eclasses are satisfied).
+			layout_data, layout_errors = parse_layout_conf(repo.location, repo.name)
+
 			if repo.masters is None:
-				masters = layout_data.get('masters')
-				if masters is not None:
-					# We support empty masters settings here, in case a
-					# repo wants to avoid implicit inheritance of PORTDIR
-					# settings like package.mask.
-					masters = tuple(masters.split())
-				repo.masters = masters
+				repo.masters = layout_data['masters']
 
 			aliases = layout_data.get('aliases')
 			if aliases and aliases.strip():
 				aliases = aliases.split()
 			else:
 				aliases = None
-			if aliases:
-				if repo.aliases:
-					aliases.extend(repo.aliases)
-				repo.aliases = tuple(sorted(set(aliases)))
-
-			if layout_data.get('sign-manifests', '').lower() == 'false':
-				repo.sign_manifest = False
-
-			if layout_data.get('thin-manifests', '').lower() == 'true':
-				repo.thin_manifest = True
-
-			manifest_policy = layout_data.get('use-manifests', 'strict').lower()
-			repo.allow_missing_manifest = manifest_policy != 'strict'
-			repo.create_manifest = manifest_policy != 'false'
-			repo.disable_manifest = manifest_policy == 'false'
-
-			# for compatibility w/ PMS, fallback to pms; but also check if the
-			# cache exists or not.
-			repo.cache_format = layout_data.get('cache-format', 'pms').lower()
-			if repo.cache_format == 'pms' and not os.path.isdir(
-				os.path.join(repo.location, 'metadata', 'cache')):
-				repo.cache_format = None
-
-			manifest_hashes = layout_data.get('manifest-hashes')
-			if manifest_hashes is not None:
-				manifest_hashes = frozenset(manifest_hashes.upper().split())
-				if MANIFEST2_REQUIRED_HASH not in manifest_hashes:
-					warnings.warn((_("Repository named '%(repo_name)s' has a "
-						"'manifest-hashes' setting that does not contain "
-						"the '%(hash)s' hash which is required by this "
-						"portage version. You will have to upgrade portage "
-						"if you want to generate valid manifests for this "
-						"repository: %(layout_filename)s") %
-						{"repo_name":repo.name,
-						"hash":MANIFEST2_REQUIRED_HASH,
-						"layout_filename":layout_filename}),
-						DeprecationWarning)
-				unsupported_hashes = manifest_hashes.difference(
-					MANIFEST2_HASH_FUNCTIONS)
-				if unsupported_hashes:
-					warnings.warn((_("Repository named '%(repo_name)s' has a "
-						"'manifest-hashes' setting that contains one "
-						"or more hash types '%(hashes)s' which are not supported by "
-						"this portage version. You will have to upgrade "
-						"portage if you want to generate valid manifests for "
-						"this repository: %(layout_filename)s") %
-						{"repo_name":repo.name,
-						"hashes":" ".join(sorted(unsupported_hashes)),
-						"layout_filename":layout_filename}),
-						DeprecationWarning)
-			repo.manifest_hashes = manifest_hashes
-
-			if layout_data.get('update-changelog', '').lower() == 'true':
-				repo.update_changelog = True
+
+			if layout_data['aliases']:
+				aliases = repo.aliases
+				if aliases is None:
+					aliases = ()
+				repo.aliases = tuple(aliases) + layout_data['aliases']
+
+			for value in ('sign-manifest', 'thin-manifest', 'allow-missing-manifest',
+				'create-manifest', 'disable-manifest', 'cache-format', 'manifest-hashes',
+				'update-changelog'):
+				setattr(repo, value.lower().replace("-", "_"), layout_data[value])
 
 		#Take aliases into account.
 		new_prepos = {}
@@ -623,3 +568,75 @@ def load_repository_config(settings):
 		repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
 			USER_CONFIG_PATH, "repos.conf"))
 	return RepoConfigLoader(repoconfigpaths, settings)
+
+
+def parse_layout_conf(repo_location, repo_name=None):
+	if repo_name is None:
+		repo_name = "unspecified"
+
+	layout_filename = os.path.join(repo_location, "metadata", "layout.conf")
+	layout_file = KeyValuePairFileLoader(layout_filename, None, None)
+	layout_data, layout_errors = layout_file.load()
+
+	data = {}
+
+	# allow None to slip through; later code spots that as an indication
+	# that an explicit nulling of the overlaying is desired.
+	masters = layout_data.get('masters')
+	if masters is not None:
+		masters = tuple(masters.split())
+	data['masters'] = masters
+	data['aliases'] = tuple(layout_data.get('aliases', '').split())
+
+	data['sign-manifest'] = layout_data.get('sign-manifests', 'true').lower() \
+		== 'true'
+
+	data['thin-manifest'] = layout_data.get('thin-manifests', 'false').lower() \
+		== 'true'
+
+	manifest_policy = layout_data.get('use-manifests', 'strict').lower()
+	data['allow-missing-manifest'] = manifest_policy != 'strict'
+	data['create-manifest'] = manifest_policy != 'false'
+	data['disable-manifest'] = manifest_policy == 'false'
+
+	# for compatibility w/ PMS, fallback to pms; but also check if the
+	# cache exists or not.
+	cache_format = layout_data.get('cache-format', 'pms').lower()
+	if cache_format == 'pms' and not os.path.isdir(
+		os.path.join(repo_location, 'metadata', 'cache')):
+		cache_format = None
+	data['cache-format'] = cache_format
+
+	manifest_hashes = layout_data.get('manifest-hashes')
+	if manifest_hashes is not None:
+		manifest_hashes = frozenset(manifest_hashes.upper().split())
+		if MANIFEST2_REQUIRED_HASH not in manifest_hashes:
+			warnings.warn((_("Repository named '%(repo_name)s' has a "
+				"'manifest-hashes' setting that does not contain "
+				"the '%(hash)s' hash which is required by this "
+				"portage version. You will have to upgrade portage "
+				"if you want to generate valid manifests for this "
+				"repository: %(layout_filename)s") %
+				{"repo_name":repo.name,
+				"hash":MANIFEST2_REQUIRED_HASH,
+				"layout_filename":layout_filename}),
+				DeprecationWarning)
+		unsupported_hashes = manifest_hashes.difference(
+			MANIFEST2_HASH_FUNCTIONS)
+		if unsupported_hashes:
+			warnings.warn((_("Repository named '%(repo_name)s' has a "
+				"'manifest-hashes' setting that contains one "
+				"or more hash types '%(hashes)s' which are not supported by "
+				"this portage version. You will have to upgrade "
+				"portage if you want to generate valid manifests for "
+				"this repository: %(layout_filename)s") %
+				{"repo_name":repo_name,
+				"hashes":" ".join(sorted(unsupported_hashes)),
+				"layout_filename":layout_filename}),
+				DeprecationWarning)
+	data['manifest-hashes'] = manifest_hashes
+
+	data['update-changelog'] = layout_data.get('update-changelog', 'false').lower() \
+		== 'false'
+
+	return data, layout_errors



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-27  5:09 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-27  5:09 UTC (permalink / raw
  To: gentoo-commits

commit:     3fb6955485474531cc611b596cde0f5873c082cf
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 05:09:19 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 05:09:19 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3fb69554

RepoConfigLoader: redundant cache_formats setting

There's a loop that already handles this via setattr.

---
 pym/portage/repository/config.py |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9b4a76f..a6d13e0 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -397,8 +397,6 @@ class RepoConfigLoader(object):
 				for x in layout_data['profile-formats'])
 			repo.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)
 
-			repo.cache_formats = layout_data['cache-formats']
-
 		#Take aliases into account.
 		new_prepos = {}
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-27  5:32 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-27  5:32 UTC (permalink / raw
  To: gentoo-commits

commit:     15bf7c846d9437be76584e106d527f51a5af9d1e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 05:32:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 05:32:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=15bf7c84

parse_layout_conf: fix inverted update-changelog

The logic got inverted when parse_layout_conf was split out in commit
0be173a54a5248cfd70a3543d7099d2dd3ee254b.

---
 pym/portage/repository/config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a6d13e0..5659b14 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -654,7 +654,7 @@ def parse_layout_conf(repo_location, repo_name=None):
 	data['manifest-hashes'] = manifest_hashes
 
 	data['update-changelog'] = layout_data.get('update-changelog', 'false').lower() \
-		== 'false'
+		== 'true'
 
 	raw_formats = layout_data.get('profile-formats')
 	if raw_formats is None:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-27  5:55 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-27  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     6d71e61c7d2ddf32f55c2b5efcd3e038c9492f19
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 05:55:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 05:55:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d71e61c

repoman: add opts and repo config debug output

---
 pym/portage/repository/config.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index ab679f6..07969cc 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -239,7 +239,7 @@ class RepoConfig(object):
 		d = {}
 		for k in self.__slots__:
 			d[k] = getattr(self, k, None)
-		return _unicode_decode(str(d))
+		return _unicode_decode("%s") % (d,)
 
 	if sys.hexversion < 0x3000000:
 



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-27 19:41 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-27 19:41 UTC (permalink / raw
  To: gentoo-commits

commit:     a68a292f89aeea222421b8db5901bf0c5e7774a1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 27 19:41:42 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 27 19:41:42 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a68a292f

parse_layout_conf: grab repo_name for error msgs

This allows us to avoid duplicate warnings for 'unspecified' repo since
parse_layout_conf is initially called without specifying the repo in
LocationsManager.load_profiles().

---
 pym/portage/repository/config.py |   49 ++++++++++++++++++++++++-------------
 1 files changed, 32 insertions(+), 17 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index f773ae0..d64ad4f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -106,17 +106,7 @@ class RepoConfig(object):
 
 		missing = True
 		if self.location is not None:
-			name, missing = self._read_repo_name(self.location)
-			# We must ensure that the name conforms to PMS 3.1.5
-			# in order to avoid InvalidAtom exceptions when we
-			# use it to generate atoms.
-			name = _gen_valid_repo(name)
-			if not name:
-				# name only contains invalid characters
-				name = "x-" + os.path.basename(self.location)
-				name = _gen_valid_repo(name)
-				# If basename only contains whitespace then the
-				# end result is name = 'x-'.
+			name, missing = self._read_valid_repo_name(self.location)
 
 		elif name == "DEFAULT": 
 			missing = False
@@ -189,7 +179,23 @@ class RepoConfig(object):
 		if new_repo.sync is not None:
 			self.sync = new_repo.sync
 
-	def _read_repo_name(self, repo_path):
+	@staticmethod
+	def _read_valid_repo_name(repo_path):
+		name, missing = RepoConfig._read_repo_name(repo_path)
+		# We must ensure that the name conforms to PMS 3.1.5
+		# in order to avoid InvalidAtom exceptions when we
+		# use it to generate atoms.
+		name = _gen_valid_repo(name)
+		if not name:
+			# name only contains invalid characters
+			name = "x-" + os.path.basename(repo_path)
+			name = _gen_valid_repo(name)
+			# If basename only contains whitespace then the
+			# end result is name = 'x-'.
+		return name, missing
+
+	@staticmethod
+	def _read_repo_name(repo_path):
 		"""
 		Read repo_name from repo_path.
 		Returns repo_name, missing.
@@ -600,10 +606,15 @@ def load_repository_config(settings):
 			USER_CONFIG_PATH, "repos.conf"))
 	return RepoConfigLoader(repoconfigpaths, settings)
 
+def _get_repo_name(repo_location, cached=None):
+	if cached is not None:
+		return cached
+	name, missing = RepoConfig._read_repo_name(repo_location)
+	if missing:
+		return None
+	return name
 
 def parse_layout_conf(repo_location, repo_name=None):
-	if repo_name is None:
-		repo_name = "unspecified"
 
 	layout_filename = os.path.join(repo_location, "metadata", "layout.conf")
 	layout_file = KeyValuePairFileLoader(layout_filename, None, None)
@@ -642,26 +653,28 @@ def parse_layout_conf(repo_location, repo_name=None):
 	if manifest_hashes is not None:
 		manifest_hashes = frozenset(manifest_hashes.upper().split())
 		if MANIFEST2_REQUIRED_HASH not in manifest_hashes:
+			repo_name = _get_repo_name(repo_location, cached=repo_name)
 			warnings.warn((_("Repository named '%(repo_name)s' has a "
 				"'manifest-hashes' setting that does not contain "
 				"the '%(hash)s' hash which is required by this "
 				"portage version. You will have to upgrade portage "
 				"if you want to generate valid manifests for this "
 				"repository: %(layout_filename)s") %
-				{"repo_name":repo.name,
+				{"repo_name": repo_name or 'unspecified',
 				"hash":MANIFEST2_REQUIRED_HASH,
 				"layout_filename":layout_filename}),
 				DeprecationWarning)
 		unsupported_hashes = manifest_hashes.difference(
 			MANIFEST2_HASH_FUNCTIONS)
 		if unsupported_hashes:
+			repo_name = _get_repo_name(repo_location, cached=repo_name)
 			warnings.warn((_("Repository named '%(repo_name)s' has a "
 				"'manifest-hashes' setting that contains one "
 				"or more hash types '%(hashes)s' which are not supported by "
 				"this portage version. You will have to upgrade "
 				"portage if you want to generate valid manifests for "
 				"this repository: %(layout_filename)s") %
-				{"repo_name":repo_name,
+				{"repo_name": repo_name or 'unspecified',
 				"hashes":" ".join(sorted(unsupported_hashes)),
 				"layout_filename":layout_filename}),
 				DeprecationWarning)
@@ -677,10 +690,12 @@ def parse_layout_conf(repo_location, repo_name=None):
 		raw_formats = set(raw_formats.split())
 		unknown = raw_formats.difference(['pms', 'portage-1'])
 		if unknown:
+			repo_name = _get_repo_name(repo_location, cached=repo_name)
 			warnings.warn((_("Repository named '%(repo_name)s' has unsupported "
 				"profiles in use ('profile-formats = %(unknown_fmts)s' setting in "
 				"'%(layout_filename)s; please upgrade portage.") %
-				dict(repo_name=repo_name, layout_filename=layout_filename,
+				dict(repo_name=repo_name or 'unspecified',
+				layout_filename=layout_filename,
 				unknown_fmts=" ".join(unknown))),
 				DeprecationWarning)
 		raw_formats = tuple(raw_formats.intersection(['pms', 'portage-1']))



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  5:15 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  5:15 UTC (permalink / raw
  To: gentoo-commits

commit:     1decf44170bcec923389a5eaf5caf045e2b4bac0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 05:14:51 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 05:14:51 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1decf441

parse_layout_conf: comment on masters fallback

---
 pym/portage/repository/config.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index d64ad4f..19c1aeb 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -622,8 +622,11 @@ def parse_layout_conf(repo_location, repo_name=None):
 
 	data = {}
 
-	# allow None to slip through; later code spots that as an indication
-	# that an explicit nulling of the overlaying is desired.
+	# None indicates abscence of a masters setting, which later code uses
+	# to trigger a backward compatibility fallback that sets an implicit
+	# master. In order to avoid this fallback behavior, layout.conf can
+	# explicitly set masters to an empty value, which will result in an
+	# empty tuple here instead of None.
 	masters = layout_data.get('masters')
 	if masters is not None:
 		masters = tuple(masters.split())



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  5:30 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  5:30 UTC (permalink / raw
  To: gentoo-commits

commit:     b6c981f1165e45e3b2ccb0e97c2e0489872b750e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 05:30:34 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 05:30:34 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b6c981f1

RepoConfig.update(): getattr/setattr loop

---
 pym/portage/repository/config.py |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 19c1aeb..2cc8a0b 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -161,23 +161,15 @@ class RepoConfig(object):
 
 	def update(self, new_repo):
 		"""Update repository with options in another RepoConfig"""
-		if new_repo.aliases is not None:
-			self.aliases = new_repo.aliases
-		if new_repo.eclass_overrides is not None:
-			self.eclass_overrides = new_repo.eclass_overrides
-		if new_repo.masters is not None:
-			self.masters = new_repo.masters
+
+		for k in ('aliases', 'eclass_overrides', 'location', 'masters',
+			'name', 'priority', 'sync', 'user_location'):
+			v = getattr(new_repo, k, None)
+			if v is not None:
+				setattr(self, k, v)
+
 		if new_repo.name is not None:
-			self.name = new_repo.name
 			self.missing_repo_name = new_repo.missing_repo_name
-		if new_repo.user_location is not None:
-			self.user_location = new_repo.user_location
-		if new_repo.location is not None:
-			self.location = new_repo.location
-		if new_repo.priority is not None:
-			self.priority = new_repo.priority
-		if new_repo.sync is not None:
-			self.sync = new_repo.sync
 
 	@staticmethod
 	def _read_valid_repo_name(repo_path):



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  5:38 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  5:38 UTC (permalink / raw
  To: gentoo-commits

commit:     bcb6106c7547738bd00e31b53b0cec582e1ac84c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 05:38:31 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 05:38:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bcb6106c

RepoConfigLoader: comment on masters override

---
 pym/portage/repository/config.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 2cc8a0b..5b5ddd6 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -385,6 +385,8 @@ class RepoConfigLoader(object):
 			layout_filename = os.path.join(repo.location, "metadata", "layout.conf")
 			layout_data, layout_errors = parse_layout_conf(repo.location, repo.name)
 
+			# layout.conf masters may be overridden here if we have a masters
+			# setting from the user's repos.conf
 			if repo.masters is None:
 				repo.masters = layout_data['masters']
 



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  6:20 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     5d67d1adeed7a6d0c7a9cc00a54a303401f20f8a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 06:20:26 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 06:20:26 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5d67d1ad

RepoConfigLoader: sort layout.conf attributes

---
 pym/portage/repository/config.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1a7effe..15c7ec5 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -399,9 +399,9 @@ class RepoConfigLoader(object):
 				# them the ability to do incremental overrrides
 				repo.aliases = layout_data['aliases'] + tuple(aliases)
 
-			for value in ('sign-manifest', 'thin-manifest', 'allow-missing-manifest',
-				'create-manifest', 'disable-manifest', 'cache-formats', 'manifest-hashes',
-				'update-changelog'):
+			for value in ('allow-missing-manifest', 'cache-formats',
+				'create-manifest', 'disable-manifest', 'manifest-hashes',
+				'sign-manifest', 'thin-manifest', 'update-changelog'):
 				setattr(repo, value.lower().replace("-", "_"), layout_data[value])
 
 			repo.portage1_profiles = any(x.startswith("portage-1") \



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  6:48 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  6:48 UTC (permalink / raw
  To: gentoo-commits

commit:     0902b4094895a91d6784eab93eb5016987177f04
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 06:48:44 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 06:48:44 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0902b409

RepoConfigLoader: use readfp for unicode

---
 pym/portage/repository/config.py |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 15c7ec5..d6a648e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -326,10 +326,27 @@ class RepoConfigLoader(object):
 	def _parse(paths, prepos, ignored_map, ignored_location_map):
 		"""Parse files in paths to load config"""
 		parser = SafeConfigParser()
-		try:
-			parser.read(paths)
-		except ParsingError as e:
-			writemsg(_("!!! Error while reading repo config file: %s\n") % e, noiselevel=-1)
+		# use readfp in order to control decoding of unicode
+		for p in paths:
+			f = None
+			try:
+				f = io.open(_unicode_encode(p,
+					encoding=_encodings['fs'], errors='strict'),
+					mode='r', encoding=_encodings['repo.content'],
+					errors='replace')
+			except EnvironmentError:
+				pass
+			else:
+				try:
+					parser.readfp(f)
+				except ParsingError as e:
+					writemsg(_unicode_decode(
+						_("!!! Error while reading repo config file: %s\n")
+						) % e, noiselevel=-1)
+			finally:
+				if f is not None:
+					f.close()
+
 		prepos['DEFAULT'] = RepoConfig("DEFAULT", parser.defaults())
 		for sname in parser.sections():
 			optdict = {}



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-28  7:17 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-28  7:17 UTC (permalink / raw
  To: gentoo-commits

commit:     24fb1338cb852950fffdad058cb1d88ef2eec43a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 28 07:17:25 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 28 07:17:25 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=24fb1338

RepoConfigLoader: python3.2 readfp deprecation

---
 pym/portage/repository/config.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index d6a648e..06a4d94 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -326,7 +326,14 @@ class RepoConfigLoader(object):
 	def _parse(paths, prepos, ignored_map, ignored_location_map):
 		"""Parse files in paths to load config"""
 		parser = SafeConfigParser()
-		# use readfp in order to control decoding of unicode
+
+		# use read_file/readfp in order to control decoding of unicode
+		try:
+			# Python >=3.2
+			read_file = parser.read_file
+		except AttributeError:
+			read_file = parser.readfp
+
 		for p in paths:
 			f = None
 			try:
@@ -338,7 +345,7 @@ class RepoConfigLoader(object):
 				pass
 			else:
 				try:
-					parser.readfp(f)
+					read_file(f)
 				except ParsingError as e:
 					writemsg(_unicode_decode(
 						_("!!! Error while reading repo config file: %s\n")



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-10-29  6:15 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-10-29  6:15 UTC (permalink / raw
  To: gentoo-commits

commit:     486b6ebd44bec7b12f6c4ab36c85b5c270fc3883
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 06:15:21 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 06:15:21 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=486b6ebd

RepoConfig: add iter_pregenerated_caches method

This will be used by egencache to generate cache for all supported
formats.

---
 pym/portage/repository/config.py |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 06a4d94..ed0f64d 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -124,32 +124,40 @@ class RepoConfig(object):
 		self.portage1_profiles = True
 		self.portage1_profiles_compat = False
 
-	def get_pregenerated_cache(self, auxdbkeys, readonly=True, force=False):
+	def iter_pregenerated_caches(self, auxdbkeys, readonly=True, force=False):
 		"""
-		Reads layout.conf cache-formats from left to right and returns a
-		cache instance for the first supported type that's found. If no
-		cache-formats are specified in layout.conf, 'pms' type is assumed
-		if the metadata/cache directory exists or force is True.
+		Reads layout.conf cache-formats from left to right and yields cache
+		instances for each supported type that's found. If no cache-formats
+		are specified in layout.conf, 'pms' type is assumed if the
+		metadata/cache directory exists or force is True.
 		"""
 		formats = self.cache_formats
 		if not formats:
 			if not force:
-				return None
+				return
 			formats = ('pms',)
 
 		for fmt in formats:
+			name = None
 			if fmt == 'pms':
 				from portage.cache.metadata import database
 				name = 'metadata/cache'
-				break
 			elif fmt == 'md5-dict':
 				from portage.cache.flat_hash import md5_database as database
 				name = 'metadata/md5-cache'
-				break
-		else:
-			return None
-		return database(self.location, name,
-			auxdbkeys, readonly=readonly)
+
+			if name is not None:
+				yield database(self.location, name,
+					auxdbkeys, readonly=readonly)
+
+	def get_pregenerated_cache(self, auxdbkeys, readonly=True, force=False):
+		"""
+		Returns the first cache instance yielded from
+		iter_pregenerated_caches(), or None if no cache is available or none
+		of the available formats are supported.
+		"""
+		return next(self.iter_pregenerated_caches(
+			auxdbkeys, readonly=readonly, force=force), None)
 
 	def load_manifest(self, *args, **kwds):
 		kwds['thin'] = self.thin_manifest



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-13 22:19 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-12-13 22:19 UTC (permalink / raw
  To: gentoo-commits

commit:     84dc400e53a715294615942021b8d0816e68e699
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 13 22:19:05 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Dec 13 22:19:05 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=84dc400e

RepoConfigLoader: masters eclass override order

Only append the current repo to eclass_locations if it's not there
already. This allows masters to have more control over eclass override
order, which may be useful for scenarios in which there is a plan to
migrate eclasses to a master repo. Thanks to Brian Harring
<ferringb <AT> gentoo.org) for suggesting this behavior.

---
 pym/portage/repository/config.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 4a8d866..0222253 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -531,7 +531,12 @@ class RepoConfigLoader(object):
 
 			eclass_locations = []
 			eclass_locations.extend(master_repo.location for master_repo in repo.masters)
-			eclass_locations.append(repo.location)
+			# Only append the current repo to eclass_locations if it's not
+			# there already. This allows masters to have more control over
+			# eclass override order, which may be useful for scenarios in
+			# which there is a plan to migrate eclasses to a master repo.
+			if repo.location not in eclass_locations:
+				eclass_locations.append(repo.location)
 
 			if repo.eclass_overrides:
 				for other_repo_name in repo.eclass_overrides:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-18  3:05 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-18  3:05 UTC (permalink / raw
  To: gentoo-commits

commit:     10246cd535f909dda8bd05de617c32d2b8a56b4a
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 18 03:01:31 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 03:01:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=10246cd5

Parse layout.conf files in portage.repository.config.RepoConfig.__init__()
instead of portage.repository.config.RepoConfigLoader.__init__().

---
 pym/portage/repository/config.py |   56 ++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0222253..1cc66dd 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -125,6 +125,33 @@ class RepoConfig(object):
 		self.portage1_profiles = True
 		self.portage1_profiles_compat = False
 
+		# Parse layout.conf.
+		if self.location:
+			layout_filename = os.path.join(self.location, "metadata", "layout.conf")
+			layout_data = parse_layout_conf(self.location, self.name)[0]
+
+			# layout.conf masters may be overridden here if we have a masters
+			# setting from the user's repos.conf
+			if self.masters is None:
+				self.masters = layout_data['masters']
+
+			if layout_data['aliases']:
+				aliases = self.aliases
+				if aliases is None:
+					aliases = ()
+				# repos.conf aliases come after layout.conf aliases, giving
+				# them the ability to do incremental overrides
+				self.aliases = layout_data['aliases'] + tuple(aliases)
+
+			for value in ('allow-missing-manifest', 'cache-formats',
+				'create-manifest', 'disable-manifest', 'manifest-hashes',
+				'sign-manifest', 'thin-manifest', 'update-changelog'):
+				setattr(self, value.lower().replace("-", "_"), layout_data[value])
+
+			self.portage1_profiles = any(x.startswith("portage-1") \
+				for x in layout_data['profile-formats'])
+			self.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)
+
 	def iter_pregenerated_caches(self, auxdbkeys, readonly=True, force=False):
 		"""
 		Reads layout.conf cache-formats from left to right and yields cache
@@ -412,35 +439,6 @@ class RepoConfigLoader(object):
 			for repo in prepos.values()
 			if repo.location is not None and repo.missing_repo_name)
 
-		#Parse layout.conf and read masters key.
-		for repo in prepos.values():
-			if not repo.location:
-				continue
-			layout_filename = os.path.join(repo.location, "metadata", "layout.conf")
-			layout_data, layout_errors = parse_layout_conf(repo.location, repo.name)
-
-			# layout.conf masters may be overridden here if we have a masters
-			# setting from the user's repos.conf
-			if repo.masters is None:
-				repo.masters = layout_data['masters']
-
-			if layout_data['aliases']:
-				aliases = repo.aliases
-				if aliases is None:
-					aliases = ()
-				# repos.conf aliases come after layout.conf aliases, giving
-				# them the ability to do incremental overrrides
-				repo.aliases = layout_data['aliases'] + tuple(aliases)
-
-			for value in ('allow-missing-manifest', 'cache-formats',
-				'create-manifest', 'disable-manifest', 'manifest-hashes',
-				'sign-manifest', 'thin-manifest', 'update-changelog'):
-				setattr(repo, value.lower().replace("-", "_"), layout_data[value])
-
-			repo.portage1_profiles = any(x.startswith("portage-1") \
-				for x in layout_data['profile-formats'])
-			repo.portage1_profiles_compat = layout_data['profile-formats'] == ('portage-1-compat',)
-
 		#Take aliases into account.
 		new_prepos = {}
 		for repo_name, repo in prepos.items():



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-18 21:14 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-18 21:14 UTC (permalink / raw
  To: gentoo-commits

commit:     3360b046e0cb7f23e6edba23dbef6d0ccd558834
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 18 21:14:00 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 21:14:00 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3360b046

Optimize RepoConfigLoader._add_overlays().

---
 pym/portage/repository/config.py |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1cc66dd..0f3f836 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -324,16 +324,12 @@ class RepoConfigLoader(object):
 					repo_conf_opts = prepos.get(repo.name)
 					if repo_conf_opts is not None:
 						if repo_conf_opts.aliases is not None:
-							repo_opts['aliases'] = \
-								' '.join(repo_conf_opts.aliases)
+							repo.aliases = repo_conf_opts.aliases
 						if repo_conf_opts.eclass_overrides is not None:
-							repo_opts['eclass-overrides'] = \
-								' '.join(repo_conf_opts.eclass_overrides)
+							repo.eclass_overrides = repo_conf_opts.eclass_overrides
 						if repo_conf_opts.masters is not None:
-							repo_opts['masters'] = \
-								' '.join(repo_conf_opts.masters)
+							repo.masters = repo_conf_opts.masters
 
-					repo = RepoConfig(repo.name, repo_opts)
 					if repo.name in prepos:
 						old_location = prepos[repo.name].location
 						if old_location is not None and old_location != repo.location:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-18 21:26 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-18 21:26 UTC (permalink / raw
  To: gentoo-commits

commit:     3427c50559cba9b488580f0b742fa2059a06e101
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 18 21:25:07 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 21:25:07 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3427c505

RepoConfigLoader._add_overlays(): Rename a variable and add a comment.

---
 pym/portage/repository/config.py |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0f3f836..eb72070 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -321,14 +321,15 @@ class RepoConfigLoader(object):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts)
-					repo_conf_opts = prepos.get(repo.name)
-					if repo_conf_opts is not None:
-						if repo_conf_opts.aliases is not None:
-							repo.aliases = repo_conf_opts.aliases
-						if repo_conf_opts.eclass_overrides is not None:
-							repo.eclass_overrides = repo_conf_opts.eclass_overrides
-						if repo_conf_opts.masters is not None:
-							repo.masters = repo_conf_opts.masters
+					# repos_conf_opts contains options from /etc/portage/repos.conf
+					repos_conf_opts = prepos.get(repo.name)
+					if repos_conf_opts is not None:
+						if repos_conf_opts.aliases is not None:
+							repo.aliases = repos_conf_opts.aliases
+						if repos_conf_opts.eclass_overrides is not None:
+							repo.eclass_overrides = repos_conf_opts.eclass_overrides
+						if repos_conf_opts.masters is not None:
+							repo.masters = repos_conf_opts.masters
 
 					if repo.name in prepos:
 						old_location = prepos[repo.name].location



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-18 21:57 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-18 21:57 UTC (permalink / raw
  To: gentoo-commits

commit:     4c91ad25d42202f66930853295eddcabea34fb8f
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 18 21:55:58 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 18 21:55:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4c91ad25

Define portage.repository.config.RepoConfig.__repr__().

---
 pym/portage/repository/config.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index eb72070..0b99e1b 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -270,6 +270,9 @@ class RepoConfig(object):
 		repo_msg.append("")
 		return "\n".join(repo_msg)
 
+	def __repr__(self):
+		return "<portage.repository.config.RepoConfig(name='%s', location='%s')>" % (self.name, _unicode_decode(self.location))
+
 	def __str__(self):
 		d = {}
 		for k in self.__slots__:



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-25 19:43 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2011-12-25 19:43 UTC (permalink / raw
  To: gentoo-commits

commit:     4cfa78b9406d9a8f94b3eae23631b2bb430bc533
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Dec 25 19:40:40 2011 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Dec 25 19:40:40 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4cfa78b9

portage.repository.config.RepoConfigLoader: Rename _add_overlays() to
_add_repositories().

---
 pym/portage/repository/config.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0b99e1b..f98b9b7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -290,7 +290,7 @@ class RepoConfigLoader(object):
 	"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
 
 	@staticmethod
-	def _add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
+	def _add_repositories(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
 		"""Add overlays in PORTDIR_OVERLAY as repositories"""
 		overlays = []
 		if portdir:
@@ -427,7 +427,7 @@ class RepoConfigLoader(object):
 
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.
-		portdir = self._add_overlays(portdir, portdir_overlay, prepos,
+		portdir = self._add_repositories(portdir, portdir_overlay, prepos,
 			ignored_map, ignored_location_map)
 		if portdir and portdir.strip():
 			portdir = os.path.realpath(portdir)



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2011-12-28  8:16 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2011-12-28  8:16 UTC (permalink / raw
  To: gentoo-commits

commit:     e2f5b48cd9533eea83b02c97cbab9e0df86e78e8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 28 08:15:58 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 28 08:15:58 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2f5b48c

RepoConfigLoader: don't mix duplicate repo config

RepoConfig.update() was being used to copy attributes from one instance
to another, possibly leading to inappropriate mixing of layout.conf
attributes from separate copies of the same repo. This is common with
repoman, for example, when temporarily overriding an rsync repo with
another copy of the same repo from CVS.

---
 pym/portage/repository/config.py |   35 +++++++++++++++++------------------
 1 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 4bf995e..1db691b 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -318,6 +318,14 @@ class RepoConfigLoader(object):
 				' '.join(prepos['DEFAULT'].masters)
 
 		if overlays:
+			# We need a copy of the original repos.conf data, since we're
+			# going to modify the prepos dict and some of the RepoConfig
+			# objects that we put in prepos may have to be discarded if
+			# they get overridden by a repository with the same name but
+			# a different location. This is common with repoman, for example,
+			# when temporarily overriding an rsync repo with another copy
+			# of the same repo from CVS.
+			repos_conf = prepos.copy()
 			#overlay priority is negative because we want them to be looked before any other repo
 			base_priority = 0
 			for ov in overlays:
@@ -325,21 +333,15 @@ class RepoConfigLoader(object):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts)
-					# repos_conf_opts may contain options from various places:
-					# 1) /etc/portage/repos.conf
-					# 2) $location/metadata/layout.conf if repos.conf specified
-					#    the repo location
-					# 3) A RepoConfig instance corresponding to a previously
-					#    processed path in the current list of overlays which
-					#    referred to a repository with the same name.
-					repos_conf_opts = prepos.get(repo.name)
+					# repos_conf_opts contains options from repos.conf
+					repos_conf_opts = repos_conf.get(repo.name)
 					if repos_conf_opts is not None:
-						if repos_conf_opts.aliases is not None:
-							repo.aliases = repos_conf_opts.aliases
-						if repos_conf_opts.eclass_overrides is not None:
-							repo.eclass_overrides = repos_conf_opts.eclass_overrides
-						if repos_conf_opts.masters is not None:
-							repo.masters = repos_conf_opts.masters
+						# Selectively copy only the attributes which
+						# repos.conf is allowed to override.
+						for k in ('aliases', 'eclass_overrides', 'masters'):
+							v = getattr(repos_conf_opts, k, None)
+							if v is not None:
+								setattr(repo, k, v)
 
 					if repo.name in prepos:
 						old_location = prepos[repo.name].location
@@ -348,10 +350,6 @@ class RepoConfigLoader(object):
 							ignored_location_map[old_location] = repo.name
 							if old_location == portdir:
 								portdir = repo.user_location
-						prepos[repo.name].update(repo)
-						repo = prepos[repo.name]
-					else:
-						prepos[repo.name] = repo
 
 					if ov == portdir and portdir not in port_ov:
 						repo.priority = -1000
@@ -359,6 +357,7 @@ class RepoConfigLoader(object):
 						repo.priority = base_priority
 						base_priority += 1
 
+					prepos[repo.name] = repo
 				else:
 					writemsg(_("!!! Invalid PORTDIR_OVERLAY"
 						" (not a dir): '%s'\n") % ov, noiselevel=-1)



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2012-01-08  3:12 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-08  3:12 UTC (permalink / raw
  To: gentoo-commits

commit:     440acc06b175f642de305f063fbf63805cdce3d8
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan  8 03:06:31 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 03:06:31 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=440acc06

Set portage-1 as default profile format for repositories using EAPI="4-python".

---
 pym/portage/repository/config.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 2734156..3207b30 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -669,6 +669,7 @@ def _get_repo_name(repo_location, cached=None):
 	return name
 
 def parse_layout_conf(repo_location, repo_name=None):
+	eapi = read_corresponding_eapi_file(os.path.join(repo_location, REPO_NAME_LOC))
 
 	layout_filename = os.path.join(repo_location, "metadata", "layout.conf")
 	layout_file = KeyValuePairFileLoader(layout_filename, None, None)
@@ -742,7 +743,10 @@ def parse_layout_conf(repo_location, repo_name=None):
 
 	raw_formats = layout_data.get('profile-formats')
 	if raw_formats is None:
-		raw_formats = ('portage-1-compat',)
+		if eapi in ('4-python',):
+			raw_formats = ('portage-1',)
+		else:
+			raw_formats = ('portage-1-compat',)
 	else:
 		raw_formats = set(raw_formats.split())
 		unknown = raw_formats.difference(['pms', 'portage-1'])



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2012-01-08  3:12 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2012-01-08  3:12 UTC (permalink / raw
  To: gentoo-commits

commit:     951c9b40cd45ba03daadbce94dfa87cda78675b0
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org>
AuthorDate: Sun Jan  8 03:00:07 2012 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org>
CommitDate: Sun Jan  8 03:00:07 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=951c9b40

Set eapi attribute on portage.repository.config.RepoConfig objects.

---
 pym/portage/repository/config.py |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1db691b..2734156 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -19,8 +19,8 @@ from portage import eclass_cache, os
 from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
 	REPO_NAME_LOC, USER_CONFIG_PATH)
 from portage.env.loaders import KeyValuePairFileLoader
-from portage.util import (normalize_path, writemsg, writemsg_level,
-	shlex_split, stack_lists)
+from portage.util import (normalize_path, read_corresponding_eapi_file, shlex_split,
+	stack_lists, writemsg, writemsg_level)
 from portage.localization import _
 from portage import _unicode_decode
 from portage import _unicode_encode
@@ -46,7 +46,7 @@ class RepoConfig(object):
 	"""Stores config of one repository"""
 
 	__slots__ = ('aliases', 'allow_missing_manifest',
-		'cache_formats', 'create_manifest', 'disable_manifest',
+		'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
 		'eclass_db', 'eclass_locations', 'eclass_overrides', 'format', 'location',
 		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
 		'name', 'priority', 'sign_manifest', 'sync', 'thin_manifest',
@@ -106,12 +106,15 @@ class RepoConfig(object):
 			location = None
 		self.location = location
 
+		eapi = None
 		missing = True
 		if self.location is not None:
+			eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC))
 			name, missing = self._read_valid_repo_name(self.location)
-
 		elif name == "DEFAULT": 
 			missing = False
+
+		self.eapi = eapi
 		self.name = name
 		self.missing_repo_name = missing
 		self.sign_manifest = True



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2012-02-03 22:41 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2012-02-03 22:41 UTC (permalink / raw
  To: gentoo-commits

commit:     9ad263416ec282d8c6cf007ca84bf716c49c4f69
Author:     Daniel Hornung <daniel.hornung <AT> gmx <DOT> de>
AuthorDate: Fri Feb  3 22:33:35 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb  3 22:33:35 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9ad26341

Honor repos.conf for overlay priority, bug 402099

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

---
 pym/portage/repository/config.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 3207b30..ebee234 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -341,7 +341,7 @@ class RepoConfigLoader(object):
 					if repos_conf_opts is not None:
 						# Selectively copy only the attributes which
 						# repos.conf is allowed to override.
-						for k in ('aliases', 'eclass_overrides', 'masters'):
+						for k in ('aliases', 'eclass_overrides', 'masters', 'priority'):
 							v = getattr(repos_conf_opts, k, None)
 							if v is not None:
 								setattr(repo, k, v)
@@ -356,7 +356,7 @@ class RepoConfigLoader(object):
 
 					if ov == portdir and portdir not in port_ov:
 						repo.priority = -1000
-					else:
+					elif repo.priority is None:
 						repo.priority = base_priority
 						base_priority += 1
 



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2012-05-11 23:28 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2012-05-11 23:28 UTC (permalink / raw
  To: gentoo-commits

commit:     4cdf0ecb9d54300e92912f4e409f9de1fd208e71
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 11 23:28:05 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 11 23:28:05 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4cdf0ecb

RepoConfig: sort __slots__

---
 pym/portage/repository/config.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 3716569..71aefde 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -49,9 +49,9 @@ class RepoConfig(object):
 		'cache_formats', 'create_manifest', 'disable_manifest', 'eapi',
 		'eclass_db', 'eclass_locations', 'eclass_overrides', 'format', 'location',
 		'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
-		'name', 'priority', 'profile_formats', 'sign_commit', 'sign_manifest', 'sync', 'thin_manifest',
-		'update_changelog', 'user_location', 'portage1_profiles',
-		'portage1_profiles_compat')
+		'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
+		'profile_formats', 'sign_commit', 'sign_manifest', 'sync',
+		'thin_manifest', 'update_changelog', 'user_location')
 
 	def __init__(self, name, repo_opts):
 		"""Build a RepoConfig with options in repo_opts



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2012-06-06  0:11 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2012-06-06  0:11 UTC (permalink / raw
  To: gentoo-commits

commit:     9e11086e9ec14b138f291eb501a81965e87be781
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 00:11:00 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 00:11:00 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e11086e

parse_layout_conf: fix cache-formats pms fallback

This fixes an issue where egencache would not generate metadata/cache
unless the directory already existed.

---
 pym/portage/repository/config.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 20f1919..9b43f38 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -712,10 +712,10 @@ def parse_layout_conf(repo_location, repo_name=None):
 
 	# for compatibility w/ PMS, fallback to pms; but also check if the
 	# cache exists or not.
-	cache_formats = layout_data.get('cache-formats', 'pms').lower().split()
-	if 'pms' in cache_formats and not os.path.isdir(
+	cache_formats = layout_data.get('cache-formats', '').lower().split()
+	if not cache_formats and os.path.isdir(
 		os.path.join(repo_location, 'metadata', 'cache')):
-		cache_formats.remove('pms')
+		cache_formats = ['pms']
 	data['cache-formats'] = tuple(cache_formats)
 
 	manifest_hashes = layout_data.get('manifest-hashes')



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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-01-24 20:01 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-01-24 20:01 UTC (permalink / raw
  To: gentoo-commits

commit:     3a43b4392d5c23bc049a5ac925cdda981c751178
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 24 20:01:28 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 24 20:01:28 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3a43b439

RepoConfigLoader: raise PermissionDenied

---
 pym/portage/repository/config.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 8a110e9..9a6c15d 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -6,6 +6,7 @@ from __future__ import unicode_literals
 import io
 import logging
 import warnings
+import stat
 import sys
 import re
 
@@ -23,6 +24,7 @@ from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
 	REPO_NAME_LOC, USER_CONFIG_PATH)
 from portage.eapi import eapi_allows_directories_on_profile_level_and_repository_level
 from portage.env.loaders import KeyValuePairFileLoader
+from portage.exception import PermissionDenied
 from portage.util import (normalize_path, read_corresponding_eapi_file, shlex_split,
 	stack_lists, writemsg, writemsg_level)
 from portage.localization import _
@@ -373,7 +375,14 @@ class RepoConfigLoader(object):
 			#overlay priority is negative because we want them to be looked before any other repo
 			base_priority = 0
 			for ov in overlays:
-				if os.path.isdir(ov):
+				try:
+					st = os.stat(ov)
+				except OSError as e:
+					st = None
+					if e.errno == PermissionDenied.errno:
+						raise PermissionDenied("stat('%s')" % ov)
+
+				if st is not None and stat.S_ISDIR(st.st_mode):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-03-10  8:07 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-03-10  8:07 UTC (permalink / raw
  To: gentoo-commits

commit:     99780dbda44e9813a1414594320870f130940a07
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 08:07:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 08:07:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=99780dbd

RepoConfig: always map unaliased when available

This fixes get_name_for_location so that it always returns the
unaliased repo name, rather than (randomly) returning aliases.

---
 pym/portage/repository/config.py |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5aef4f7..30eac93 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -490,9 +490,15 @@ class RepoConfigLoader(object):
 			for repo in prepos.values()
 			if repo.location is not None and repo.missing_repo_name)
 
-		#Take aliases into account.
-		new_prepos = {}
+		# Do this before expanding aliases, so that location_map and
+		# treemap consistently map unaliased names whenever available.
 		for repo_name, repo in prepos.items():
+			if repo.location is not None:
+				location_map[repo.location] = repo_name
+				treemap[repo_name] = repo.location
+
+		# Add alias mappings, but never replace unaliased mappings.
+		for repo_name, repo in list(prepos.items()):
 			names = set()
 			names.add(repo_name)
 			if repo.aliases:
@@ -500,17 +506,19 @@ class RepoConfigLoader(object):
 				names.update(aliases)
 
 			for name in names:
-				if name in new_prepos:
+				if name in prepos and prepos[name].location is not None:
+					if name == repo_name:
+						# unaliased names already handled earlier
+						continue
 					writemsg_level(_("!!! Repository name or alias '%s', " + \
 						"defined for repository '%s', overrides " + \
 						"existing alias or repository.\n") % (name, repo_name), level=logging.WARNING, noiselevel=-1)
-				new_prepos[name] = repo
-		prepos = new_prepos
-
-		for (name, r) in prepos.items():
-			if r.location is not None:
-				location_map[r.location] = name
-				treemap[name] = r.location
+					# Never replace an unaliased mapping with
+					# an aliased mapping.
+					continue
+				prepos[name] = repo
+				if repo.location is not None:
+					treemap[name] = repo.location
 
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-03-10  8:22 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-03-10  8:22 UTC (permalink / raw
  To: gentoo-commits

commit:     614840b13902026cfe6c5072e75c178265e567f3
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 08:07:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 08:21:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=614840b1

RepoConfig: always map unaliased when available

This fixes get_name_for_location so that it always returns the
unaliased repo name, rather than (randomly) returning aliases.

---
 pym/portage/repository/config.py |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5aef4f7..ba02102 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -490,9 +490,15 @@ class RepoConfigLoader(object):
 			for repo in prepos.values()
 			if repo.location is not None and repo.missing_repo_name)
 
-		#Take aliases into account.
-		new_prepos = {}
+		# Do this before expanding aliases, so that location_map and
+		# treemap consistently map unaliased names whenever available.
 		for repo_name, repo in prepos.items():
+			if repo.location is not None:
+				location_map[repo.location] = repo_name
+				treemap[repo_name] = repo.location
+
+		# Add alias mappings, but never replace unaliased mappings.
+		for repo_name, repo in list(prepos.items()):
 			names = set()
 			names.add(repo_name)
 			if repo.aliases:
@@ -500,17 +506,23 @@ class RepoConfigLoader(object):
 				names.update(aliases)
 
 			for name in names:
-				if name in new_prepos:
+				if name in prepos and prepos[name].location is not None:
+					if name == repo_name:
+						# unaliased names already handled earlier
+						continue
 					writemsg_level(_("!!! Repository name or alias '%s', " + \
 						"defined for repository '%s', overrides " + \
 						"existing alias or repository.\n") % (name, repo_name), level=logging.WARNING, noiselevel=-1)
-				new_prepos[name] = repo
-		prepos = new_prepos
-
-		for (name, r) in prepos.items():
-			if r.location is not None:
-				location_map[r.location] = name
-				treemap[name] = r.location
+					# Never replace an unaliased mapping with
+					# an aliased mapping.
+					continue
+				prepos[name] = repo
+				if repo.location is not None:
+					if repo.location not in location_map:
+						# Never replace an unaliased mapping with
+						# an aliased mapping.
+						location_map[repo.location] = repo_name
+					treemap[name] = repo.location
 
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-03-10  8:31 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-03-10  8:31 UTC (permalink / raw
  To: gentoo-commits

commit:     8860b8614530dd3d8e0e707f317b815d0f3bdf6c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 08:07:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 08:30:50 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8860b861

RepoConfig: always map unaliased when available

This fixes get_name_for_location so that it always returns the
unaliased repo name, rather than (randomly) returning aliases.

---
 pym/portage/repository/config.py |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5aef4f7..ef2e4f0 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -490,9 +490,15 @@ class RepoConfigLoader(object):
 			for repo in prepos.values()
 			if repo.location is not None and repo.missing_repo_name)
 
-		#Take aliases into account.
-		new_prepos = {}
+		# Do this before expanding aliases, so that location_map and
+		# treemap consistently map unaliased names whenever available.
 		for repo_name, repo in prepos.items():
+			if repo.location is not None:
+				location_map[repo.location] = repo_name
+				treemap[repo_name] = repo.location
+
+		# Add alias mappings, but never replace unaliased mappings.
+		for repo_name, repo in list(prepos.items()):
 			names = set()
 			names.add(repo_name)
 			if repo.aliases:
@@ -500,17 +506,23 @@ class RepoConfigLoader(object):
 				names.update(aliases)
 
 			for name in names:
-				if name in new_prepos:
+				if name in prepos and prepos[name].location is not None:
+					if name == repo_name:
+						# unaliased names already handled earlier
+						continue
 					writemsg_level(_("!!! Repository name or alias '%s', " + \
 						"defined for repository '%s', overrides " + \
 						"existing alias or repository.\n") % (name, repo_name), level=logging.WARNING, noiselevel=-1)
-				new_prepos[name] = repo
-		prepos = new_prepos
-
-		for (name, r) in prepos.items():
-			if r.location is not None:
-				location_map[r.location] = name
-				treemap[name] = r.location
+					# Never replace an unaliased mapping with
+					# an aliased mapping.
+					continue
+				prepos[name] = repo
+				if repo.location is not None:
+					if repo.location not in location_map:
+						# Never replace an unaliased mapping with
+						# an aliased mapping.
+						location_map[repo.location] = name
+					treemap[name] = repo.location
 
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-03-20 18:38 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-03-20 18:38 UTC (permalink / raw
  To: gentoo-commits

commit:     f0943b68d291cb6125d4af9497916020da419ed1
Author:     Brandon Philips <brandon <AT> ifup <DOT> co>
AuthorDate: Wed Mar 20 18:13:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 18:37:47 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f0943b68

config: fix typo maid -> main

this looks like a typo. maid_repo should be main_repo.

---
 pym/portage/repository/config.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index ef2e4f0..adeab18 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -656,10 +656,10 @@ class RepoConfigLoader(object):
 
 	def mainRepo(self):
 		"""Returns the main repo"""
-		maid_repo = self.prepos['DEFAULT'].main_repo
-		if maid_repo is None:
+		main_repo = self.prepos['DEFAULT'].main_repo
+		if main_repo is None:
 			return None
-		return self.prepos[maid_repo]
+		return self.prepos[main_repo]
 
 	def _check_locations(self):
 		"""Check if repositories location are correct and show a warning message if not"""


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-03-29 21:43 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-03-29 21:43 UTC (permalink / raw
  To: gentoo-commits

commit:     da471fa9a131f3bb99941ef315f187b8772a3d7f
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 29 09:23:47 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 21:42:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=da471fa9

Support overriding repo-name from layout.conf.

Consider this an undocumented and unsupported feature which will make my
life much easier. And decrease the amount of repo_name changes committed
by mistake. See bug #433561.

---
 pym/portage/repository/config.py |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index adeab18..969fce4 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -180,6 +180,12 @@ class RepoConfig(object):
 				# them the ability to do incremental overrides
 				self.aliases = layout_data['aliases'] + tuple(aliases)
 
+			if layout_data['repo-name']:
+				# allow layout.conf to override repository name
+				# useful when having two copies of the same repo enabled
+				# to avoid modifying profiles/repo_name in one of them
+				self.name = layout_data['repo-name']
+
 			for value in ('allow-missing-manifest',
 				'allow-provide-virtual', 'cache-formats',
 				'create-manifest', 'disable-manifest', 'manifest-hashes',
@@ -748,6 +754,8 @@ def parse_layout_conf(repo_location, repo_name=None):
 	data['thin-manifest'] = layout_data.get('thin-manifests', 'false').lower() \
 		== 'true'
 
+	data['repo-name'] = _gen_valid_repo(layout_data.get('repo-name', ''))
+
 	manifest_policy = layout_data.get('use-manifests', 'strict').lower()
 	data['allow-missing-manifest'] = manifest_policy != 'strict'
 	data['create-manifest'] = manifest_policy != 'false'


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-18 16:14 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-18 16:14 UTC (permalink / raw
  To: gentoo-commits

commit:     86d69ef86ab2a9addec6a290a1c3958bc2ba55de
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 16:13:43 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 16:13:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=86d69ef8

RepoConfigLoader: delete repo if location missing

---
 pym/portage/repository/config.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index da8c365..a63bc9c 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -508,8 +508,16 @@ class RepoConfigLoader(object):
 
 		# Do this before expanding aliases, so that location_map and
 		# treemap consistently map unaliased names whenever available.
-		for repo_name, repo in prepos.items():
-			if repo.location is not None:
+		for repo_name, repo in list(prepos.items()):
+			if repo.location is None:
+				if repo_name != 'DEFAULT':
+					if paths:
+						writemsg_level(_("Location undefined for " \
+							"repository '%s' referenced in '%s'\n") % \
+							(repo.name, paths[0]),
+							level=logging.ERROR, noiselevel=-1)
+					del prepos[repo_name]
+			else:
 				location_map[repo.location] = repo_name
 				treemap[repo_name] = repo.location
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-18 17:47 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-18 17:47 UTC (permalink / raw
  To: gentoo-commits

commit:     a2a41572a696bd280a5004794f9067b31dde6b48
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 17:46:59 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 17:46:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2a41572

RepoConfigLoader: fix main-repo priority default

This ensures that the main-repo default priority is set to -1000
in all cases where it's appropriate.

---
 pym/portage/repository/config.py | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a63bc9c..56a9ea4 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -355,8 +355,10 @@ class RepoConfigLoader(object):
 	def _add_repositories(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map):
 		"""Add overlays in PORTDIR_OVERLAY as repositories"""
 		overlays = []
+		portdir_orig = None
 		if portdir:
 			portdir = normalize_path(portdir)
+			portdir_orig = portdir
 			overlays.append(portdir)
 		try:
 			port_ov = [normalize_path(i) for i in shlex_split(portdir_overlay)]
@@ -412,11 +414,15 @@ class RepoConfigLoader(object):
 							if old_location == portdir:
 								portdir = repo.user_location
 
-					if ov == portdir and portdir not in port_ov:
-						repo.priority = -1000
-					elif repo.priority is None:
-						repo.priority = base_priority
-						base_priority += 1
+					if repo.priority is None:
+						if base_priority == 0 and ov == portdir_orig:
+							# If it's the original PORTDIR setting and it's not
+							# in PORTDIR_OVERLAY, then it will be assigned a
+							# special priority setting later.
+							pass
+						else:
+							repo.priority = base_priority
+							base_priority += 1
 
 					prepos[repo.name] = repo
 				else:
@@ -556,18 +562,21 @@ class RepoConfigLoader(object):
 		prepos_order = [repo.name for (key, repo) in prepos_order
 			if repo.name == key and repo.location is not None]
 
-		if prepos['DEFAULT'].main_repo is None or \
-			prepos['DEFAULT'].main_repo not in prepos:
+		main_repo = prepos['DEFAULT'].main_repo
+		if main_repo is None or main_repo not in prepos:
 			#setting main_repo if it was not set in repos.conf
-			if portdir in location_map:
-				prepos['DEFAULT'].main_repo = location_map[portdir]
-			elif portdir in ignored_location_map:
-				prepos['DEFAULT'].main_repo = ignored_location_map[portdir]
+			main_repo = location_map.get(portdir)
+			if main_repo is not None:
+				prepos['DEFAULT'].main_repo = main_repo
 			else:
 				prepos['DEFAULT'].main_repo = None
 				if not portage._sync_disabled_warnings:
 					writemsg(_("!!! main-repo not set in DEFAULT and PORTDIR is empty.\n"), noiselevel=-1)
 
+		if main_repo is not None and prepos[main_repo].priority is None:
+			# This happens if main-repo has been set in repos.conf.
+			prepos[main_repo].priority = -1000
+
 		self.prepos = prepos
 		self.prepos_order = prepos_order
 		self.ignored_repos = ignored_repos


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-18 21:20 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-18 21:20 UTC (permalink / raw
  To: gentoo-commits

commit:     f9e7b12db80b10e509f07ef3bb7bac65a0a7573d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 18 21:20:35 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 21:20:35 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f9e7b12d

RepoConfigLoader: main-repo priority before sort

---
 pym/portage/repository/config.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 56a9ea4..40fe2c9 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -554,14 +554,6 @@ class RepoConfigLoader(object):
 						location_map[repo.location] = name
 					treemap[name] = repo.location
 
-		# filter duplicates from aliases, by only including
-		# items where repo.name == key
-
-		prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0)
-
-		prepos_order = [repo.name for (key, repo) in prepos_order
-			if repo.name == key and repo.location is not None]
-
 		main_repo = prepos['DEFAULT'].main_repo
 		if main_repo is None or main_repo not in prepos:
 			#setting main_repo if it was not set in repos.conf
@@ -577,6 +569,13 @@ class RepoConfigLoader(object):
 			# This happens if main-repo has been set in repos.conf.
 			prepos[main_repo].priority = -1000
 
+		# filter duplicates from aliases, by only including
+		# items where repo.name == key
+		prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0)
+		prepos_order = [repo.name for (key, repo) in prepos_order
+			if repo.name == key and key != 'DEFAULT' and
+			repo.location is not None]
+
 		self.prepos = prepos
 		self.prepos_order = prepos_order
 		self.ignored_repos = ignored_repos


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  1:58 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  1:58 UTC (permalink / raw
  To: gentoo-commits

commit:     a35f183bc219c02057f90823f3ffea9672253b84
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 01:58:15 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 01:58:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a35f183b

RepoConfigLoader: suppress /usr/portage warning

Suppress warnings for the make.defaults PORTDIR setting if we have an
existing main-repo defined in repos.conf.

---
 pym/portage/repository/config.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 40fe2c9..6206aff 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -426,6 +426,17 @@ class RepoConfigLoader(object):
 
 					prepos[repo.name] = repo
 				else:
+					if base_priority == 0 and ov == '/usr/portage':
+						# Suppress warnings for the make.defaults
+						# PORTDIR setting if we have an existing
+						# main-repo defined in repos.conf.
+						main_repo = prepos['DEFAULT'].main_repo
+						if main_repo is not None and main_repo in prepos:
+							main_repo_loc = prepos[main_repo].location
+							if main_repo_loc and \
+								isdir_raise_eaccess(main_repo_loc):
+								continue
+
 					if not portage._sync_disabled_warnings:
 						writemsg(_("!!! Invalid PORTDIR_OVERLAY (not a dir): '%s'\n") % ov, noiselevel=-1)
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  2:19 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  2:19 UTC (permalink / raw
  To: gentoo-commits

commit:     ab3131f0e38ac1a9707ae672c831d1759ec0db4c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 02:19:05 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 02:19:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ab3131f0

RepoConfigLoader: refer to make.globals in comment

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 6206aff..1b15a39 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -427,7 +427,7 @@ class RepoConfigLoader(object):
 					prepos[repo.name] = repo
 				else:
 					if base_priority == 0 and ov == '/usr/portage':
-						# Suppress warnings for the make.defaults
+						# Suppress warnings for the make.globals
 						# PORTDIR setting if we have an existing
 						# main-repo defined in repos.conf.
 						main_repo = prepos['DEFAULT'].main_repo


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  3:42 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  3:42 UTC (permalink / raw
  To: gentoo-commits

commit:     ed5d9c98a0ddea543590516cae7ce54b30bf2a94
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 03:42:33 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 03:42:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed5d9c98

RepoConfigLoader: pass source arg to read_file

The 'source' keyword argument is needed since otherwise ConfigParser
may throw a TypeError because it assumes f.name is a native string
rather than binary when constructing error messages.

---
 pym/portage/repository/config.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1b15a39..444e6a7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -451,8 +451,10 @@ class RepoConfigLoader(object):
 		try:
 			# Python >=3.2
 			read_file = parser.read_file
+			source_kwarg = 'source'
 		except AttributeError:
 			read_file = parser.readfp
+			source_kwarg = 'filename'
 
 		for p in paths:
 			f = None
@@ -464,8 +466,13 @@ class RepoConfigLoader(object):
 			except EnvironmentError:
 				pass
 			else:
+				# The 'source' keyword argument is needed since
+				# otherwise ConfigParsier may throw a TypeError because
+				# it assumes that f.name is a native string rather
+				# than binary when constructing error messages.
+				kwargs = {source_kwarg: p}
 				try:
-					read_file(f)
+					read_file(f, **portage._native_kwargs(kwargs))
 				except ParsingError as e:
 					writemsg(
 						_("!!! Error while reading repo config file: %s\n") % e,


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  3:58 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  3:58 UTC (permalink / raw
  To: gentoo-commits

commit:     253ce79328470b7b20e676be350fa4ff5bfc3513
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 03:57:52 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 03:57:52 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=253ce793

RepoConfigLoader: handle configparser.Error

---
 pym/portage/repository/config.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 444e6a7..ba9f7ff 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -10,13 +10,13 @@ import sys
 import re
 
 try:
-	from configparser import ParsingError
+	from configparser import Error as ConfigParserError
 	if sys.hexversion >= 0x3020000:
 		from configparser import ConfigParser as SafeConfigParser
 	else:
 		from configparser import SafeConfigParser
 except ImportError:
-	from ConfigParser import SafeConfigParser, ParsingError
+	from ConfigParser import SafeConfigParser, Error as ConfigParserError
 import portage
 from portage import eclass_cache, os
 from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
@@ -473,7 +473,7 @@ class RepoConfigLoader(object):
 				kwargs = {source_kwarg: p}
 				try:
 					read_file(f, **portage._native_kwargs(kwargs))
-				except ParsingError as e:
+				except ConfigParserError as e:
 					writemsg(
 						_("!!! Error while reading repo config file: %s\n") % e,
 						noiselevel=-1)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  4:49 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  4:49 UTC (permalink / raw
  To: gentoo-commits

commit:     81e414bc5ea805ba241d42dedcad97f151976525
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 04:49:36 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 04:49:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=81e414bc

RepoConfigLoader: return early for parse error

The configparser state is unreliable (prone to odd quirky exceptions)
after is has thrown an error, so just return early.

---
 pym/portage/repository/config.py | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index ba9f7ff..925a678 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -471,12 +471,7 @@ class RepoConfigLoader(object):
 				# it assumes that f.name is a native string rather
 				# than binary when constructing error messages.
 				kwargs = {source_kwarg: p}
-				try:
-					read_file(f, **portage._native_kwargs(kwargs))
-				except ConfigParserError as e:
-					writemsg(
-						_("!!! Error while reading repo config file: %s\n") % e,
-						noiselevel=-1)
+				read_file(f, **portage._native_kwargs(kwargs))
 			finally:
 				if f is not None:
 					f.close()
@@ -514,7 +509,22 @@ class RepoConfigLoader(object):
 		portdir = settings.get('PORTDIR', '')
 		portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
 
-		self._parse(paths, prepos, ignored_map, ignored_location_map)
+		try:
+			self._parse(paths, prepos, ignored_map, ignored_location_map)
+		except ConfigParserError as e:
+			writemsg(
+				_("!!! Error while reading repo config file: %s\n") % e,
+				noiselevel=-1)
+			# The configparser state is unreliable (prone to odd quirky
+			# exceptions) after is has thrown an error, so just return early.
+			self.prepos = {'DEFAULT': RepoConfig('DEFAULT', {})}
+			self.prepos_order = ()
+			self.ignored_repos = ()
+			self.location_map = {}
+			self.treemap = {}
+			self._prepos_changed = True
+			self._repo_location_list = ()
+			return
 
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19  5:55 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     ac8951a0d1dff7f836d01d39026061ef8dd53bda
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 05:55:32 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 05:55:32 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ac8951a0

RepoConfigLoader: initialize missing_repo_names

---
 pym/portage/repository/config.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 925a678..de1e7bc 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -524,6 +524,7 @@ class RepoConfigLoader(object):
 			self.treemap = {}
 			self._prepos_changed = True
 			self._repo_location_list = ()
+			self.missing_repo_names = frozenset()
 			return
 
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19 18:02 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     a9e9402329500180b3e61cacf7b98b60a0685761
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 18:02:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 18:02:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a9e94023

RepoConfigLoader: handle invalid repos.conf more

---
 pym/portage/repository/config.py | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index de1e7bc..508a56e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -515,17 +515,15 @@ class RepoConfigLoader(object):
 			writemsg(
 				_("!!! Error while reading repo config file: %s\n") % e,
 				noiselevel=-1)
-			# The configparser state is unreliable (prone to odd quirky
-			# exceptions) after is has thrown an error, so just return early.
-			self.prepos = {'DEFAULT': RepoConfig('DEFAULT', {})}
-			self.prepos_order = ()
-			self.ignored_repos = ()
-			self.location_map = {}
-			self.treemap = {}
-			self._prepos_changed = True
-			self._repo_location_list = ()
-			self.missing_repo_names = frozenset()
-			return
+			# The configparser state is unreliable (prone to quirky
+			# exceptions) after it has thrown an error, so use empty
+			# config and try to fall back to PORTDIR{,_OVERLAY}.
+			prepos.clear()
+			prepos['DEFAULT'] = RepoConfig('DEFAULT', {})
+			location_map.clear()
+			treemap.clear()
+			ignored_map.clear()
+			ignored_location_map.clear()
 
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19 19:11 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19 19:11 UTC (permalink / raw
  To: gentoo-commits

commit:     2a65e8affdb5c8dd3830ce40809729c7a53fc1d1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 19:10:48 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 19:10:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a65e8af

RepoConfigLoader: handle equal priorities

Include repo.name in sort key, for predictable sorting even when
priorities are equal.

---
 pym/portage/repository/config.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 7c69fb4..7de6954 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -616,9 +616,13 @@ class RepoConfigLoader(object):
 			# This happens if main-repo has been set in repos.conf.
 			prepos[main_repo].priority = -1000
 
+		# Include repo.name in sort key, for predictable sorting
+		# even when priorities are equal.
+		prepos_order = sorted(prepos.items(),
+			key=lambda r:(r[1].priority or 0, repo.name))
+
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key
-		prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0)
 		prepos_order = [repo.name for (key, repo) in prepos_order
 			if repo.name == key and key != 'DEFAULT' and
 			repo.location is not None]


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-19 19:22 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-19 19:22 UTC (permalink / raw
  To: gentoo-commits

commit:     18297c51e845cfc0512cc5c3013e96a21a16479f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 19 19:21:44 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jun 19 19:21:44 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=18297c51

RepoConfigLoader: fix last commit

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 7de6954..49af5e8 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -619,7 +619,7 @@ class RepoConfigLoader(object):
 		# Include repo.name in sort key, for predictable sorting
 		# even when priorities are equal.
 		prepos_order = sorted(prepos.items(),
-			key=lambda r:(r[1].priority or 0, repo.name))
+			key=lambda r:(r[1].priority or 0, r[1].name))
 
 		# filter duplicates from aliases, by only including
 		# items where repo.name == key


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 17:04 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 17:04 UTC (permalink / raw
  To: gentoo-commits

commit:     71b294590c5794d69f2f700aebf17c047fda833d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 17:04:14 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 17:04:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71b29459

Print error when section name set in repos.conf differs from name set inside repository.

---
 pym/portage/repository/config.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 49af5e8..13de814 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -153,14 +153,14 @@ class RepoConfig(object):
 
 		eapi = None
 		missing = True
+		self.name = name
 		if self.location is not None:
 			eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC))
-			name, missing = self._read_valid_repo_name(self.location)
+			self.name, missing = self._read_valid_repo_name(self.location)
 		elif name == "DEFAULT": 
 			missing = False
 
 		self.eapi = eapi
-		self.name = name
 		self.missing_repo_name = missing
 		# sign_commit is disabled by default, since it requires Git >=1.7.9,
 		# and key_id configured by `git config user.signingkey key_id`
@@ -217,6 +217,10 @@ class RepoConfig(object):
 			self._eapis_banned = frozenset(layout_data['eapis-banned'])
 			self._eapis_deprecated = frozenset(layout_data['eapis-deprecated'])
 
+		if name is not None and name != self.name:
+			raise ValueError(_("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
+				(name, self.name))
+
 	def eapi_is_banned(self, eapi):
 		return eapi in self._eapis_banned
 
@@ -500,7 +504,11 @@ class RepoConfigLoader(object):
 			for oname in parser.options(sname):
 				optdict[oname] = parser.get(sname, oname)
 
-			repo = RepoConfig(sname, optdict, local_config=local_config)
+			try:
+				repo = RepoConfig(sname, optdict, local_config=local_config)
+			except ValueError as e:
+				writemsg_level("!!! %s\n" % (e,), level=logging.ERROR, noiselevel=-1)
+				continue
 			if repo.location and not exists_raise_eaccess(repo.location):
 				writemsg(_("!!! Invalid repos.conf entry '%s'"
 					" (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 18:57 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-24 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     62ffc93ae64174fcde95ddf7b8efe44e45884a5e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 18:56:44 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 18:56:44 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=62ffc93a

RepoConfigLoader: don't use ValueError to warn

Handling ValueError can hide tracebacks from unexpected bugs,
so avoid it.

---
 pym/portage/repository/config.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 13de814..5ec8304 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -217,10 +217,6 @@ class RepoConfig(object):
 			self._eapis_banned = frozenset(layout_data['eapis-banned'])
 			self._eapis_deprecated = frozenset(layout_data['eapis-deprecated'])
 
-		if name is not None and name != self.name:
-			raise ValueError(_("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
-				(name, self.name))
-
 	def eapi_is_banned(self, eapi):
 		return eapi in self._eapis_banned
 
@@ -504,11 +500,13 @@ class RepoConfigLoader(object):
 			for oname in parser.options(sname):
 				optdict[oname] = parser.get(sname, oname)
 
-			try:
-				repo = RepoConfig(sname, optdict, local_config=local_config)
-			except ValueError as e:
-				writemsg_level("!!! %s\n" % (e,), level=logging.ERROR, noiselevel=-1)
+			repo = RepoConfig(sname, optdict, local_config=local_config)
+			if repo.name != sname:
+				writemsg_level("!!! %s\n" %
+				   _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
+					(sname, repo.name), level=logging.ERROR, noiselevel=-1)
 				continue
+
 			if repo.location and not exists_raise_eaccess(repo.location):
 				writemsg(_("!!! Invalid repos.conf entry '%s'"
 					" (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 19:24 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-24 19:24 UTC (permalink / raw
  To: gentoo-commits

commit:     500f8f02ab0b35df11ac55f885832be8646cd72a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 19:24:39 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 19:24:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=500f8f02

RepoConfigLoader: fix bug #474578

---
 pym/portage/repository/config.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5ec8304..076dcea 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -570,7 +570,8 @@ class RepoConfigLoader(object):
 		for repo_name, repo in list(prepos.items()):
 			if repo.location is None:
 				if repo_name != 'DEFAULT':
-					if paths:
+					# Skip this warning for repoman (bug #474578).
+					if settings.local_config and paths:
 						writemsg_level(_("Location undefined for " \
 							"repository '%s' referenced in '%s'\n") % \
 							(repo.name, paths[0]),


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 19:40 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 19:40 UTC (permalink / raw
  To: gentoo-commits

commit:     e14c907d32634b9f3335eae43857b3f47f1f06b9
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 19:37:48 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 19:37:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e14c907d

Improve portage.repository.config.RepoConfig.__repr__() for location of DEFAULT repository.

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 076dcea..304335e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -348,7 +348,7 @@ class RepoConfig(object):
 		return "\n".join(repo_msg)
 
 	def __repr__(self):
-		return "<portage.repository.config.RepoConfig(name='%s', location='%s')>" % (self.name, _unicode_decode(self.location))
+		return "<portage.repository.config.RepoConfig(name=%r, location=%r)>" % (self.name, _unicode_decode(self.location))
 
 	def __str__(self):
 		d = {}


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 19:45 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 19:45 UTC (permalink / raw
  To: gentoo-commits

commit:     8dff57e928a017b58e31f0a88474bd9ad42ce1c9
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 19:44:30 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 19:44:30 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8dff57e9

portage.repository.config.RepoConfigLoader: Add __setitem__() and __delitem__().

---
 pym/portage/repository/config.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 304335e..0a2dd00 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -783,9 +783,15 @@ class RepoConfigLoader(object):
 	def get_repo_for_location(self, location):
 		return self.prepos[self.get_name_for_location(location)]
 
+	def __setitem__(self, repo_name, repo):
+		self.prepos[repo_name] = repo
+
 	def __getitem__(self, repo_name):
 		return self.prepos[repo_name]
 
+	def __delitem__(self, repo_name):
+		del self.prepos[repo_name]
+
 	def __iter__(self):
 		for repo_name in self.prepos_order:
 			yield self.prepos[repo_name]


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 21:47 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 21:47 UTC (permalink / raw
  To: gentoo-commits

commit:     c0ae3fb065c21ca857a3f51096adf174570b761b
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 21:45:31 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 21:45:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0ae3fb0

portage.repository.config.RepoConfigLoader: Fix __delitem__() and unimplement __setitem__().

---
 pym/portage/repository/config.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0a2dd00..3d88f48 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -784,13 +784,23 @@ class RepoConfigLoader(object):
 		return self.prepos[self.get_name_for_location(location)]
 
 	def __setitem__(self, repo_name, repo):
-		self.prepos[repo_name] = repo
+		# self.prepos[repo_name] = repo
+		raise NotImplementedError
 
 	def __getitem__(self, repo_name):
 		return self.prepos[repo_name]
 
 	def __delitem__(self, repo_name):
+		location = self.prepos[repo_name].location
 		del self.prepos[repo_name]
+		if repo_name in self.prepos_order:
+			self.prepos_order.remove(repo_name)
+		for k, v in self.location_map.copy().items():
+			if v == repo_name:
+				del self.location_map[k]
+		if repo_name in self.treemap:
+			del self.treemap[repo_name]
+		self._repo_location_list = tuple(x for x in self._repo_location_list if x != location)
 
 	def __iter__(self):
 		for repo_name in self.prepos_order:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 22:03 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e2130cb7d85c62070a7f8dd4cc1eac848aa126a8
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 22:02:39 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 22:02:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e2130cb7

portage.repository.config.RepoConfigLoader: Add __contains__().

---
 pym/portage/repository/config.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 3d88f48..1923b7e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -806,6 +806,9 @@ class RepoConfigLoader(object):
 		for repo_name in self.prepos_order:
 			yield self.prepos[repo_name]
 
+	def __contains__(self, repo_name):
+		return repo_name in self.prepos
+
 def load_repository_config(settings):
 	#~ repoconfigpaths = [os.path.join(settings.global_config_path, "repos.conf")]
 	repoconfigpaths = []


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-24 23:42 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-24 23:42 UTC (permalink / raw
  To: gentoo-commits

commit:     7f816d02c47b6b9c33a9e793e288f52045544bf6
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Jun 24 23:42:37 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Mon Jun 24 23:42:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7f816d02

portage.repository.config.RepoConfigLoader: Support io.StringIO in paths argument.

---
 pym/portage/repository/config.py | 45 ++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1923b7e..896527a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -32,6 +32,9 @@ from portage import _unicode_encode
 from portage import _encodings
 from portage import manifest
 
+if sys.hexversion >= 0x3000000:
+	basestring = str
+
 # Characters prohibited by repoman's file.name check.
 _invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+:/]')
 
@@ -473,24 +476,30 @@ class RepoConfigLoader(object):
 			source_kwarg = 'filename'
 
 		for p in paths:
-			f = None
-			try:
-				f = io.open(_unicode_encode(p,
-					encoding=_encodings['fs'], errors='strict'),
-					mode='r', encoding=_encodings['repo.content'],
-					errors='replace')
-			except EnvironmentError:
-				pass
+			if isinstance(p, basestring):
+				f = None
+				try:
+					f = io.open(_unicode_encode(p,
+						encoding=_encodings['fs'], errors='strict'),
+						mode='r', encoding=_encodings['repo.content'],
+						errors='replace')
+				except EnvironmentError:
+					pass
+				else:
+					# The 'source' keyword argument is needed since
+					# otherwise ConfigParsier may throw a TypeError because
+					# it assumes that f.name is a native string rather
+					# than binary when constructing error messages.
+					kwargs = {source_kwarg: p}
+					read_file(f, **portage._native_kwargs(kwargs))
+				finally:
+					if f is not None:
+						f.close()
+			elif isinstance(p, io.StringIO):
+				kwargs = {source_kwarg: "<io.StringIO>"}
+				read_file(p, **portage._native_kwargs(kwargs))
 			else:
-				# The 'source' keyword argument is needed since
-				# otherwise ConfigParsier may throw a TypeError because
-				# it assumes that f.name is a native string rather
-				# than binary when constructing error messages.
-				kwargs = {source_kwarg: p}
-				read_file(f, **portage._native_kwargs(kwargs))
-			finally:
-				if f is not None:
-					f.close()
+				raise TypeError("Unsupported type %r of element %r of 'paths' argument" % (type(p), p))
 
 		prepos['DEFAULT'] = RepoConfig("DEFAULT",
 			parser.defaults(), local_config=local_config)
@@ -574,7 +583,7 @@ class RepoConfigLoader(object):
 					if settings.local_config and paths:
 						writemsg_level(_("Location undefined for " \
 							"repository '%s' referenced in '%s'\n") % \
-							(repo.name, paths[0]),
+							(repo.name, (paths if len(paths) > 1 else paths[0])),
 							level=logging.ERROR, noiselevel=-1)
 					del prepos[repo_name]
 			else:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-26  3:32 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-06-26  3:32 UTC (permalink / raw
  To: gentoo-commits

commit:     95fe42882c5d53798c9f6ecc7633229efd74a965
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Jun 26 03:31:43 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Wed Jun 26 03:31:43 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=95fe4288

Update comments.

---
 pym/portage/repository/config.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 896527a..c0f2007 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -135,11 +135,13 @@ class RepoConfig(object):
 				priority = None
 		self.priority = priority
 
+		# Not implemented.
 		sync = repo_opts.get('sync')
 		if sync is not None:
 			sync = sync.strip()
 		self.sync = sync
 
+		# Not implemented.
 		format = repo_opts.get('format')
 		if format is not None:
 			format = format.strip()
@@ -486,9 +488,9 @@ class RepoConfigLoader(object):
 				except EnvironmentError:
 					pass
 				else:
-					# The 'source' keyword argument is needed since
-					# otherwise ConfigParsier may throw a TypeError because
-					# it assumes that f.name is a native string rather
+					# The 'source' keyword argument is needed since otherwise
+					# ConfigParser in Python <3.3.3 may throw a TypeError
+					# because it assumes that f.name is a native string rather
 					# than binary when constructing error messages.
 					kwargs = {source_kwarg: p}
 					read_file(f, **portage._native_kwargs(kwargs))


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-06-28  1:54 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-06-28  1:54 UTC (permalink / raw
  To: gentoo-commits

commit:     f1181281ba1be9181fa65238f91661625a1432bd
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 28 01:54:20 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 01:54:20 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f1181281

RepoConfigLoader: support repos.conf directory

---
 pym/portage/repository/config.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index c0f2007..fded7bd 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -24,7 +24,7 @@ from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
 from portage.eapi import eapi_allows_directories_on_profile_level_and_repository_level
 from portage.env.loaders import KeyValuePairFileLoader
 from portage.util import (normalize_path, read_corresponding_eapi_file, shlex_split,
-	stack_lists, writemsg, writemsg_level)
+	stack_lists, writemsg, writemsg_level, _recursive_file_list)
 from portage.util._path import exists_raise_eaccess, isdir_raise_eaccess
 from portage.localization import _
 from portage import _unicode_decode
@@ -477,8 +477,15 @@ class RepoConfigLoader(object):
 			read_file = parser.readfp
 			source_kwarg = 'filename'
 
+		recursive_paths = []
 		for p in paths:
 			if isinstance(p, basestring):
+				recursive_paths.extend(_recursive_file_list(p))
+			else:
+				recursive_paths.append(p)
+
+		for p in recursive_paths:
+			if isinstance(p, basestring):
 				f = None
 				try:
 					f = io.open(_unicode_encode(p,


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-14  7:49 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14  7:49 UTC (permalink / raw
  To: gentoo-commits

commit:     c3a62e0150c85c1e27ae32a79b107b57322fa322
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 07:48:29 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 07:48:29 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c3a62e01

portage.settings.repositories.config_string(): Improve format of returned string.

---
 pym/portage/repository/config.py | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 676e7e3..65c43d6 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -832,19 +832,24 @@ class RepoConfigLoader(object):
 		return repo_name in self.prepos
 
 	def config_string(self):
+		str_or_int_keys = ("format", "location", "main_repo", "priority", "sync")
+		tuple_keys = ("aliases", "eclass_overrides")
+		repo_config_tuple_keys = ("masters",)
+		keys = str_or_int_keys + tuple_keys + repo_config_tuple_keys
 		config_string = ""
-		for repo_name, repo in self.prepos.items():
-			config_string += "[%s]\n" % repo_name
-			for key in ("format", "location", "main_repo", "priority", "sync"):
-				if getattr(repo, key) is not None:
-					config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
-			for key in ("aliases", "eclass_overrides"):
-				if getattr(repo, key) is not None:
-					config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
-			for key in ("masters",):
+		for repo_name, repo in sorted(self.prepos.items()):
+			config_string += "\n[%s]\n" % repo_name
+			for key in sorted(keys):
+				if key == "main_repo" and repo_name != "DEFAULT":
+					continue
 				if getattr(repo, key) is not None:
-					config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
-		return config_string
+					if key in str_or_int_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
+					elif key in tuple_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
+					elif key in repo_config_tuple_keys:
+						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
+		return config_string.lstrip("\n")
 
 def load_repository_config(settings, extra_files=None):
 	repoconfigpaths = []


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-14  7:57 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-14  7:57 UTC (permalink / raw
  To: gentoo-commits

commit:     2e43139c0d8b1b11c8c5ee09b21e1e5aacb346b0
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Jul 14 07:57:14 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sun Jul 14 07:57:14 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2e43139c

portage.repository.config.RepoConfigLoader.config_string(): Rename a variable.

---
 pym/portage/repository/config.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 65c43d6..8ded078 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -833,9 +833,9 @@ class RepoConfigLoader(object):
 
 	def config_string(self):
 		str_or_int_keys = ("format", "location", "main_repo", "priority", "sync")
-		tuple_keys = ("aliases", "eclass_overrides")
+		str_tuple_keys = ("aliases", "eclass_overrides")
 		repo_config_tuple_keys = ("masters",)
-		keys = str_or_int_keys + tuple_keys + repo_config_tuple_keys
+		keys = str_or_int_keys + str_tuple_keys + repo_config_tuple_keys
 		config_string = ""
 		for repo_name, repo in sorted(self.prepos.items()):
 			config_string += "\n[%s]\n" % repo_name
@@ -845,7 +845,7 @@ class RepoConfigLoader(object):
 				if getattr(repo, key) is not None:
 					if key in str_or_int_keys:
 						config_string += "%s = %s\n" % (key.replace("_", "-"), getattr(repo, key))
-					elif key in tuple_keys:
+					elif key in str_tuple_keys:
 						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(getattr(repo, key)))
 					elif key in repo_config_tuple_keys:
 						config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-23  4:42 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-23  4:42 UTC (permalink / raw
  To: gentoo-commits

commit:     eec775d6d1ee8b0d4a80ed0ef257a7b47dcf369b
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 04:42:22 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 04:42:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eec775d6

RepoConfigLoader: PORTDIR/repos.conf interaction

---
 pym/portage/repository/config.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 232e9cb..e6d37a8 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -438,7 +438,9 @@ class RepoConfigLoader(object):
 					if repos_conf_opts is not None:
 						# Selectively copy only the attributes which
 						# repos.conf is allowed to override.
-						for k in ('aliases', 'eclass_overrides', 'masters', 'priority'):
+						for k in ('aliases', 'eclass_overrides', 'masters',
+							'priority', 'sync_cvs_repo', 'sync_type',
+							'sync_uri'):
 							v = getattr(repos_conf_opts, k, None)
 							if v is not None:
 								setattr(repo, k, v)
@@ -480,7 +482,7 @@ class RepoConfigLoader(object):
 		return portdir
 
 	@staticmethod
-	def _parse(paths, prepos, ignored_map, ignored_location_map, local_config):
+	def _parse(paths, prepos, ignored_map, ignored_location_map, local_config, portdir):
 		"""Parse files in paths to load config"""
 		parser = SafeConfigParser()
 
@@ -536,6 +538,14 @@ class RepoConfigLoader(object):
 
 			repo = RepoConfig(sname, optdict, local_config=local_config)
 
+			if repo.location and \
+				not exists_raise_eaccess(repo.location) and \
+				prepos['DEFAULT'].main_repo == repo.name and \
+				portdir and exists_raise_eaccess(portdir):
+				optdict['location'] = portdir
+				print optdict
+				repo = RepoConfig(sname, optdict, local_config=local_config)
+
 			if repo.name != sname and not portage._sync_disabled_warnings:
 				writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
 					(sname, repo.name), level=logging.ERROR, noiselevel=-1)
@@ -593,7 +603,8 @@ class RepoConfigLoader(object):
 
 		try:
 			self._parse(paths, prepos, ignored_map,
-				ignored_location_map, settings.local_config)
+				ignored_location_map, settings.local_config,
+				portdir)
 		except ConfigParserError as e:
 			writemsg(
 				_("!!! Error while reading repo config file: %s\n") % e,


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-23  4:45 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-23  4:45 UTC (permalink / raw
  To: gentoo-commits

commit:     647e7aca5eb8d42f0213f9a4ab4d6303bcd94340
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 04:45:13 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 04:45:13 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=647e7aca

Remove stray print from last commit.

---
 pym/portage/repository/config.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index e6d37a8..5d01004 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -543,7 +543,6 @@ class RepoConfigLoader(object):
 				prepos['DEFAULT'].main_repo == repo.name and \
 				portdir and exists_raise_eaccess(portdir):
 				optdict['location'] = portdir
-				print optdict
 				repo = RepoConfig(sname, optdict, local_config=local_config)
 
 			if repo.name != sname and not portage._sync_disabled_warnings:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-23  5:56 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-23  5:56 UTC (permalink / raw
  To: gentoo-commits

commit:     ee81069671fe736851eef827340dc62c15863512
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 23 05:56:00 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 05:56:00 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ee810696

Delay validation of repos.conf locations/names.

For backward compatibility with locations set via PORTDIR and
PORTDIR_OVERLAY, delay validation of the location and repo.name
until after PORTDIR and PORTDIR_OVERLAY have been processed.

---
 pym/portage/repository/config.py | 64 ++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 38 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5d01004..1bfe2f8 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -389,7 +389,7 @@ class RepoConfigLoader(object):
 
 	@staticmethod
 	def _add_repositories(portdir, portdir_overlay, prepos,
-		ignored_map, ignored_location_map, local_config):
+		ignored_map, ignored_location_map, local_config, default_portdir):
 		"""Add overlays in PORTDIR_OVERLAY as repositories"""
 		overlays = []
 		portdir_orig = None
@@ -447,7 +447,10 @@ class RepoConfigLoader(object):
 
 					if repo.name in prepos:
 						old_location = prepos[repo.name].location
-						if old_location is not None and old_location != repo.location:
+						if old_location is not None and \
+							old_location != repo.location and \
+							not (old_location == default_portdir and
+							not exists_raise_eaccess(old_location)):
 							ignored_map.setdefault(repo.name, []).append(old_location)
 							ignored_location_map[old_location] = repo.name
 							if old_location == portdir:
@@ -465,16 +468,6 @@ class RepoConfigLoader(object):
 
 					prepos[repo.name] = repo
 				else:
-					if base_priority == 0 and ov == '/usr/portage':
-						# Suppress warnings for the make.globals
-						# PORTDIR setting if we have an existing
-						# main-repo defined in repos.conf.
-						main_repo = prepos['DEFAULT'].main_repo
-						if main_repo is not None and main_repo in prepos:
-							main_repo_loc = prepos[main_repo].location
-							if main_repo_loc and \
-								isdir_raise_eaccess(main_repo_loc):
-								continue
 
 					if not portage._sync_disabled_warnings:
 						writemsg(_("!!! Invalid PORTDIR_OVERLAY (not a dir): '%s'\n") % ov, noiselevel=-1)
@@ -538,23 +531,6 @@ class RepoConfigLoader(object):
 
 			repo = RepoConfig(sname, optdict, local_config=local_config)
 
-			if repo.location and \
-				not exists_raise_eaccess(repo.location) and \
-				prepos['DEFAULT'].main_repo == repo.name and \
-				portdir and exists_raise_eaccess(portdir):
-				optdict['location'] = portdir
-				repo = RepoConfig(sname, optdict, local_config=local_config)
-
-			if repo.name != sname and not portage._sync_disabled_warnings:
-				writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
-					(sname, repo.name), level=logging.ERROR, noiselevel=-1)
-				continue
-
-			if repo.location and not exists_raise_eaccess(repo.location) and not portage._sync_disabled_warnings:
-				writemsg_level("!!! %s\n" % _("Repository '%s' has location attribute set to nonexistent directory: '%s'") %
-					(sname, repo.location), level=logging.ERROR, noiselevel=-1)
-				continue
-
 			if repo.sync_type is not None and repo.sync_uri is None:
 				writemsg_level("!!! %s\n" % _("Repository '%s' has sync-type attribute, but is missing sync-uri attribute") %
 					sname, level=logging.ERROR, noiselevel=-1)
@@ -575,14 +551,10 @@ class RepoConfigLoader(object):
 					sname, level=logging.ERROR, noiselevel=-1)
 				continue
 
-			if repo.name in prepos:
-				old_location = prepos[repo.name].location
-				if old_location is not None and repo.location is not None and old_location != repo.location:
-					ignored_map.setdefault(repo.name, []).append(old_location)
-					ignored_location_map[old_location] = repo.name
-				prepos[repo.name].update(repo)
-			else:
-				prepos[repo.name] = repo
+			# For backward compatibility with locations set via PORTDIR and
+			# PORTDIR_OVERLAY, delay validation of the location and repo.name
+			# until after PORTDIR and PORTDIR_OVERLAY have been processed.
+			prepos[sname] = repo
 
 	def __init__(self, paths, settings):
 		"""Load config from files in paths"""
@@ -619,10 +591,14 @@ class RepoConfigLoader(object):
 			ignored_map.clear()
 			ignored_location_map.clear()
 
+		default_portdir = os.path.join(os.sep,
+			settings['EPREFIX'].lstrip(os.sep), 'usr', 'portage')
+
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.
 		portdir = self._add_repositories(portdir, portdir_overlay, prepos,
-			ignored_map, ignored_location_map, settings.local_config)
+			ignored_map, ignored_location_map, settings.local_config,
+			default_portdir)
 		if portdir and portdir.strip():
 			portdir = os.path.realpath(portdir)
 
@@ -646,6 +622,18 @@ class RepoConfigLoader(object):
 							level=logging.ERROR, noiselevel=-1)
 					del prepos[repo_name]
 			else:
+				if repo.name != repo_name and not portage._sync_disabled_warnings:
+					writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
+						(repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
+					del prepos[repo_name]
+					continue
+
+				if repo.location and not exists_raise_eaccess(repo.location) and not portage._sync_disabled_warnings:
+					writemsg_level("!!! %s\n" % _("Repository '%s' has location attribute set to nonexistent directory: '%s'") %
+						(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
+					del prepos[repo_name]
+					continue
+
 				location_map[repo.location] = repo_name
 				treemap[repo_name] = repo.location
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-23 21:53 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-23 21:53 UTC (permalink / raw
  To: gentoo-commits

commit:     ddf615015eea5d9800cce027708bfd3035c6472c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jul 23 21:52:47 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Tue Jul 23 21:52:47 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ddf61501

Add warning for missing masters attribute in layout.conf.

---
 pym/portage/repository/config.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 1bfe2f8..68e8121 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -197,7 +197,6 @@ class RepoConfig(object):
 
 		# Parse layout.conf.
 		if self.location:
-			layout_filename = os.path.join(self.location, "metadata", "layout.conf")
 			layout_data = parse_layout_conf(self.location, self.name)[0]
 
 			# layout.conf masters may be overridden here if we have a masters
@@ -767,6 +766,17 @@ class RepoConfigLoader(object):
 					eclass_db.append(tree_db)
 			repo.eclass_db = eclass_db
 
+		for repo_name, repo in prepos.items():
+			if repo_name == "DEFAULT":
+				continue
+
+			if parse_layout_conf(repo.location, repo_name)[0]["masters"] is None and self.mainRepo() and \
+				repo_name != self.mainRepo().name and not portage._sync_disabled_warnings:
+				writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
+					(repo_name, os.path.join(repo.location, "metadata", "layout.conf")) +
+					"!!! %s\n" % _("Set 'masters = %s' in this file for future compatibility") %
+					self.mainRepo().name, level=logging.WARNING, noiselevel=-1)
+
 		self._prepos_changed = True
 		self._repo_location_list = []
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-24 20:42 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-24 20:42 UTC (permalink / raw
  To: gentoo-commits

commit:     0bc0417ef698790dfed8fe7c256b19ad946392c1
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 24 20:37:59 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Jul 24 20:37:59 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0bc0417e

Avoid redundant parse_layout_conf() calls.

---
 pym/portage/repository/config.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index de471e9..8b9ed2c 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -84,7 +84,7 @@ class RepoConfig(object):
 		'name', 'portage1_profiles', 'portage1_profiles_compat', 'priority',
 		'profile_formats', 'sign_commit', 'sign_manifest', 'sync_cvs_repo',
 		'sync_type', 'sync_uri', 'thin_manifest', 'update_changelog',
-		'user_location', '_eapis_banned', '_eapis_deprecated')
+		'user_location', '_eapis_banned', '_eapis_deprecated', '_masters_orig')
 
 	def __init__(self, name, repo_opts, local_config=True):
 		"""Build a RepoConfig with options in repo_opts
@@ -201,10 +201,12 @@ class RepoConfig(object):
 		self.portage1_profiles = True
 		self.portage1_profiles_compat = False
 		self.find_invalid_path_char = _find_invalid_path_char
+		self._masters_orig = None
 
 		# Parse layout.conf.
 		if self.location:
 			layout_data = parse_layout_conf(self.location, self.name)[0]
+			self._masters_orig = layout_data['masters']
 
 			# layout.conf masters may be overridden here if we have a masters
 			# setting from the user's repos.conf
@@ -776,7 +778,7 @@ class RepoConfigLoader(object):
 			if repo_name == "DEFAULT":
 				continue
 
-			if parse_layout_conf(repo.location, repo_name)[0]["masters"] is None and self.mainRepo() and \
+			if repo._masters_orig is None and self.mainRepo() and \
 				repo_name != self.mainRepo().name and not portage._sync_disabled_warnings:
 				writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
 					(repo_name, os.path.join(repo.location, "metadata", "layout.conf")) +


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-25 18:25 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-25 18:25 UTC (permalink / raw
  To: gentoo-commits

commit:     eb7bb7d4e08ed32502864a20c678c7fc4e1f1277
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Jul 25 18:25:05 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Jul 25 18:25:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eb7bb7d4

Print more consistent error messages for entries in repos.conf.

---
 pym/portage/repository/config.py | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 8b9ed2c..a79de4a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -623,23 +623,32 @@ class RepoConfigLoader(object):
 				if repo_name != 'DEFAULT':
 					# Skip this warning for repoman (bug #474578).
 					if settings.local_config and paths:
-						writemsg_level(_("Location undefined for " \
-							"repository '%s' referenced in '%s'\n") % \
-							(repo.name, (paths if len(paths) > 1 else paths[0])),
-							level=logging.ERROR, noiselevel=-1)
-					del prepos[repo_name]
-			else:
-				if repo.name != repo_name and not portage._sync_disabled_warnings:
-					writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
-						(repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
+						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf is missing location attribute") %
+							repo.name, level=logging.ERROR, noiselevel=-1)
 					del prepos[repo_name]
 					continue
+			else:
+				if not portage._sync_disabled_warnings:
+					if repo.location and not isdir_raise_eaccess(repo.location):
+						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has location attribute set "
+							"to nonexistent directory: '%s'") %
+							(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
+						del prepos[repo_name]
+						continue
 
-				if repo.location and not exists_raise_eaccess(repo.location) and not portage._sync_disabled_warnings:
-					writemsg_level("!!! %s\n" % _("Repository '%s' has location attribute set to nonexistent directory: '%s'") %
-						(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
-					del prepos[repo_name]
-					continue
+					if repo.missing_repo_name:
+						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf refers to repository "
+							"without repository name set in '%s'") %
+							(repo_name, os.path.join(repo.location, REPO_NAME_LOC)), level=logging.ERROR, noiselevel=-1)
+						del prepos[repo_name]
+						continue
+
+					if repo.name != repo_name:
+						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has name different "
+							"from repository name '%s' set inside repository") %
+							(repo_name, repo.name), level=logging.ERROR, noiselevel=-1)
+						del prepos[repo_name]
+						continue
 
 				location_map[repo.location] = repo_name
 				treemap[repo_name] = repo.location


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-25 18:46 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-25 18:46 UTC (permalink / raw
  To: gentoo-commits

commit:     d27baf8b2b5c49bcf9c16256ff34d5a51a1bd54d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Jul 25 18:44:39 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Thu Jul 25 18:44:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d27baf8b

Disable an error for entries from PORTDIR_OVERLAY.

---
 pym/portage/repository/config.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a79de4a..919a9d6 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -629,14 +629,16 @@ class RepoConfigLoader(object):
 					continue
 			else:
 				if not portage._sync_disabled_warnings:
-					if repo.location and not isdir_raise_eaccess(repo.location):
+					if not isdir_raise_eaccess(repo.location):
 						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has location attribute set "
 							"to nonexistent directory: '%s'") %
 							(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
 						del prepos[repo_name]
 						continue
 
-					if repo.missing_repo_name:
+					# After removing support for PORTDIR_OVERLAY, the following check can be:
+					# if repo.missing_repo_name:
+					if repo.missing_repo_name and repo.name != repo_name:
 						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf refers to repository "
 							"without repository name set in '%s'") %
 							(repo_name, os.path.join(repo.location, REPO_NAME_LOC)), level=logging.ERROR, noiselevel=-1)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-25 19:55 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-25 19:55 UTC (permalink / raw
  To: gentoo-commits

commit:     73188d23c68989539a913716bb8a4132d2c43316
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 19:54:49 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 19:54:49 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=73188d23

RepoConfig: backward compat SYNC for mirrorselect

This restores SYNC support which was removed in commit
47e8d22dabf2197193c8f133698fb967afa560f4.

---
 pym/portage/repository/config.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 919a9d6..57cc3a3 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -575,9 +575,11 @@ class RepoConfigLoader(object):
 		if "PORTAGE_REPOSITORIES" in settings:
 			portdir = ""
 			portdir_overlay = ""
+			portdir_sync = ""
 		else:
 			portdir = settings.get("PORTDIR", "")
 			portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
+			portdir_sync = settings.get("SYNC", "")
 
 		try:
 			self._parse(paths, prepos, ignored_map,
@@ -697,6 +699,12 @@ class RepoConfigLoader(object):
 			# This happens if main-repo has been set in repos.conf.
 			prepos[main_repo].priority = -1000
 
+		# Backward compatible SYNC support for mirrorselect.
+		if portdir_sync and main_repo is not None:
+			if portdir_sync.startswith("rsync://"):
+				prepos[main_repo].sync_uri = portdir_sync
+				prepos[main_repo].sync_type = "rsync"
+
 		# Include repo.name in sort key, for predictable sorting
 		# even when priorities are equal.
 		prepos_order = sorted(prepos.items(),


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-25 21:41 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-25 21:41 UTC (permalink / raw
  To: gentoo-commits

commit:     bbe0fd57a31ebd9b900f1774b5606f2b9923c5e9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 21:41:04 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 21:41:04 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbe0fd57

Fix alias handling in missing masters warning.

---
 pym/portage/repository/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 57cc3a3..7620c5f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -798,9 +798,9 @@ class RepoConfigLoader(object):
 				continue
 
 			if repo._masters_orig is None and self.mainRepo() and \
-				repo_name != self.mainRepo().name and not portage._sync_disabled_warnings:
+				repo.name != self.mainRepo().name and not portage._sync_disabled_warnings:
 				writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
-					(repo_name, os.path.join(repo.location, "metadata", "layout.conf")) +
+					(repo.name, os.path.join(repo.location, "metadata", "layout.conf")) +
 					"!!! %s\n" % _("Set 'masters = %s' in this file for future compatibility") %
 					self.mainRepo().name, level=logging.WARNING, noiselevel=-1)
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-07-29 17:23 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-07-29 17:23 UTC (permalink / raw
  To: gentoo-commits

commit:     a3a1a20a1378e423486d41414857a25f9bec1c66
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 29 17:23:02 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 17:23:02 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3a1a20a

Suppress duplicate repo warning for bug #478544.

---
 pym/portage/repository/config.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 7620c5f..5c37da3 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -453,11 +453,13 @@ class RepoConfigLoader(object):
 								setattr(repo, k, v)
 
 					if repo.name in prepos:
+						# Silently ignore when PORTDIR overrides the location
+						# setting from the default repos.conf (bug #478544).
 						old_location = prepos[repo.name].location
 						if old_location is not None and \
 							old_location != repo.location and \
-							not (old_location == default_portdir and
-							not exists_raise_eaccess(old_location)):
+							not (base_priority == 0 and
+							old_location == default_portdir):
 							ignored_map.setdefault(repo.name, []).append(old_location)
 							ignored_location_map[old_location] = repo.name
 							if old_location == portdir:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-08-08 16:04 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-08-08 16:04 UTC (permalink / raw
  To: gentoo-commits

commit:     e0a7e57e8d2cb7c14b84612c7d90b229c103616a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  8 16:04:36 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug  8 16:04:36 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e0a7e57e

RepoConfigLoader: handle main_repo in __delitem__

This will fix bug #480254.

---
 pym/portage/repository/config.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5c37da3..7b49eea 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -886,6 +886,8 @@ class RepoConfigLoader(object):
 		return self.prepos[repo_name]
 
 	def __delitem__(self, repo_name):
+		if repo_name == self.prepos['DEFAULT'].main_repo:
+			self.prepos['DEFAULT'].main_repo = None
 		location = self.prepos[repo_name].location
 		del self.prepos[repo_name]
 		if repo_name in self.prepos_order:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-08-22 16:22 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-08-22 16:22 UTC (permalink / raw
  To: gentoo-commits

commit:     1a6374733c62b1d131a0f2c9da6190364df6e3df
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 16:22:22 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 16:22:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a637473

Skip main-repo warn if PORTDIR unset, bug #470006

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 7b49eea..4c4a2eb 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -694,7 +694,7 @@ class RepoConfigLoader(object):
 				prepos['DEFAULT'].main_repo = main_repo
 			else:
 				prepos['DEFAULT'].main_repo = None
-				if not portage._sync_disabled_warnings:
+				if portdir and not portage._sync_disabled_warnings:
 					writemsg(_("!!! main-repo not set in DEFAULT and PORTDIR is empty.\n"), noiselevel=-1)
 
 		if main_repo is not None and prepos[main_repo].priority is None:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-13  9:14 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-09-13  9:14 UTC (permalink / raw
  To: gentoo-commits

commit:     1e8c9a72279eeec615a3c25d3fef360888528b8b
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Sep 13 09:11:22 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Fri Sep 13 09:11:22 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1e8c9a72

Bug #484730: In sync mode, use repos.conf section name when repo_name file is missing.

---
 pym/portage/repository/config.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 4c4a2eb..6ab3065 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -176,11 +176,11 @@ class RepoConfig(object):
 		missing = True
 		self.name = name
 		if self.location is not None:
-			if os.path.isdir(location):
-				eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC))
-				self.name, missing = self._read_valid_repo_name(self.location)
-			else:
-				missing = not portage._sync_disabled_warnings
+			eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC))
+			self.name, missing = self._read_valid_repo_name(self.location)
+			if missing and portage._sync_disabled_warnings:
+				self.name = name
+				missing = False
 		elif name == "DEFAULT":
 			missing = False
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-15 10:58 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-09-15 10:58 UTC (permalink / raw
  To: gentoo-commits

commit:     d11f39f12f7f940539d25bb5aef20fa1f1371fa4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 15 10:57:55 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 10:57:55 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d11f39f1

emerge-webrsync: fix bug #484950

---
 pym/portage/repository/config.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 6ab3065..b5289d9 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -178,9 +178,14 @@ class RepoConfig(object):
 		if self.location is not None:
 			eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC))
 			self.name, missing = self._read_valid_repo_name(self.location)
-			if missing and portage._sync_disabled_warnings:
+			if missing:
+				# The name from repos.conf has to be used here for
+				# things like emerge-webrsync to work when the repo
+				# is empty (bug #484950).
 				self.name = name
-				missing = False
+				if portage._sync_disabled_warnings:
+					missing = False
+
 		elif name == "DEFAULT":
 			missing = False
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-15 14:10 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-09-15 14:10 UTC (permalink / raw
  To: gentoo-commits

commit:     9e1d8136e644281729e278b68e6272ab2954ee6f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 15 14:08:33 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 15 14:08:33 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9e1d8136

RepoConfig: fix bug #485006

---
 pym/portage/repository/config.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index b5289d9..bb63b1a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -182,7 +182,8 @@ class RepoConfig(object):
 				# The name from repos.conf has to be used here for
 				# things like emerge-webrsync to work when the repo
 				# is empty (bug #484950).
-				self.name = name
+				if name is not None:
+					self.name = name
 				if portage._sync_disabled_warnings:
 					missing = False
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-23 20:43 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-09-23 20:43 UTC (permalink / raw
  To: gentoo-commits

commit:     bf55e670670e0f6d10c6c7402b6738549fdd1c57
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 20:43:31 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 20:43:31 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bf55e670

emerge-webrsync: handle empty dir, bug #484950

---
 pym/portage/repository/config.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index bb63b1a..b14eeb7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -443,7 +443,10 @@ class RepoConfigLoader(object):
 			#overlay priority is negative because we want them to be looked before any other repo
 			base_priority = 0
 			for ov in overlays:
-				if isdir_raise_eaccess(ov):
+				# Ignore missing directory for 'gentoo' so that
+				# first sync with emerge-webrsync is possible.
+				if isdir_raise_eaccess(ov) or \
+					(base_priority == 0 and ov is portdir):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts, local_config=local_config)
@@ -643,6 +646,10 @@ class RepoConfigLoader(object):
 						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has location attribute set "
 							"to nonexistent directory: '%s'") %
 							(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
+
+					# Ignore missing directory for 'gentoo' so that
+					# first sync with emerge-webrsync is possible.
+					if repo.name != 'gentoo':
 						del prepos[repo_name]
 						continue
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-23 20:44 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-09-23 20:44 UTC (permalink / raw
  To: gentoo-commits

commit:     923f912d7c5ade8b5b18f23f1cd12add08f73c21
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 20:44:34 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 20:44:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=923f912d

emerge-webrsync: handle missing dir, bug #484950

---
 pym/portage/repository/config.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index bb63b1a..b14eeb7 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -443,7 +443,10 @@ class RepoConfigLoader(object):
 			#overlay priority is negative because we want them to be looked before any other repo
 			base_priority = 0
 			for ov in overlays:
-				if isdir_raise_eaccess(ov):
+				# Ignore missing directory for 'gentoo' so that
+				# first sync with emerge-webrsync is possible.
+				if isdir_raise_eaccess(ov) or \
+					(base_priority == 0 and ov is portdir):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts, local_config=local_config)
@@ -643,6 +646,10 @@ class RepoConfigLoader(object):
 						writemsg_level("!!! %s\n" % _("Section '%s' in repos.conf has location attribute set "
 							"to nonexistent directory: '%s'") %
 							(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
+
+					# Ignore missing directory for 'gentoo' so that
+					# first sync with emerge-webrsync is possible.
+					if repo.name != 'gentoo':
 						del prepos[repo_name]
 						continue
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2013-09-23 20:59 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2013-09-23 20:59 UTC (permalink / raw
  To: gentoo-commits

commit:     feefac9fe8d2861472a043f4820058759fb037c4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 20:59:21 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 20:59:21 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=feefac9f

RepoConfigLoader: Fix indent

Indent was wrong in commit 923f912d7c5ade8b5b18f23f1cd12add08f73c21.

---
 pym/portage/repository/config.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index b14eeb7..0d6edf4 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -647,11 +647,11 @@ class RepoConfigLoader(object):
 							"to nonexistent directory: '%s'") %
 							(repo_name, repo.location), level=logging.ERROR, noiselevel=-1)
 
-					# Ignore missing directory for 'gentoo' so that
-					# first sync with emerge-webrsync is possible.
-					if repo.name != 'gentoo':
-						del prepos[repo_name]
-						continue
+						# Ignore missing directory for 'gentoo' so that
+						# first sync with emerge-webrsync is possible.
+						if repo.name != 'gentoo':
+							del prepos[repo_name]
+							continue
 
 					# After removing support for PORTDIR_OVERLAY, the following check can be:
 					# if repo.missing_repo_name:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2014-02-09  7:27 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-02-09  7:27 UTC (permalink / raw
  To: gentoo-commits

commit:     608d9a76b957ab1b245a331d6b793774708006dd
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun Feb  9 07:23:41 2014 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Sun Feb  9 07:23:41 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=608d9a76

portage.repository.config.RepoConfigLoader.config_string(): Always include DEFAULT section
at the beginning of returned string for better readability.

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index e0d3173..952912e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -940,7 +940,7 @@ class RepoConfigLoader(object):
 		repo_config_tuple_attrs = tuple(_masters_attributes.keys())
 		attrs = str_or_int_attrs + str_tuple_attrs + repo_config_tuple_attrs
 		config_string = ""
-		for repo_name, repo in sorted(self.prepos.items()):
+		for repo_name, repo in sorted(self.prepos.items(), key=lambda x: (x[0] != "DEFAULT", x[0])):
 			config_string += "\n[%s]\n" % repo_name
 			for attr in sorted(attrs):
 				underscorized_attr = attr.replace("-", "_").replace(".", "_")


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
  2014-12-04 20:04 [gentoo-commits] proj/portage:plugin-sync " Brian Dolbec
@ 2014-12-04 20:16 ` Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2014-12-04 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     567e447ae9290a15db37ac6e55f5ac2f5b728ab0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 22 11:21:04 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec  4 19:56:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=567e447a

RepoConfigLoader.config_string: include auto-sync

---
 pym/portage/repository/config.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 2367e26..d37ce6a 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -913,7 +913,9 @@ class RepoConfigLoader(object):
 		return repo_name in self.prepos
 
 	def config_string(self):
-		str_or_int_keys = ("format", "location", "main_repo", "priority", "sync_cvs_repo", "sync_type", "sync_uri")
+		str_or_int_keys = ("auto_sync", "format", "location",
+			"main_repo", "priority", "sync_cvs_repo",
+			"sync_type", "sync_uri")
 		str_tuple_keys = ("aliases", "eclass_overrides", "force")
 		repo_config_tuple_keys = ("masters",)
 		keys = str_or_int_keys + str_tuple_keys + repo_config_tuple_keys


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-02-02 18:35 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-02-02 18:35 UTC (permalink / raw
  To: gentoo-commits

commit:     d88cf4746c0fe891087a79d630e9d8181c7cbd04
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  2 18:30:31 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Feb  2 18:34:02 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d88cf474

portage/repository/config.py: Deprecate make.conf SYNC variable bug 538512

Newer mirrorselect modifies repos.conf, no need for this anymore.

---
 pym/portage/repository/config.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index f80742e..6d79452 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -606,10 +606,12 @@ class RepoConfigLoader(object):
 		if "PORTAGE_REPOSITORIES" in settings:
 			portdir = ""
 			portdir_overlay = ""
+			# depercated portdir_sync
 			portdir_sync = ""
 		else:
 			portdir = settings.get("PORTDIR", "")
 			portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
+			# depercated portdir_sync
 			portdir_sync = settings.get("SYNC", "")
 
 		try:
@@ -734,11 +736,15 @@ class RepoConfigLoader(object):
 			# This happens if main-repo has been set in repos.conf.
 			prepos[main_repo].priority = -1000
 
-		# Backward compatible SYNC support for mirrorselect.
+		# DEPRECATED Backward compatible SYNC support for old mirrorselect.
+		# Feb. 2, 2015.  Version 2.0.16
 		if portdir_sync and main_repo is not None:
-			if portdir_sync.startswith("rsync://"):
-				prepos[main_repo].sync_uri = portdir_sync
-				prepos[main_repo].sync_type = "rsync"
+			writemsg(_("!!! SYNC setting found in make.conf.\n    "
+				"This setting is Deprecated and no longer used.  "
+				"Please ensure your 'sync-type' and 'sync-uri' are set correctly"
+				" in repos.conf/gentoo.conf\n"),
+				noiselevel=-1)
+
 
 		# Include repo.name in sort key, for predictable sorting
 		# even when priorities are equal.


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-02-02 18:50 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-02-02 18:50 UTC (permalink / raw
  To: gentoo-commits

commit:     fe02abc0b5d2dfa3f175ad5c022316b83af79f14
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  2 18:49:39 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Feb  2 18:49:39 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fe02abc0

portage/repository/config.py: typo s/depercated/deprecated

---
 pym/portage/repository/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 6d79452..9d14646 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -606,12 +606,12 @@ class RepoConfigLoader(object):
 		if "PORTAGE_REPOSITORIES" in settings:
 			portdir = ""
 			portdir_overlay = ""
-			# depercated portdir_sync
+			# deprecated portdir_sync
 			portdir_sync = ""
 		else:
 			portdir = settings.get("PORTDIR", "")
 			portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
-			# depercated portdir_sync
+			# deprecated portdir_sync
 			portdir_sync = settings.get("SYNC", "")
 
 		try:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-02-03 20:57 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-02-03 20:57 UTC (permalink / raw
  To: gentoo-commits

commit:     2664ec7472d34038c254d86b86f1d778bce99855
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  2 22:13:52 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Feb  2 22:13:52 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2664ec74

portage/repository/config.py: Update copyright

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 9d14646..fd0eea4 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-02-03 20:57 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-02-03 20:57 UTC (permalink / raw
  To: gentoo-commits

commit:     d75b8dc6929c44f0c63d5c1d00143a61efe9d1cd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 20:49:39 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Feb  3 20:49:39 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d75b8dc6

portage/repositoy/config.py: Create an auto-sync default of 'yes'

From the news item review comments,  the numerous 'sky is falling' type outcries due to the possibility of emerge --sync not actually syncing anything.
Although, this new default will likely cause some grief to eix-sync users whom have to re-edit eix's config to disable it from syncing overlays.

---
 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index fd0eea4..881890e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -172,7 +172,7 @@ class RepoConfig(object):
 			sync_user = sync_user.strip()
 		self.sync_user = sync_user or None
 
-		auto_sync = repo_opts.get('auto-sync')
+		auto_sync = repo_opts.get('auto-sync', 'yes')
 		if auto_sync is not None:
 			auto_sync = auto_sync.strip().lower()
 		self.auto_sync = auto_sync


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-02-09 21:36 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-02-09 21:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c2322b59bad72316e227c15d44d0976776d07414
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  9 21:35:28 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Feb  9 21:35:28 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2322b59

portage/repository/config.py: Tweak deprecation message as recommended

tw04l124 recommended the full filepath be output.
http://forums.gentoo.org/viewtopic-t-1010190.html?sid=20fa79230ace312c4ec31a43bbcb0cf3

---
 pym/portage/repository/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 881890e..a884156 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -737,12 +737,12 @@ class RepoConfigLoader(object):
 			prepos[main_repo].priority = -1000
 
 		# DEPRECATED Backward compatible SYNC support for old mirrorselect.
-		# Feb. 2, 2015.  Version 2.0.16
+		# Feb. 2, 2015.  Version 2.2.16
 		if portdir_sync and main_repo is not None:
 			writemsg(_("!!! SYNC setting found in make.conf.\n    "
 				"This setting is Deprecated and no longer used.  "
 				"Please ensure your 'sync-type' and 'sync-uri' are set correctly"
-				" in repos.conf/gentoo.conf\n"),
+				" in /etc/portage/repos.conf/gentoo.conf\n"),
 				noiselevel=-1)
 
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-05-21  4:09 Mike Frysinger
  0 siblings, 0 replies; 105+ messages in thread
From: Mike Frysinger @ 2015-05-21  4:09 UTC (permalink / raw
  To: gentoo-commits

commit:     585be4917f6d0381e4654bfb1b90d03005710467
Author:     Bertrand Simonnet <bsimonnet <AT> chromium <DOT> org>
AuthorDate: Fri Sep  5 12:40:02 2014 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu May 21 04:09:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=585be491

config: skip missing profiles/repo_name warning when using layout.conf:repo-name

The repo name is considered missing if there is no explicit "repo_name"
file.  But if it's set in layout.conf via repo-name, we can skip that.
Otherwise we end up with copy & paste spew.

 pym/portage/repository/config.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 05eedbe..b7c969d 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -253,6 +253,7 @@ class RepoConfig(object):
 				# useful when having two copies of the same repo enabled
 				# to avoid modifying profiles/repo_name in one of them
 				self.name = layout_data['repo-name']
+				self.missing_repo_name = False
 
 			for value in ('allow-missing-manifest',
 				'allow-provide-virtual', 'cache-formats',


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-07-14 21:31 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-07-14 21:31 UTC (permalink / raw
  To: gentoo-commits

commit:     5b697488f32640b0c73a26338be616559e871cc5
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 14 20:34:17 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 14 21:28:31 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5b697488

type error and logging param fixes

 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0b12100..68fee83 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -508,7 +508,7 @@ class RepoConfigLoader(object):
 							'force', 'masters', 'priority',
 							'sync_depth',
 							'sync_type', 'sync_umask', 'sync_uri', 'sync_user',
-							) + portage.sync.module_specific_options(repo, logging):
+							) + tuple(portage.sync.module_specific_options(repo)):
 							v = getattr(repos_conf_opts, k, None)
 							if v is not None:
 								setattr(repo, k, v)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-09-24 19:54 Brian Dolbec
  0 siblings, 0 replies; 105+ messages in thread
From: Brian Dolbec @ 2015-09-24 19:54 UTC (permalink / raw
  To: gentoo-commits

commit:     cda13bc9bb42ae1c91b317711365573a2d3695f3
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 24 19:44:54 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 19:46:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cda13bc9

repository/config.py: Fix propogation of module_specific_options (bug 561240)

module_specific_options were being read in and set correctly, but, 
module_specific_options were not being copied over in _add_repositories().
This is a left-over from the PORTDIR_OVERLAY setting we intend to deprecate.
This change copies all the options in one shot.
X-Gentoo Bug: 561240
X-Gentoo bug Url: https://bugs.gentoo.org/show_bug.cgi?id=561240
X-Gentoo Title: sys-apps/portage-2.2.21 ignores PORTAGE_RSYNC_EXTRA_OPTS

 pym/portage/repository/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index f80bee6..a90a994 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -508,7 +508,7 @@ class RepoConfigLoader(object):
 							'force', 'masters', 'priority',
 							'sync_depth',
 							'sync_type', 'sync_umask', 'sync_uri', 'sync_user',
-							) + tuple(portage.sync.module_specific_options(repo)):
+							'module_specific_options'):
 							v = getattr(repos_conf_opts, k, None)
 							if v is not None:
 								setattr(repo, k, v)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-11-23 20:41 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-23 20:41 UTC (permalink / raw
  To: gentoo-commits

commit:     c1a2714c5e5d6d3fdda5594c6e5997e769552185
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Nov 23 20:37:55 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Nov 23 20:37:55 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1a2714c

portage.repository.config.RepoConfigLoader._parse(): Delete unused ignored_map and ignored_location_map parametres.

 pym/portage/repository/config.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index ffb4544..2ba03f0 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -547,7 +547,7 @@ class RepoConfigLoader(object):
 		return portdir
 
 	@staticmethod
-	def _parse(paths, prepos, ignored_map, ignored_location_map, local_config, portdir, default_opts):
+	def _parse(paths, prepos, local_config, portdir, default_opts):
 		"""Parse files in paths to load config"""
 		parser = SafeConfigParser(defaults=default_opts)
 
@@ -644,9 +644,7 @@ class RepoConfigLoader(object):
 			settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None)
 
 		try:
-			self._parse(paths, prepos, ignored_map,
-				ignored_location_map, settings.local_config,
-				portdir, default_opts)
+			self._parse(paths, prepos, settings.local_config, portdir, default_opts)
 		except ConfigParserError as e:
 			writemsg(
 				_("!!! Error while reading repo config file: %s\n") % e,
@@ -659,8 +657,6 @@ class RepoConfigLoader(object):
 				{}, local_config=settings.local_config)
 			location_map.clear()
 			treemap.clear()
-			ignored_map.clear()
-			ignored_location_map.clear()
 
 		default_portdir = os.path.join(os.sep,
 			settings['EPREFIX'].lstrip(os.sep), 'usr', 'portage')


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-11-23 20:49 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-23 20:49 UTC (permalink / raw
  To: gentoo-commits

commit:     041fc702c296a80a1eb60b4ae34e18030feafe8e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Nov 23 20:47:06 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Nov 23 20:47:06 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=041fc702

portage.repository.config.RepoConfigLoader._add_repositories(): Delete unused ignored_location_map parametre.

 pym/portage/repository/config.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 2ba03f0..977bb43 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -454,7 +454,7 @@ class RepoConfigLoader(object):
 
 	@staticmethod
 	def _add_repositories(portdir, portdir_overlay, prepos,
-		ignored_map, ignored_location_map, local_config, default_portdir):
+		ignored_map, local_config, default_portdir):
 		"""Add overlays in PORTDIR_OVERLAY as repositories"""
 		overlays = []
 		portdir_orig = None
@@ -524,7 +524,6 @@ class RepoConfigLoader(object):
 							not (base_priority == 0 and
 							old_location == default_portdir):
 							ignored_map.setdefault(repo.name, []).append(old_location)
-							ignored_location_map[old_location] = repo.name
 							if old_location == portdir:
 								portdir = repo.user_location
 
@@ -621,7 +620,6 @@ class RepoConfigLoader(object):
 		location_map = {}
 		treemap = {}
 		ignored_map = {}
-		ignored_location_map = {}
 		default_opts = {
 			"EPREFIX" : settings["EPREFIX"],
 			"EROOT" : settings["EROOT"],
@@ -664,7 +662,7 @@ class RepoConfigLoader(object):
 		# If PORTDIR_OVERLAY contains a repo with the same repo_name as
 		# PORTDIR, then PORTDIR is overridden.
 		portdir = self._add_repositories(portdir, portdir_overlay, prepos,
-			ignored_map, ignored_location_map, settings.local_config,
+			ignored_map, settings.local_config,
 			default_portdir)
 		if portdir and portdir.strip():
 			portdir = os.path.realpath(portdir)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-11-23 21:10 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 105+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-23 21:10 UTC (permalink / raw
  To: gentoo-commits

commit:     f05056c147fef34531632bbfca908a4a71efb3f7
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Nov 23 21:09:21 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Mon Nov 23 21:09:21 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f05056c1

portage.repository.config.RepoConfigLoader._parse(): Delete unused portdir parametre.

 pym/portage/repository/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 977bb43..a21c891 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -546,7 +546,7 @@ class RepoConfigLoader(object):
 		return portdir
 
 	@staticmethod
-	def _parse(paths, prepos, local_config, portdir, default_opts):
+	def _parse(paths, prepos, local_config, default_opts):
 		"""Parse files in paths to load config"""
 		parser = SafeConfigParser(defaults=default_opts)
 
@@ -642,7 +642,7 @@ class RepoConfigLoader(object):
 			settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None)
 
 		try:
-			self._parse(paths, prepos, settings.local_config, portdir, default_opts)
+			self._parse(paths, prepos, settings.local_config, default_opts)
 		except ConfigParserError as e:
 			writemsg(
 				_("!!! Error while reading repo config file: %s\n") % e,


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-12-09  3:07 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2015-12-09  3:07 UTC (permalink / raw
  To: gentoo-commits

commit:     30ab9f5156d50fb7849dbe48f39d3d4c04256792
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  9 03:04:15 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec  9 03:05:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=30ab9f51

RepoConfigLoader._add_repositories: discard invalid repos

Invalid repos are unsafe to handle. For example, repo.name
can be None.

 pym/portage/repository/config.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index fbc1c14..fff619f 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -512,6 +512,8 @@ class RepoConfigLoader(object):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts, local_config=local_config)
+					if repo._invalid_config:
+						continue
 					# repos_conf_opts contains options from repos.conf
 					repos_conf_opts = repos_conf.get(repo.name)
 					if repos_conf_opts is not None:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2015-12-13 21:56 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2015-12-13 21:56 UTC (permalink / raw
  To: gentoo-commits

commit:     c151afadd5470659f9b31d7f0a37786da0d8ce61
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 13 21:54:04 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 21:54:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c151afad

Revert "RepoConfigLoader._add_repositories: discard invalid repos"

This reverts commit 30ab9f5156d50fb7849dbe48f39d3d4c04256792. The
existence of the _invalid_config attribute was reverted in commit
18692ada8579d367eb332fad7bfe273100f9638f.

 pym/portage/repository/config.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index e3c0266..00319fe 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -500,8 +500,6 @@ class RepoConfigLoader(object):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
 					repo = RepoConfig(None, repo_opts, local_config=local_config)
-					if repo._invalid_config:
-						continue
 					# repos_conf_opts contains options from repos.conf
 					repos_conf_opts = repos_conf.get(repo.name)
 					if repos_conf_opts is not None:


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2017-08-28  6:20 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2017-08-28  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     9750e66503012fe7ca29b4a5c6447aae8b6c539c
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Aug 28 06:01:48 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Aug 28 06:19:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9750e665

RepoConfigLoader: Fix compatibility with Python 3.7 (bug #629146).

Set default value of sync-rsync-extra-opts to "" instead of None, which
is no longer supported since:
https://github.com/python/cpython/commit/44e6ad87340d50f48daf53b6a61138377d0d0d10

 pym/portage/repository/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index b65ed97ce..902213014 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2015 Gentoo Foundation
+# Copyright 2010-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -613,7 +613,7 @@ class RepoConfigLoader(object):
 			portdir_sync = settings.get("SYNC", "")
 
 		default_opts['sync-rsync-extra-opts'] = \
-			settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None)
+			settings.get("PORTAGE_RSYNC_EXTRA_OPTS", "")
 
 		try:
 			self._parse(paths, prepos, settings.local_config, default_opts)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2018-02-01 20:51 Michał Górny
  0 siblings, 0 replies; 105+ messages in thread
From: Michał Górny @ 2018-02-01 20:51 UTC (permalink / raw
  To: gentoo-commits

commit:     0101a29d90bb438c28c00e6994d8a6cd2e97aa82
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  1 20:24:10 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Feb  1 20:51:04 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0101a29d

repository.config: Fix handling sync-openpgp-key-path

Fix sync-openpgp-key-path to be correctly inherited from system
repos.conf and preserved in repo dumps.

Bug: https://bugs.gentoo.org/646314
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/portage/repository/config.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a71047d9b..52f44d526 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -522,6 +522,7 @@ class RepoConfigLoader(object):
 							'clone_depth', 'eclass_overrides',
 							'force', 'masters', 'priority', 'strict_misc_digests',
 							'sync_depth', 'sync_hooks_only_on_change',
+							'sync_openpgp_key_path',
 							'sync_type', 'sync_umask', 'sync_uri', 'sync_user',
 							'module_specific_options'):
 							v = getattr(repos_conf_opts, k, None)
@@ -944,7 +945,7 @@ class RepoConfigLoader(object):
 	def config_string(self):
 		bool_keys = ("strict_misc_digests",)
 		str_or_int_keys = ("auto_sync", "clone_depth", "format", "location",
-			"main_repo", "priority", "sync_depth",
+			"main_repo", "priority", "sync_depth", "sync_openpgp_key_path",
 			"sync_type", "sync_umask", "sync_uri", 'sync_user')
 		str_tuple_keys = ("aliases", "eclass_overrides", "force")
 		repo_config_tuple_keys = ("masters",)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/
@ 2018-07-16  5:55 Zac Medico
  0 siblings, 0 replies; 105+ messages in thread
From: Zac Medico @ 2018-07-16  5:55 UTC (permalink / raw
  To: gentoo-commits

commit:     01f49cb12c66026e5b225912f9759b50ff2e2289
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 15 20:55:48 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 16 05:53:05 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=01f49cb1

RepoConfig: fix make.conf PORTDIR override (bug 661276)

Pass the main-repo name from repos.conf as the repository name
for the PORTDIR RepoConfig constructor, so that it can override
the main repo location even if the profiles/repo_name file does
not exist yet (like in a stage3 tarball).

Bug: https://bugs.gentoo.org/661276
Reported-by: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo.org>

 pym/portage/repository/config.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index bf2b6dd03..e45e67dec 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -524,7 +524,8 @@ class RepoConfigLoader(object):
 					(base_priority == 0 and ov is portdir):
 					repo_opts = default_repo_opts.copy()
 					repo_opts['location'] = ov
-					repo = RepoConfig(None, repo_opts, local_config=local_config)
+					name = prepos['DEFAULT'].main_repo if ov is portdir else None
+					repo = RepoConfig(name, repo_opts, local_config=local_config)
 					# repos_conf_opts contains options from repos.conf
 					repos_conf_opts = repos_conf.get(repo.name)
 					if repos_conf_opts is not None:


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

end of thread, other threads:[~2018-07-16  5:55 UTC | newest]

Thread overview: 105+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 20:51 [gentoo-commits] proj/portage:master commit in: pym/portage/repository/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2018-07-16  5:55 Zac Medico
2017-08-28  6:20 Zac Medico
2015-12-13 21:56 Zac Medico
2015-12-09  3:07 Zac Medico
2015-11-23 21:10 Arfrever Frehtes Taifersar Arahesis
2015-11-23 20:49 Arfrever Frehtes Taifersar Arahesis
2015-11-23 20:41 Arfrever Frehtes Taifersar Arahesis
2015-09-24 19:54 Brian Dolbec
2015-07-14 21:31 Brian Dolbec
2015-05-21  4:09 Mike Frysinger
2015-02-09 21:36 Brian Dolbec
2015-02-03 20:57 Brian Dolbec
2015-02-03 20:57 Brian Dolbec
2015-02-02 18:50 Brian Dolbec
2015-02-02 18:35 Brian Dolbec
2014-12-04 20:04 [gentoo-commits] proj/portage:plugin-sync " Brian Dolbec
2014-12-04 20:16 ` [gentoo-commits] proj/portage:master " Brian Dolbec
2014-02-09  7:27 Arfrever Frehtes Taifersar Arahesis
2013-09-23 20:59 Zac Medico
2013-09-23 20:44 Zac Medico
2013-09-23 20:43 Zac Medico
2013-09-15 14:10 Zac Medico
2013-09-15 10:58 Zac Medico
2013-09-13  9:14 Arfrever Frehtes Taifersar Arahesis
2013-08-22 16:22 Zac Medico
2013-08-08 16:04 Zac Medico
2013-07-29 17:23 Zac Medico
2013-07-25 21:41 Zac Medico
2013-07-25 19:55 Zac Medico
2013-07-25 18:46 Arfrever Frehtes Taifersar Arahesis
2013-07-25 18:25 Arfrever Frehtes Taifersar Arahesis
2013-07-24 20:42 Zac Medico
2013-07-23 21:53 Arfrever Frehtes Taifersar Arahesis
2013-07-23  5:56 Zac Medico
2013-07-23  4:45 Zac Medico
2013-07-23  4:42 Zac Medico
2013-07-14  7:57 Arfrever Frehtes Taifersar Arahesis
2013-07-14  7:49 Arfrever Frehtes Taifersar Arahesis
2013-06-28  1:54 Zac Medico
2013-06-26  3:32 Arfrever Frehtes Taifersar Arahesis
2013-06-24 23:42 Arfrever Frehtes Taifersar Arahesis
2013-06-24 22:03 Arfrever Frehtes Taifersar Arahesis
2013-06-24 21:47 Arfrever Frehtes Taifersar Arahesis
2013-06-24 19:45 Arfrever Frehtes Taifersar Arahesis
2013-06-24 19:40 Arfrever Frehtes Taifersar Arahesis
2013-06-24 19:24 Zac Medico
2013-06-24 18:57 Zac Medico
2013-06-24 17:04 Arfrever Frehtes Taifersar Arahesis
2013-06-19 19:22 Zac Medico
2013-06-19 19:11 Zac Medico
2013-06-19 18:02 Zac Medico
2013-06-19  5:55 Zac Medico
2013-06-19  4:49 Zac Medico
2013-06-19  3:58 Zac Medico
2013-06-19  3:42 Zac Medico
2013-06-19  2:19 Zac Medico
2013-06-19  1:58 Zac Medico
2013-06-18 21:20 Zac Medico
2013-06-18 17:47 Zac Medico
2013-06-18 16:14 Zac Medico
2013-03-29 21:43 Zac Medico
2013-03-20 18:38 Zac Medico
2013-03-10  8:31 Zac Medico
2013-03-10  8:22 Zac Medico
2013-03-10  8:07 Zac Medico
2013-01-24 20:01 Zac Medico
2012-06-06  0:11 Zac Medico
2012-05-11 23:28 Zac Medico
2012-02-03 22:41 Zac Medico
2012-01-08  3:12 Arfrever Frehtes Taifersar Arahesis
2012-01-08  3:12 Arfrever Frehtes Taifersar Arahesis
2011-12-28  8:16 Zac Medico
2011-12-25 19:43 Arfrever Frehtes Taifersar Arahesis
2011-12-18 21:57 Arfrever Frehtes Taifersar Arahesis
2011-12-18 21:26 Arfrever Frehtes Taifersar Arahesis
2011-12-18 21:14 Arfrever Frehtes Taifersar Arahesis
2011-12-18  3:05 Arfrever Frehtes Taifersar Arahesis
2011-12-13 22:19 Zac Medico
2011-10-29  6:15 Zac Medico
2011-10-28  7:17 Zac Medico
2011-10-28  6:48 Zac Medico
2011-10-28  6:20 Zac Medico
2011-10-28  5:38 Zac Medico
2011-10-28  5:30 Zac Medico
2011-10-28  5:15 Zac Medico
2011-10-27 19:41 Zac Medico
2011-10-27  5:55 Zac Medico
2011-10-27  5:32 Zac Medico
2011-10-27  5:09 Zac Medico
2011-10-25 21:44 Zac Medico
2011-10-25 21:44 Zac Medico
2011-10-16  6:18 Zac Medico
2011-10-09 19:10 Zac Medico
2011-10-09 19:10 Zac Medico
2011-10-08 23:23 Zac Medico
2011-10-08 21:41 Arfrever Frehtes Taifersar Arahesis
2011-10-05  1:11 Arfrever Frehtes Taifersar Arahesis
2011-10-04 15:33 Zac Medico
2011-10-03 20:14 Zac Medico
2011-10-03 18:33 Zac Medico
2011-09-30 22:05 Zac Medico
2011-09-17 18:08 Zac Medico
2011-09-12 21:27 Zac Medico
2011-09-12 21:27 Zac Medico
2011-07-08 16:36 Zac Medico

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