public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/repository/, pym/_emerge/, man/, ...
@ 2015-12-09 12:04 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; only message in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-12-09 12:04 UTC (permalink / raw
  To: gentoo-commits

commit:     78539500809043bba57d9f93ff379c2695c85359
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Dec  9 11:54:45 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Wed Dec  9 11:54:45 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=78539500

Delete support for PORTDIR and PORTDIR_OVERLAY from make.conf and environment.

(SYNC variable was already not used.)

 man/make.conf.5                                    |  61 +--------
 pym/_emerge/actions.py                             |  33 -----
 pym/portage/dbapi/porttree.py                      |   4 +-
 .../package/ebuild/_config/special_env_vars.py     |   1 -
 pym/portage/package/ebuild/config.py               |  43 ++----
 pym/portage/repository/config.py                   | 149 +--------------------
 6 files changed, 24 insertions(+), 267 deletions(-)

diff --git a/man/make.conf.5 b/man/make.conf.5
index 1d1cfeb..f155c8e 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Jan 2015" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Dec 2015" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -195,9 +195,8 @@ like to selectively prune obsolete files from this directory, see
 Use the \fBPORTAGE_RO_DISTDIRS\fR variable to specify one or
 more read-only directories containing distfiles.
 
-Note
-that locations under /usr/portage are not necessarily safe for data storage.
-See the \fBPORTDIR\fR documentation for more information.
+Note that locations under locations of repositories are not necessarily safe
+for data storage.
 .br
 Defaults to /usr/portage/distfiles.
 .TP
@@ -773,8 +772,8 @@ to it's category. However, for backward compatibility with the layout
 used by older versions of portage, if the \fI${PKGDIR}/All\fR directory
 exists then all packages will be stored inside of it and symlinks to
 the packages will be created in the category subdirectories. Note
-that locations under /usr/portage are not necessarily safe for data storage.
-See the \fBPORTDIR\fR documentation for more information.
+that locations under locations of repositories are not necessarily safe
+for data storage.
 .br
 Defaults to /usr/portage/packages.
 .TP
@@ -1001,30 +1000,6 @@ when \fBxattr\fR is in \fBFEATURES\fR.
 .br
 Defaults to "security.*" (security labels are special, see bug #461868).
 .TP
-\fBPORTDIR\fR = \fI[path]\fR
-Defines the location of main repository. This variable is deprecated in favor of
-settings in \fBrepos.conf\fR. If you change this, you must update
-your /etc/portage/make.profile symlink accordingly.
-.br
-Defaults to /usr/portage.
-.br
-\fB***Warning***\fR
-.br
-Data stored inside \fBPORTDIR\fR is in peril of being overwritten or deleted by
-the emerge \-\-sync command. The default value of
-\fBPORTAGE_RSYNC_OPTS\fR will protect the default locations of
-\fBDISTDIR\fR and \fBPKGDIR\fR, but users are warned that any other locations
-inside \fBPORTDIR\fR are not necessarily safe for data storage.  You should not
-put other data (such as overlays) in your \fBPORTDIR\fB.  Portage will walk
-directory structures and may arbitrarily add invalid categories as packages.
-.TP
-\fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR
-Defines the locations of other repositories. This variable is deprecated in
-favor of settings in \fBrepos.conf\fR. This variable is a space\-delimited list of
-directories.
-.br
-Defaults to no value.
-.TP
 \fBQA_STRICT_EXECSTACK = \fI"set"\fR
 Set this to cause portage to ignore any \fIQA_EXECSTACK\fR override
 settings from ebuilds.  See also \fBebuild\fR(5).
@@ -1072,32 +1047,6 @@ Defines the location where created RPM packages will be stored.
 .br
 Defaults to /usr/portage/rpm.
 .TP
-\fBSYNC\fR = \fI[RSYNC]\fR
-Insert your preferred rsync mirror here.  This rsync server
-is used to sync the local portage tree when `emerge \-\-sync` is run.
-
-Note that the \fBSYNC\fR variable is now deprecated, and instead the
-sync\-type and sync\-uri attributes in repos.conf should be used. See
-\fBportage\fR(5) for more information.
-
-Defaults to rsync://rsync.gentoo.org/gentoo\-portage
-.RS
-.TP
-.B Usage:
-(rsync|ssh)://[username@]hostname[:port]/(module|path)
-.TP
-.B Examples:
-rsync://private\-mirror.com/portage\-module
-.br
-rsync://rsync\-user@private\-mirror.com:873/gentoo\-portage
-.br
-ssh://ssh\-user@192.168.0.1:22/usr/portage
-.br
-ssh://ssh\-user@192.168.0.1:22/\\${HOME}/portage\-storage
-.TP
-Note: For the ssh:// scheme, key\-based authentication might be of interest.
-.RE
-.TP
 \fBUNINSTALL_IGNORE\fR = \fI[space delimited list of fnmatch patterns]\fR
 This variable prevents uninstallation of files that match
 specific \fBfnmatch\fR(3) patterns. In order to ignore file

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a080ba4..da7d90f 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2693,38 +2693,6 @@ def expand_set_arguments(myfiles, myaction, root_config):
 			newargs.append(a)
 	return (newargs, retval)
 
-def repo_name_duplicate_check(trees):
-	ignored_repos = {}
-	for root, root_trees in trees.items():
-		if 'porttree' in root_trees:
-			portdb = root_trees['porttree'].dbapi
-			if portdb.settings.get('PORTAGE_REPO_DUPLICATE_WARN') != '0':
-				for repo_name, paths in portdb.getIgnoredRepos():
-					k = (root, repo_name, portdb.getRepositoryPath(repo_name))
-					ignored_repos.setdefault(k, []).extend(paths)
-
-	if ignored_repos:
-		msg = []
-		msg.append('WARNING: One or more repositories ' + \
-			'have been ignored due to duplicate')
-		msg.append('  profiles/repo_name entries:')
-		msg.append('')
-		for k in sorted(ignored_repos):
-			msg.append('  %s overrides' % ", ".join(k))
-			for path in ignored_repos[k]:
-				msg.append('    %s' % (path,))
-			msg.append('')
-		msg.extend('  ' + x for x in textwrap.wrap(
-			"All profiles/repo_name entries must be unique in order " + \
-			"to avoid having duplicates ignored. " + \
-			"Set PORTAGE_REPO_DUPLICATE_WARN=\"0\" in " + \
-			"/etc/portage/make.conf if you would like to disable this warning."))
-		msg.append("\n")
-		writemsg_level(''.join('%s\n' % l for l in msg),
-			level=logging.WARNING, noiselevel=-1)
-
-	return bool(ignored_repos)
-
 def run_action(emerge_config):
 
 	# skip global updates prior to sync, since it's called after sync
@@ -2810,7 +2778,6 @@ def run_action(emerge_config):
 	if "--quiet" not in emerge_config.opts:
 		portage.deprecated_profile_check(
 			settings=emerge_config.target_config.settings)
-		repo_name_duplicate_check(emerge_config.trees)
 		config_protect_check(emerge_config.trees)
 	check_procfs()
 

diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 0b8034e..fd489d8 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -363,7 +363,9 @@ class portdbapi(dbapi):
 		Returns a list of repository paths that have been ignored, because
 		another repo with the same name exists.
 		"""
-		return self.settings.repositories.ignored_repos
+		warnings.warn("portage.dbapi.porttree.portdbapi.getIgnoredRepos() is deprecated",
+			DeprecationWarning, stacklevel=2)
+		return ()
 
 	def findname2(self, mycpv, mytree=None, myrepo = None):
 		""" 

diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py
index 9ae53c1..d69c010 100644
--- a/pym/portage/package/ebuild/_config/special_env_vars.py
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py
@@ -174,7 +174,6 @@ environ_filter += [
 	"PORTAGE_GPG_KEY", "PORTAGE_GPG_SIGNING_COMMAND",
 	"PORTAGE_IONICE_COMMAND",
 	"PORTAGE_PACKAGE_EMPTY_ABORT",
-	"PORTAGE_REPO_DUPLICATE_WARN",
 	"PORTAGE_RO_DISTDIRS",
 	"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
 	"PORTAGE_RSYNC_RETRIES", "PORTAGE_SSH_OPTS", "PORTAGE_SYNC_STALE",

diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 975fe88..50e0110 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -502,28 +502,21 @@ class config(object):
 			self["EPREFIX"] = eprefix
 			self["EROOT"] = eroot
 			known_repos = []
-			portdir = ""
-			portdir_overlay = ""
-			portdir_sync = None
 			for confs in [make_globals, make_conf, self.configdict["env"]]:
-				v = confs.get("PORTDIR")
-				if v is not None:
-					portdir = v
-					known_repos.append(v)
-				v = confs.get("PORTDIR_OVERLAY")
-				if v is not None:
-					portdir_overlay = v
-					known_repos.extend(shlex_split(v))
-				v = confs.get("SYNC")
-				if v is not None:
-					portdir_sync = v
 				if 'PORTAGE_RSYNC_EXTRA_OPTS' in confs:
 					self['PORTAGE_RSYNC_EXTRA_OPTS'] = confs['PORTAGE_RSYNC_EXTRA_OPTS']
 
-			self["PORTDIR"] = portdir
-			self["PORTDIR_OVERLAY"] = portdir_overlay
-			if portdir_sync:
-				self["SYNC"] = portdir_sync
+			for var in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
+				if make_conf.get(var) is not None:
+					writemsg_level("!!! %s\n" % _("%s variable is set in make.conf but is no longer used. "
+						"Use repos.conf instead.") % var, level=logging.WARNING, noiselevel=-1)
+			for var in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
+				if self.configdict["env"].get(var) is not None:
+					writemsg_level("!!! %s\n" % _("%s environmental variable is set but is no longer used. "
+						"Use new environmental variables instead:") % var, level=logging.WARNING, noiselevel=-1)
+					writemsg_level("    PORTAGE_REPOSITORIES, PORTAGE_REPOSITORY:${repository_name}:${attribute}, "
+						"PORTAGE_ADDED_REPOSITORIES, PORTAGE_DELETED_REPOSITORIES\n", level=logging.WARNING, noiselevel=-1)
+
 			self.lookuplist = [self.configdict["env"]]
 			if repositories is None:
 				self.repositories = load_repository_config(self)
@@ -543,23 +536,11 @@ class config(object):
 				self.backup_changes("PORTDIR")
 				expand_map["PORTDIR"] = self["PORTDIR"]
 
-			# repoman controls PORTDIR_OVERLAY via the environment, so no
-			# special cases are needed here.
 			portdir_overlay = list(self.repositories.repoLocationList())
 			if portdir_overlay and portdir_overlay[0] == self["PORTDIR"]:
 				portdir_overlay = portdir_overlay[1:]
 
-			new_ov = []
-			if portdir_overlay:
-				for ov in portdir_overlay:
-					ov = normalize_path(ov)
-					if isdir_raise_eaccess(ov) or portage._sync_mode:
-						new_ov.append(portage._shell_quote(ov))
-					else:
-						writemsg(_("!!! Invalid PORTDIR_OVERLAY"
-							" (not a dir): '%s'\n") % ov, noiselevel=-1)
-
-			self["PORTDIR_OVERLAY"] = " ".join(new_ov)
+			self["PORTDIR_OVERLAY"] = " ".join(portdir_overlay)
 			self.backup_changes("PORTDIR_OVERLAY")
 			expand_map["PORTDIR_OVERLAY"] = self["PORTDIR_OVERLAY"]
 

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 54d7688..e1d5761 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -463,102 +463,7 @@ class RepoConfig(object):
 			return _unicode_encode(self.__unicode__())
 
 class RepoConfigLoader(object):
-	"""Loads and store config of several repositories, loaded from PORTDIR_OVERLAY or repos.conf"""
-
-	@staticmethod
-	def _add_repositories(portdir, portdir_overlay, prepos,
-		ignored_map, local_config, default_portdir):
-		"""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)]
-		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:
-			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:
-			# 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:
-				# 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)
-					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:
-						# Selectively copy only the attributes which
-						# repos.conf is allowed to override.
-						for k in ('aliases', 'auto_sync', 'eclass_overrides',
-							'force', 'masters', 'priority',
-							'sync_depth', 'sync_hooks_only_on_change',
-							'sync_type', 'sync_umask', 'sync_uri', 'sync_user',
-							'module_specific_options'):
-							v = getattr(repos_conf_opts, k, None)
-							if v is not None:
-								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 (base_priority == 0 and
-							old_location == default_portdir):
-							ignored_map.setdefault(repo.name, []).append(old_location)
-							if old_location == portdir:
-								portdir = repo.location
-
-					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:
-
-					if not portage._sync_mode:
-						writemsg(_("!!! Invalid PORTDIR_OVERLAY (not a dir): '%s'\n") % ov, noiselevel=-1)
-
-		return portdir
+	"""Loads and store config of several repositories, loaded from repos.conf"""
 
 	@staticmethod
 	def _parse(paths, prepos, local_config, default_opts, added_repos, deleted_repos, attrs_overrides):
@@ -650,7 +555,6 @@ class RepoConfigLoader(object):
 		prepos = {}
 		location_map = {}
 		treemap = {}
-		ignored_map = {}
 		default_opts = {
 			"EPREFIX" : settings["EPREFIX"],
 			"EROOT" : settings["EROOT"],
@@ -662,18 +566,10 @@ class RepoConfigLoader(object):
 			added_repos = []
 			deleted_repos = []
 			attrs_overrides = {}
-			portdir = ""
-			portdir_overlay = ""
-			# deprecated portdir_sync
-			portdir_sync = ""
 		else:
 			added_repos = settings.get("PORTAGE_ADDED_REPOSITORIES", "").split()
 			deleted_repos = settings.get("PORTAGE_DELETED_REPOSITORIES", "").split()
 			attrs_overrides = {x: settings[x] for x in settings if _repo_attr_override_var_re.match(x) is not None}
-			portdir = settings.get("PORTDIR", "")
-			portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
-			# deprecated portdir_sync
-			portdir_sync = settings.get("SYNC", "")
 
 		default_opts['sync-rsync-extra-opts'] = \
 			settings.get("PORTAGE_RSYNC_EXTRA_OPTS", None)
@@ -684,28 +580,11 @@ class RepoConfigLoader(object):
 			writemsg(
 				_("!!! Error while reading repo config file: %s\n") % e,
 				noiselevel=-1)
-			# 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}.
+			# The configparser state is unreliable (prone to quirky exceptions)
+			# after it has thrown an error, so use empty config.
 			prepos.clear()
 			prepos['DEFAULT'] = RepoConfig('DEFAULT',
 				{}, local_config=settings.local_config)
-			location_map.clear()
-			treemap.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, settings.local_config,
-			default_portdir)
-		if portdir and portdir.strip():
-			portdir = os.path.realpath(portdir)
-
-		ignored_repos = tuple((repo_name, tuple(paths)) \
-			for repo_name, paths in ignored_map.items())
 
 		# Do this before expanding aliases, so that location_map and
 		# treemap consistently map unaliased names whenever available.
@@ -742,30 +621,11 @@ class RepoConfigLoader(object):
 					treemap[name] = repo.location
 
 		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
-			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 portdir and not portage._sync_mode:
-					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
 
-		# DEPRECATED Backward compatible SYNC support for old mirrorselect.
-		# 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 /etc/portage/repos.conf/gentoo.conf\n"),
-				noiselevel=-1)
-
-
 		# Include repo.name in sort key, for predictable sorting
 		# even when priorities are equal.
 		prepos_order = sorted(prepos.items(),
@@ -779,7 +639,6 @@ class RepoConfigLoader(object):
 
 		self.prepos = prepos
 		self.prepos_order = prepos_order
-		self.ignored_repos = ignored_repos
 		self.location_map = location_map
 		self.treemap = treemap
 		self._prepos_changed = True
@@ -872,7 +731,7 @@ class RepoConfigLoader(object):
 		self._check_locations()
 
 	def repoLocationList(self):
-		"""Get a list of repositories location. Replaces PORTDIR_OVERLAY"""
+		"""Get list of locations of repositories."""
 		if self._prepos_changed:
 			_repo_location_list = []
 			for repo in self.prepos_order:


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-09 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-09 12:04 [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, pym/portage/repository/, pym/_emerge/, man/, Arfrever Frehtes Taifersar Arahesis

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