Move default configuration of repositories from /usr/share/portage/config/make.globals
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Sat, 13 Jul 2013 10:01:07 +0000 (12:01 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Sat, 13 Jul 2013 10:01:07 +0000 (12:01 +0200)
to /usr/share/portage/config/repos.conf.

Makefile
bin/repoman
cnf/make.globals
cnf/repos.conf [new file with mode: 0644]
man/portage.5
pym/portage/repository/config.py

index be2e0891b30f33d4613cc35eb3bea969ce13da04..4bd6c0df87e9f504e0fbfa2d03ab8cc4a1d80923 100644 (file)
--- 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
index e31f69924b4c666e974a234625ec721acf1155bf..f21dacc1bbe4c4d91d70a706a28c08050e2880ac 100755 (executable)
@@ -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)
index a128029dea6c2159c87676fadabf587201101589..4b524a19d46df234c89e030f217917b7e8a48e3a 100644 (file)
@@ -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 (file)
index 0000000..8bdf2bf
--- /dev/null
@@ -0,0 +1,5 @@
+[DEFAULT]
+main-repo = gentoo
+
+[gentoo]
+location = /usr/portage
index ca468b8438a61e9cec57196c4889691217364ca8..01be18b65a6fed35d1496b28c0d66eee0113702e 100644 (file)
@@ -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/
index 5d4966a7d358f99e4ba4e74b902ff1f22b7dacda..676e7e3004d44d833e503404a69e1eea0732a264 100644 (file)
@@ -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):