public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: man/, /, bin/, pym/portage/repository/, cnf/
@ 2013-07-13 10:01 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; only message in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2013-07-13 10:01 UTC (permalink / raw
  To: gentoo-commits

commit:     a5dd8b59fbf253a435e5ca32c5fd0d128d1d8cfb
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sat Jul 13 10:01:07 2013 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever.fta <AT> gmail <DOT> com>
CommitDate: Sat Jul 13 10:01:07 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a5dd8b59

Move default configuration of repositories from /usr/share/portage/config/make.globals
to /usr/share/portage/config/repos.conf.

---
 Makefile                         |  2 +-
 bin/repoman                      |  3 +--
 cnf/make.globals                 |  9 ++++-----
 cnf/repos.conf                   |  5 +++++
 man/portage.5                    | 12 +++++++++---
 pym/portage/repository/config.py | 11 ++++++++---
 6 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index be2e089..4bd6c0d 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ INSMODE = 0644
 EXEMODE = 0755
 DIRMODE = 0755
 SYSCONFDIR_FILES = etc-update.conf dispatch-conf.conf
-PORTAGE_CONFDIR_FILES = make.globals
+PORTAGE_CONFDIR_FILES = make.globals repos.conf
 LOGROTATE_FILES = elog-save-summary
 BINDIR_FILES = ebuild egencache emerge emerge-webrsync \
 	emirrordist portageq quickpkg repoman

diff --git a/bin/repoman b/bin/repoman
index e31f699..f21dacc 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -590,7 +590,6 @@ except KeyError:
 	layout_conf_data = portage.repository.config.parse_layout_conf(portdir_overlay)[0]
 	if layout_conf_data['repo-name']:
 		repo_name = layout_conf_data['repo-name']
-	repos_conf_file = os.path.join(repoman_settings["PORTAGE_CONFIGROOT"], portage.const.USER_CONFIG_PATH, "repos.conf")
 	tmp_conf_file = io.StringIO(textwrap.dedent("""
 		[%s]
 		location = %s
@@ -601,7 +600,7 @@ except KeyError:
 	repoman_settings['PORTDIR_OVERLAY'] = "%s %s" % \
 		(repoman_settings.get('PORTDIR_OVERLAY', ''),
 		portage._shell_quote(portdir_overlay))
-	repositories = portage.repository.config.RepoConfigLoader([repos_conf_file, tmp_conf_file], repoman_settings)
+	repositories = portage.repository.config.load_repository_config(repoman_settings, extra_files=[tmp_conf_file])
 	# We have to call the config constructor again so that attributes
 	# dependent on config.repositories are initialized correctly.
 	repoman_settings = portage.config(config_root=config_root, local_config=False, repositories=repositories)

diff --git a/cnf/make.globals b/cnf/make.globals
index a128029..4b524a1 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -30,11 +30,10 @@ ACCEPT_LICENSE="* -@EULA"
 ACCEPT_PROPERTIES="*"
 ACCEPT_RESTRICT="*"
 
-# Repository Paths
-PORTDIR=/usr/portage
-DISTDIR=${PORTDIR}/distfiles
-PKGDIR=${PORTDIR}/packages
-RPMDIR=${PORTDIR}/rpm
+# Miscellaneous paths
+DISTDIR=/usr/portage/distfiles
+PKGDIR=/usr/portage/packages
+RPMDIR=/usr/portage/rpm
 
 # Temporary build directory
 PORTAGE_TMPDIR=/var/tmp

diff --git a/cnf/repos.conf b/cnf/repos.conf
new file mode 100644
index 0000000..8bdf2bf
--- /dev/null
+++ b/cnf/repos.conf
@@ -0,0 +1,5 @@
+[DEFAULT]
+main-repo = gentoo
+
+[gentoo]
+location = /usr/portage

diff --git a/man/portage.5 b/man/portage.5
index ca468b8..01be18b 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -106,6 +106,7 @@ use.stable.force
 .BR /usr/share/portage/config/
 .nf
 make.globals
+repos.conf
 .fi
 .TP
 .BR /var/cache/edb/
@@ -1114,9 +1115,14 @@ games\-emulation/xmess:net \- Adds network support
 .TP
 .BR make.globals
 The global default settings for Portage.  This comes from the portage package 
-itself.  Settings in \fBmake.conf\fR or \fBpackage.env\fR
-override values here. The format 
-is described extensivly in \fBmake.conf\fR(5).
+itself.  Settings in \fBmake.conf\fR or \fBpackage.env\fR override values set
+here. The format is described extensively in \fBmake.conf\fR(5).
+.TP
+.BR repos.conf
+The default configuration of repositories for Portage.  This comes from
+the portage package itself.  Settings in \fB/etc/portage/repos.conf\fR
+override values set here. The format is described extensively in section
+for \fB/etc/portage/repos.conf\fR.
 .RE
 .TP
 .BR /var/cache/edb/

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5d4966a..676e7e3 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -20,7 +20,7 @@ except ImportError:
 import portage
 from portage import eclass_cache, os
 from portage.const import (MANIFEST2_HASH_FUNCTIONS, MANIFEST2_REQUIRED_HASH,
-	REPO_NAME_LOC, USER_CONFIG_PATH)
+	PORTAGE_BASE_PATH, 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.util import (normalize_path, read_corresponding_eapi_file, shlex_split,
@@ -846,13 +846,18 @@ class RepoConfigLoader(object):
 					config_string += "%s = %s\n" % (key.replace("_", "-"), " ".join(x.name for x in getattr(repo, key)))
 		return config_string
 
-def load_repository_config(settings):
+def load_repository_config(settings, extra_files=None):
 	repoconfigpaths = []
 	if "PORTAGE_REPOSITORIES" in settings:
 		repoconfigpaths.append(io.StringIO(settings["PORTAGE_REPOSITORIES"]))
 	else:
-		# repoconfigpaths.append(os.path.join(settings.global_config_path, "repos.conf"))
+		if portage._working_copy:
+			repoconfigpaths.append(os.path.join(PORTAGE_BASE_PATH, "cnf", "repos.conf"))
+		else:
+			repoconfigpaths.append(os.path.join(settings.global_config_path, "repos.conf"))
 		repoconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH, "repos.conf"))
+	if extra_files:
+		repoconfigpaths.extend(extra_files)
 	return RepoConfigLoader(repoconfigpaths, settings)
 
 def _get_repo_name(repo_location, cached=None):


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

only message in thread, other threads:[~2013-07-13 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-13 10:01 [gentoo-commits] proj/portage:master commit in: man/, /, bin/, pym/portage/repository/, cnf/ 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