Discussion:
[gentoo-portage-dev] [PATCH 0/2] Change /usr/portage council approved locations (bug 378603)
Zac Medico
2018-08-06 00:23:45 UTC
Permalink
This includes a _compat_upgrade.default_locations script that the
ebuild can call in pkg_preinst in order to maintain backward-compatible
defaults when appropriate. The new defaults are specified in the
summary of the 20180729 council meeting:

Vote: Default locations for the Gentoo repository, distfiles, and
binary packages will be, respectively:
/var/db/repos/gentoo
/var/cache/distfiles
/var/cache/binpkgs
Accepted with 6 yes votes and 1 no vote.

See: https://projects.gentoo.org/council/meeting-logs/20180729-summary.txt
Bug: https://bugs.gentoo.org/378603

Zac Medico (2):
Change /usr/portage council approved locations (bug 378603)
Update /usr/portage references (bug 378603)

cnf/make.conf.example | 12 ++--
cnf/make.globals | 4 +-
cnf/repos.conf | 2 +-
lib/portage/__init__.py | 2 +-
lib/portage/_compat_upgrade/__init__.py | 0
lib/portage/_compat_upgrade/default_locations.py | 82 ++++++++++++++++++++++++
lib/portage/cache/flat_hash.py | 2 +-
lib/portage/tests/news/test_NewsItem.py | 2 +-
lib/portage/tests/resolver/ResolverPlayground.py | 2 +-
lib/portage/xml/metadata.py | 4 +-
man/ebuild.5 | 4 +-
man/emerge.1 | 6 +-
man/make.conf.5 | 20 +++---
man/portage.5 | 26 ++++----
man/quickpkg.1 | 2 +-
repoman/lib/repoman/__init__.py | 2 +-
repoman/lib/repoman/checks/herds/herdbase.py | 2 +-
17 files changed, 128 insertions(+), 46 deletions(-)
create mode 100644 lib/portage/_compat_upgrade/__init__.py
create mode 100644 lib/portage/_compat_upgrade/default_locations.py
--
2.16.4
Zac Medico
2018-08-06 00:23:46 UTC
Permalink
This includes a _compat_upgrade.default_locations script that the
ebuild can call in pkg_preinst in order to maintain backward-compatible
defaults when appropriate. The new defaults are specified in the
summary of the 20180729 council meeting:

Vote: Default locations for the Gentoo repository, distfiles, and
binary packages will be, respectively:
/var/db/repos/gentoo
/var/cache/distfiles
/var/cache/binpkgs
Accepted with 6 yes votes and 1 no vote.

See: https://projects.gentoo.org/council/meeting-logs/20180729-summary.txt
Bug: https://bugs.gentoo.org/378603
---
cnf/make.globals | 4 +-
cnf/repos.conf | 2 +-
lib/portage/_compat_upgrade/__init__.py | 0
lib/portage/_compat_upgrade/default_locations.py | 82 ++++++++++++++++++++++++
4 files changed, 85 insertions(+), 3 deletions(-)
create mode 100644 lib/portage/_compat_upgrade/__init__.py
create mode 100644 lib/portage/_compat_upgrade/default_locations.py

diff --git a/cnf/make.globals b/cnf/make.globals
index 04a708af8..bc81a6a73 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -28,8 +28,8 @@ ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"

# Miscellaneous paths
-DISTDIR="/usr/portage/distfiles"
-PKGDIR="/usr/portage/packages"
+DISTDIR="/var/cache/distfiles"
+PKGDIR="/var/cache/binpkgs"
RPMDIR="/usr/portage/rpm"

# Temporary build directory
diff --git a/cnf/repos.conf b/cnf/repos.conf
index 352073cfd..e84840bf2 100644
--- a/cnf/repos.conf
+++ b/cnf/repos.conf
@@ -2,7 +2,7 @@
main-repo = gentoo

[gentoo]
-location = /usr/portage
+location = /var/db/repos/gentoo
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
diff --git a/lib/portage/_compat_upgrade/__init__.py b/lib/portage/_compat_upgrade/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/lib/portage/_compat_upgrade/default_locations.py b/lib/portage/_compat_upgrade/default_locations.py
new file mode 100644
index 000000000..484a2dea4
--- /dev/null
+++ b/lib/portage/_compat_upgrade/default_locations.py
@@ -0,0 +1,82 @@
+# Copyright 2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import re
+
+import portage
+from portage import os
+from portage.const import GLOBAL_CONFIG_PATH
+
+COMPAT_DISTDIR = 'usr/portage/distfiles'
+COMPAT_PKGDIR = 'usr/portage/packages'
+COMPAT_MAIN_REPO = 'usr/portage'
+
+
+def main():
+ """
+ If the current installation is still configured to use any of the
+ legacy default /usr/portage locations, then patch make.globals and
+ repos.conf inside ${ED} to maintain compatible defaults. This is
+ intended to be called from the ebuild as follows:
+
+ pkg_preinst() {
+ python_setup
+ python_export PYTHON_SITEDIR
+ env -u DISTDIR \
+ -u PORTAGE_OVERRIDE_EPREFIX \
+ -u PORTAGE_REPOSITORIES \
+ -u PORTDIR \
+ -u PORTDIR_OVERLAY \
+ PYTHONPATH="${ED%/}${PYTHON_SITEDIR}${PYTHONPATH:+:${PYTHONPATH}}" \
+ "${PYTHON}" -m portage._compat_upgrade.default_locations || die
+ }
+ """
+ out = portage.output.EOutput()
+ config = portage.settings
+
+ compat_distdir = os.path.join(portage.const.EPREFIX or '/', COMPAT_DISTDIR)
+ try:
+ do_distdir = os.path.samefile(config['DISTDIR'], compat_distdir)
+ except OSError:
+ do_distdir = False
+
+ compat_pkgdir = os.path.join(portage.const.EPREFIX or '/', COMPAT_PKGDIR)
+ try:
+ do_pkgdir = os.path.samefile(config['PKGDIR'], compat_pkgdir)
+ except OSError:
+ do_pkgdir = False
+
+ compat_main_repo = os.path.join(portage.const.EPREFIX or '/', COMPAT_MAIN_REPO)
+ try:
+ do_main_repo = os.path.samefile(config.repositories.mainRepoLocation(), compat_main_repo)
+ except OSError:
+ do_main_repo = False
+
+ if do_distdir or do_pkgdir:
+ config_path = os.path.join(os.environ['ED'], GLOBAL_CONFIG_PATH.lstrip(os.sep), 'make.globals')
+ with open(config_path) as f:
+ content = f.read()
+ if do_distdir:
+ compat_setting = 'DISTDIR="{}"'.format(compat_distdir)
+ out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting))
+ content = re.sub('^DISTDIR=.*$', compat_setting, content, flags=re.MULTILINE)
+ if do_pkgdir:
+ compat_setting = 'PKGDIR="{}"'.format(compat_pkgdir)
+ out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting))
+ content = re.sub('^PKGDIR=.*$', compat_setting, content, flags=re.MULTILINE)
+ with open(config_path, 'wt') as f:
+ f.write(content)
+
+ if do_main_repo:
+ config_path = os.path.join(os.environ['ED'], GLOBAL_CONFIG_PATH.lstrip(os.sep), 'repos.conf')
+ with open(config_path) as f:
+ content = f.read()
+ compat_setting = 'location = {}'.format(compat_main_repo)
+ out.einfo('Setting repos.conf default {} for backward compatibility'.format(compat_setting))
+ content = re.sub('^location =.*$', compat_setting, content, flags=re.MULTILINE)
+ with open(config_path, 'wt') as f:
+ f.write(content)
+
+
+if __name__ == '__main__':
+ main()
--
2.16.4
Zac Medico
2018-08-06 00:23:47 UTC
Permalink
Update all relevant references in docs, messages, and comments
to refer to /var/db/repos/gentoo instead of /usr/portage.

Bug: https://bugs.gentoo.org/378603
---
cnf/make.conf.example | 12 +++++------
lib/portage/__init__.py | 2 +-
lib/portage/cache/flat_hash.py | 2 +-
lib/portage/tests/news/test_NewsItem.py | 2 +-
lib/portage/tests/resolver/ResolverPlayground.py | 2 +-
lib/portage/xml/metadata.py | 4 ++--
man/ebuild.5 | 4 ++--
man/emerge.1 | 6 +++---
man/make.conf.5 | 20 +++++++++---------
man/portage.5 | 26 ++++++++++++------------
man/quickpkg.1 | 2 +-
repoman/lib/repoman/__init__.py | 2 +-
repoman/lib/repoman/checks/herds/herdbase.py | 2 +-
13 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/cnf/make.conf.example b/cnf/make.conf.example
index 04f3a0274..539ea4e9b 100644
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
@@ -14,7 +14,7 @@
# https://wiki.gentoo.org/wiki/Handbook:X86/Working/USE
#
# The available list of use flags with descriptions is in your portage tree.
-# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <--
+# Use 'less' to view them: --> less /var/db/repos/gentoo/profiles/use.desc <--
#
# 'ufed' is an ncurses/dialog interface available in portage to make handling
# useflags for you. 'emerge app-portage/ufed'
@@ -111,7 +111,7 @@
# will protect the default locations of DISTDIR and PKGDIR, but users are
# warned that any other locations inside PORTDIR are not necessarily safe
# for data storage.
-#PORTDIR=/usr/portage
+#PORTDIR=/var/db/repos/gentoo
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. After packages are built, it is safe to remove any and
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations under
-# /usr/portage are not necessarily safe for data storage. See the
+# /var/db/repos/gentoo are not necessarily safe for data storage. See the
# PORTDIR documentation for more information.
-#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/db/repos/gentoo/distfiles
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# up to several hundred megs, or even a few gigs. Note that
-# locations under /usr/portage are not necessarily safe for data
+# locations under /var/db/repos/gentoo are not necessarily safe for data
# storage. See the PORTDIR documentation for more information.
-#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/db/repos/gentoo/packages
#
# PORT_LOGDIR is the location where portage will store all the logs it
# creates from each individual merge. They are stored as
diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 166bfc700..61a240100 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -133,7 +133,7 @@ except ImportError as e:
sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n")
sys.stderr.write("!!! portage and failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
sys.stderr.write("!!! There is a README.RESCUE file that details the steps required to perform\n")
sys.stderr.write("!!! a recovery of portage.\n")
sys.stderr.write(" "+str(e)+"\n\n")
diff --git a/lib/portage/cache/flat_hash.py b/lib/portage/cache/flat_hash.py
index 79783245b..1ec32fb5b 100644
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
@@ -144,7 +144,7 @@ class database(fs_template.FsBased):
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can
# happen if the user nests an overlay inside
- # /usr/portage/local as in bug #302764.
+ # /var/db/repos/gentoo/local as in bug #302764.
if depth < 1:
dirs.append((depth+1, p))
continue
diff --git a/lib/portage/tests/news/test_NewsItem.py b/lib/portage/tests/news/test_NewsItem.py
index 2f183a7e0..411b8d36d 100644
--- a/lib/portage/tests/news/test_NewsItem.py
+++ b/lib/portage/tests/news/test_NewsItem.py
@@ -43,7 +43,7 @@ against YourSQL:
The revdep-rebuild tool is provided by app-portage/gentoolkit.
"""
def setUp(self):
- self.profile = "/usr/portage/profiles/default-linux/x86/2007.0/"
+ self.profile = "/var/db/repos/gentoo/profiles/default-linux/x86/2007.0/"
self.keywords = "x86"
# Use fake/test dbapi to avoid slow tests
self.vardb = testdbapi()
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index e2e061669..c0fbb541b 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -350,7 +350,7 @@ class ResolverPlayground(object):
f.write("masters =\n")

if repo == "test_repo":
- #Create a minimal profile in /usr/portage
+ #Create a minimal profile in /var/db/repos/gentoo
sub_profile_dir = os.path.join(profile_dir, "default", "linux", "x86", "test_profile")
os.makedirs(sub_profile_dir)

diff --git a/lib/portage/xml/metadata.py b/lib/portage/xml/metadata.py
index 9e48dddde..8e82df0d0 100644
--- a/lib/portage/xml/metadata.py
+++ b/lib/portage/xml/metadata.py
@@ -5,9 +5,9 @@
from portage.xml.metadata import MetaDataXML
- >>> pkg_md = MetaDataXML('/usr/portage/app-misc/gourmet/metadata.xml')
+ >>> pkg_md = MetaDataXML('/var/db/repos/gentoo/app-misc/gourmet/metadata.xml')
pkg_md
- <MetaDataXML '/usr/portage/app-misc/gourmet/metadata.xml'>
+ <MetaDataXML '/var/db/repos/gentoo/app-misc/gourmet/metadata.xml'>
pkg_md.herds()
['no-herd']
diff --git a/man/ebuild.5 b/man/ebuild.5
index 9f491dd73..e6660c283 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -569,7 +569,7 @@ being submitted for inclusion, it must have ~arch set for architectures
where it has been PROVEN TO WORK. (Packages KEYWORDed this way may be
unmasked for testing by setting ACCEPT_KEYWORDS="~arch" on the command
line, or in \fBmake.conf\fR(5)) For an authoritative list please review
-/usr/portage/profiles/arch.list. Please keep this list in alphabetical order.
+/var/db/repos/gentoo/profiles/arch.list. Please keep this list in alphabetical order.
.TP
.B SLOT
This sets the SLOT for packages that may need to have multiple versions
@@ -592,7 +592,7 @@ usage.
.B LICENSE
This should be a space delimited list of licenses that the package falls
under. This \fB_must_\fR be set to a matching license in
-/usr/portage/licenses/. If the license does not exist in portage yet, you
+/var/db/repos/gentoo/licenses/. If the license does not exist in portage yet, you
must add it first.
.TP
.B IUSE
diff --git a/man/emerge.1 b/man/emerge.1
index f53ba92f5..21c3b854c 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -43,7 +43,7 @@ as \fBsys\-apps/portage\fR or \fB=python\-2.2.1\-r2\fR.
\fBemerge\fR
ignores a trailing slash so that filename completion can be used.
The \fIebuild\fR may also be an actual filename, such as
-\fB/usr/portage/app\-admin/python/python\-2.2.1\-r2.ebuild\fR.
+\fB/var/db/repos/gentoo/app\-admin/python/python\-2.2.1\-r2.ebuild\fR.
\fBWARNING:\fR The implementation of \fBemerge /path/to/ebuild\fR is broken and
so this syntax shouldn't be used.
.TP
@@ -1280,7 +1280,7 @@ avoid dependency conflicts and/or unsatisfied dependencies.
.BR package.mask
The \fBpackage.mask\fR file primarily blocks the use of packages that cause
problems or are known to have issues on different systems. It resides in
-\fI/usr/portage/profiles\fR.
+\fI/var/db/repos/gentoo/profiles\fR.
.TP
.BR CHOST
Use the \fBACCEPT_CHOSTS\fR variable in \fBmake.conf\fR(5) to control
@@ -1426,7 +1426,7 @@ files.
Contains profile\-specific variables for the build process. \fBDo not
edit this file\fR.
.TP
-.B /usr/portage/profiles/use.desc
+.B /var/db/repos/gentoo/profiles/use.desc
Contains the master list of USE flags with descriptions of their
functions. \fBDo not edit this file\fR.
.TP
diff --git a/man/make.conf.5 b/man/make.conf.5
index a4e33923c..801a55b64 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -219,10 +219,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/distfiles.
+Defaults to /var/db/repos/gentoo/distfiles.
.TP
.B DOC_SYMLINKS_DIR
If this variable contains a directory then symlinks to html documentation will
@@ -800,10 +800,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/packages.
+Defaults to /var/db/repos/gentoo/packages.
.TP
.B PORT_LOGDIR
This variable defines the directory in which per\-ebuild logs are kept.
@@ -1033,7 +1033,7 @@ 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.
+Defaults to /var/db/repos/gentoo.
.br
\fB***Warning***\fR
.br
@@ -1118,7 +1118,7 @@ rsync://private\-mirror.com/portage\-module
.br
rsync://rsync\-***@private\-mirror.com:873/gentoo\-portage
.br
-ssh://ssh\-***@192.168.0.1:22/usr/portage
+ssh://ssh\-***@192.168.0.1:22/var/db/repos/gentoo
.br
ssh://ssh\-***@192.168.0.1:22/\\${HOME}/portage\-storage
.TP
@@ -1136,7 +1136,7 @@ Defaults to "/lib/modules/*".
\fBUSE\fR = \fI[space delimited list of USE items]\fR
This variable contains options that control the build behavior of several
packages. More information in \fBebuild\fR(5). Possible USE values
-can be found in \fI/usr/portage/profiles/use.desc\fR.
+can be found in \fI/var/db/repos/gentoo/profiles/use.desc\fR.
.TP
\fBUSE_ORDER\fR = \fI"env:pkg:conf:defaults:pkginternal:features:repo:env.d"\fR
Determines the precedence of layers in the incremental stacking of the USE
@@ -1173,7 +1173,7 @@ for FEATURES=\fBtest\fR.
.TP
.B repo
USE from make.defaults and package.use in the repo's profiles/ top dir
-(e.g. /usr/portage/profiles/package.use) (see \fBportage\fR(5))
+(e.g. /var/db/repos/gentoo/profiles/package.use) (see \fBportage\fR(5))
.TP
.B env.d
USE from the environment variables, such as LINGUAS, defined by files in
@@ -1203,10 +1203,10 @@ Contains the default variables for the build\-process, you should edit
.B /etc/portage/color.map
Contains variables customizing colors.
.TP
-.B /usr/portage/profiles/use.desc
+.B /var/db/repos/gentoo/profiles/use.desc
Contains a list of all global USE flags.
.TP
-.B /usr/portage/profiles/use.local.desc
+.B /var/db/repos/gentoo/profiles/use.local.desc
Contains a list of all local USE variables.
.SH "SEE ALSO"
.BR emerge (1),
diff --git a/man/portage.5 b/man/portage.5
index cd9d5036d..0db8c5258 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -77,18 +77,18 @@ site-specific overrides of \fB/etc/portage/make.profile/\fR
.BR /etc/portage/sets/
user\-defined package sets
.TP
-.BR /usr/portage/
+.BR /var/db/repos/gentoo/
.nf
sets.conf
.fi
.TP
-.BR /usr/portage/metadata/
+.BR /var/db/repos/gentoo/metadata/
.nf
layout.conf
pkg_desc_index
.fi
.TP
-.BR /usr/portage/profiles/
+.BR /var/db/repos/gentoo/profiles/
.nf
arch.list
categories
@@ -214,7 +214,7 @@ More reading:
.TP
\fB/etc/portage/make.profile/\fR or \fB/etc/make.profile/\fR
This is usually just a symlink to the correct profile in
-\fB/usr/portage/profiles/\fR. Since it is part of the portage tree, it
+\fB/var/db/repos/gentoo/profiles/\fR. Since it is part of the portage tree, it
may easily be updated/regenerated by running `emerge \-\-sync`. It defines
what a profile is (usually arch specific stuff). If you need a custom
profile, then you should make your own \fBmake.profile\fR
@@ -251,7 +251,7 @@ explaining how they can upgrade.
default-linux/x86/2005.0
# emerge -n '>=sys-apps/portage-2.0.51'
# rm -f /etc/portage/make.profile
-# ln -s /usr/portage/profiles/default-linux/alpha/2005.0 \
+# ln -s /var/db/repos/gentoo/profiles/default-linux/alpha/2005.0 \
/etc/portage/make.profile
.fi
.TP
@@ -644,7 +644,7 @@ The global custom settings for Portage. See \fBmake.conf\fR(5).
.BR mirrors
Whenever portage encounters a mirror:// style URI it will look up the actual
hosts here. If the mirror set is not found here, it will check the global
-mirrors file at /usr/portage/profiles/thirdpartymirrors. You may also set a
+mirrors file at /var/db/repos/gentoo/profiles/thirdpartymirrors. You may also set a
special mirror type called "local". This list of mirrors will be checked
before GENTOO_MIRRORS and will be used even if the package has
RESTRICT="mirror" or RESTRICT="fetch".
@@ -1059,7 +1059,7 @@ rsync://private\-mirror.com/portage\-module
.br
rsync://rsync\-***@private\-mirror.com:873/gentoo\-portage
.br
-ssh://ssh\-***@192.168.0.1:22/usr/portage
+ssh://ssh\-***@192.168.0.1:22/var/db/repos/gentoo
.br
ssh://ssh\-***@192.168.0.1:22/\\${HOME}/portage\-storage
.RE
@@ -1178,7 +1178,7 @@ masters =

# Repository 'gentoo' synchronized using CVS
[gentoo]
-location = /usr/portage
+location = /var/db/repos/gentoo
sync\-type = cvs
sync\-uri = :pserver:***@anoncvs.gentoo.org:/var/cvsroot
sync\-cvs\-repo = gentoo\-x86
@@ -1195,7 +1195,7 @@ auto\-sync = yes
.TP
.BR sets.conf
A package set configuration file. Settings here override settings from
-\fB/usr/portage/sets.conf\fR and \fB/usr/share/portage/config/sets\fR.
+\fB/var/db/repos/gentoo/sets.conf\fR and \fB/usr/share/portage/config/sets\fR.
The format is described extensively in the
\fIPackage Set Configuration\fR section of the html documentation which
is installed with portage when the "doc" USE flag is enabled.
@@ -1256,7 +1256,7 @@ Also see \fB/var/lib/portage/world_sets\fR and the \fBemerge\fR(1)
\fB\-\-list\-sets\fR option.
.RE
.TP
-.BR /usr/portage/
+.BR /var/db/repos/gentoo/
.RS
.TP
.BR sets.conf
@@ -1265,7 +1265,7 @@ which overrides these settings, and
\fB/usr/share/portage/config/sets\fR which contains default settings.
.RE
.TP
-.BR /usr/portage/metadata/
+.BR /var/db/repos/gentoo/metadata/
.RS
.TP
.BR layout.conf
@@ -1432,7 +1432,7 @@ sys-apps/usleep 0.1: A wrapper for usleep
.fi
.RE
.TP
-.BR /usr/portage/profiles/
+.BR /var/db/repos/gentoo/profiles/
Global Gentoo settings that are controlled by the developers. To override
these settings, you can use the files in \fB/etc/portage/\fR.
.RS
@@ -1643,7 +1643,7 @@ for \fB/etc/portage/repos.conf\fR.
.TP
.BR sets
A directory containing package set configuration files. Also see
-\fB/etc/portage/sets.conf\fR and \fB/usr/portage/sets.conf\fR, both of
+\fB/etc/portage/sets.conf\fR and \fB/var/db/repos/gentoo/sets.conf\fR, both of
which override values set here. Default set configurations are installed
in \fB/usr/share/portage/config/sets/portage.conf\fR.
.RE
diff --git a/man/quickpkg.1 b/man/quickpkg.1
index 06a1f0b6e..f492175eb 100644
--- a/man/quickpkg.1
+++ b/man/quickpkg.1
@@ -17,7 +17,7 @@ modified since they were first installed.
.br
The packages, after being created, will be placed in \fBPKGDIR\fR.
This variable is defined in \fBmake.conf\fR(5) and defaults to
-/usr/portage/packages.
+/var/db/repos/gentoo/packages.
.SH OPTIONS
.TP
.B <list of packages or package\-sets>
diff --git a/repoman/lib/repoman/__init__.py b/repoman/lib/repoman/__init__.py
index 89779b95c..d1312a267 100644
--- a/repoman/lib/repoman/__init__.py
+++ b/repoman/lib/repoman/__init__.py
@@ -14,7 +14,7 @@ except ImportError as e:
sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n")
sys.stderr.write("!!! portage and failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
sys.stderr.write("!!! There is a README.RESCUE file that details the steps required to perform\n")
sys.stderr.write("!!! a recovery of portage.\n")
sys.stderr.write(" "+str(e)+"\n\n")
diff --git a/repoman/lib/repoman/checks/herds/herdbase.py b/repoman/lib/repoman/checks/herds/herdbase.py
index ebe6a19b4..1e7c0b27c 100644
--- a/repoman/lib/repoman/checks/herds/herdbase.py
+++ b/repoman/lib/repoman/checks/herds/herdbase.py
@@ -119,7 +119,7 @@ def get_herd_base(repoman_settings):


if __name__ == '__main__':
- h = make_herd_base('/usr/portage/metadata/herds.xml')
+ h = make_herd_base('/var/db/repos/gentoo/metadata/herds.xml')

assert(h.known_herd('sound'))
assert(not h.known_herd('media-sound'))
--
2.16.4
Ulrich Mueller
2018-08-06 04:59:02 UTC
Permalink
Post by Zac Medico
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
[...]
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations under
-# /usr/portage are not necessarily safe for data storage. See the
+# /var/db/repos/gentoo are not necessarily safe for data storage. See the
# PORTDIR documentation for more information.
-#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/db/repos/gentoo/distfiles
Shouldn't this be /var/cache/distfiles ...
Post by Zac Medico
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# up to several hundred megs, or even a few gigs. Note that
-# locations under /usr/portage are not necessarily safe for data
+# locations under /var/db/repos/gentoo are not necessarily safe for data
# storage. See the PORTDIR documentation for more information.
-#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/db/repos/gentoo/packages
... and /var/cache/binpkgs?
Post by Zac Medico
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can
# happen if the user nests an overlay inside
- # /usr/portage/local as in bug #302764.
+ # /var/db/repos/gentoo/local as in bug #302764.
Shouldn't a local overlay be in /var/db/repos/local, but never inside
of the gentoo repo?
Post by Zac Medico
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -219,10 +219,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
IMHO this statement should be made much stronger.
Post by Zac Medico
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/distfiles.
+Defaults to /var/db/repos/gentoo/distfiles.
/var/cache/distfiles
Post by Zac Medico
@@ -800,10 +800,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
See above.
Post by Zac Medico
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/packages.
+Defaults to /var/db/repos/gentoo/packages.
/var/cache/binpkgs
Post by Zac Medico
--- a/man/quickpkg.1
+++ b/man/quickpkg.1
@@ -17,7 +17,7 @@ modified since they were first installed.
.br
The packages, after being created, will be placed in \fBPKGDIR\fR.
This variable is defined in \fBmake.conf\fR(5) and defaults to
-/usr/portage/packages.
+/var/db/repos/gentoo/packages.
See above.
Zac Medico
2018-08-06 05:46:58 UTC
Permalink
Post by Ulrich Mueller
Post by Zac Medico
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
[...]
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations under
-# /usr/portage are not necessarily safe for data storage. See the
+# /var/db/repos/gentoo are not necessarily safe for data storage. See the
# PORTDIR documentation for more information.
-#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/db/repos/gentoo/distfiles
Shouldn't this be /var/cache/distfiles ...
Post by Zac Medico
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# up to several hundred megs, or even a few gigs. Note that
-# locations under /usr/portage are not necessarily safe for data
+# locations under /var/db/repos/gentoo are not necessarily safe for data
# storage. See the PORTDIR documentation for more information.
-#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/db/repos/gentoo/packages
... and /var/cache/binpkgs?
Thanks, I've fixed the /var/cache/{distfiles,binpkgs} locations in v2.
Post by Ulrich Mueller
Post by Zac Medico
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can
# happen if the user nests an overlay inside
- # /usr/portage/local as in bug #302764.
+ # /var/db/repos/gentoo/local as in bug #302764.
Shouldn't a local overlay be in /var/db/repos/local, but never inside
of the gentoo repo?
Yes, but for a long time /usr/local/portage was somewhat standard, in
fact it's still mentioned here:

https://wiki.gentoo.org/wiki/Custom_repository

Nowadays, repository verification will prevent that from working...
Post by Ulrich Mueller
Post by Zac Medico
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -219,10 +219,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
IMHO this statement should be made much stronger.
Yes, we could also say something about repository verification here. The
old defaults set a really bad example, so we needed statements like this
to steer people in the right direction.
--
Thanks,
Zac
Zac Medico
2018-08-06 06:03:42 UTC
Permalink
Post by Zac Medico
Post by Ulrich Mueller
Post by Zac Medico
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can
# happen if the user nests an overlay inside
- # /usr/portage/local as in bug #302764.
+ # /var/db/repos/gentoo/local as in bug #302764.
Shouldn't a local overlay be in /var/db/repos/local, but never inside
of the gentoo repo?
Yes, but for a long time /usr/local/portage was somewhat standard, in
https://wiki.gentoo.org/wiki/Custom_repository
Nowadays, repository verification will prevent that from working...
Actually the wiki has /usr/local/portage, but the default rsync options
have has --exclude=/local for a very long time. It might be safe to
remove it, but I guess it's probably safest to trigger a warning message
first, since some people might still be using it with rsync-verify disabled.
--
Thanks,
Zac
Brian Dolbec
2018-08-06 07:30:31 UTC
Permalink
On Sun, 5 Aug 2018 22:46:58 -0700
Post by Zac Medico
Post by Ulrich Mueller
Post by Zac Medico
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
[...]
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations
under -# /usr/portage are not necessarily safe for data
storage. See the +# /var/db/repos/gentoo are not necessarily
safe for data storage. See the # PORTDIR documentation for
more information. -#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/db/repos/gentoo/distfiles
Shouldn't this be /var/cache/distfiles ...
Post by Zac Medico
#
# PKGDIR is the location of binary packages that you can have
created # with '--buildpkg' or '-b' while emerging a package.
This can get # up to several hundred megs, or even a few gigs.
Note that -# locations under /usr/portage are not necessarily
safe for data +# locations under /var/db/repos/gentoo are not
necessarily safe for data # storage. See the PORTDIR
documentation for more information. -#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/db/repos/gentoo/packages
... and /var/cache/binpkgs?
Thanks, I've fixed the /var/cache/{distfiles,binpkgs} locations in v2.
Post by Ulrich Mueller
Post by Zac Medico
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
# Only recurse 1 deep, in
order to avoid iteration over # entries from another nested cache
instance. This can # happen if the user nests an overlay inside
- # /usr/portage/local as
in bug #302764.
+
# /var/db/repos/gentoo/local as in bug #302764.
Shouldn't a local overlay be in /var/db/repos/local, but never
inside of the gentoo repo?
Yes, but for a long time /usr/local/portage was somewhat standard, in
https://wiki.gentoo.org/wiki/Custom_repository
Nowadays, repository verification will prevent that from working...
But that too can be changed along with all the user install
documentation which will need to be updated as well. The new
recomended location should be /var/db/repos/local. I will be updating
layman for /var/db/repos/... as well. That is the intention of the
"repos/" subdir.

All these changes as well as the catlayst changes need to be
co-ordinated so that snapshots and portage and stages don't precede the
docs changes.
Post by Zac Medico
Post by Ulrich Mueller
Post by Zac Medico
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -219,10 +219,10 @@ 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. +that locations under /var/db/repos/gentoo are not
necessarily safe for data storage.
IMHO this statement should be made much stronger.
Yes, we could also say something about repository verification here.
The old defaults set a really bad example, so we needed statements
like this to steer people in the right direction.
--
Thanks,
Zac
Ulrich Mueller
2018-08-06 10:29:14 UTC
Permalink
Post by Brian Dolbec
But that too can be changed along with all the user install
documentation which will need to be updated as well. The new
recomended location should be /var/db/repos/local. I will be updating
layman for /var/db/repos/... as well. That is the intention of the
"repos/" subdir.
What is the exact plan for layman? IIUC, only the storage dir should
be changed to /var/db/repos, but the rest (cache, installed,
make_conf) would stay under /var/lib/layman?
Post by Brian Dolbec
All these changes as well as the catlayst changes need to be
co-ordinated so that snapshots and portage and stages don't precede
the docs changes.
+1

Ulrich
Zac Medico
2018-08-06 18:35:32 UTC
Permalink
Post by Brian Dolbec
All these changes as well as the catlayst changes need to be
co-ordinated so that snapshots and portage and stages don't precede the
docs changes.
I suppose all of the docs changes can be made in advance, with mention
of both old a new locations. These commands can be used to check the
local configuration:

portageq get_repo_path / gentoo
portageq distdir
portageq pkgdir
--
Thanks,
Zac
M. J. Everitt
2018-08-06 21:50:05 UTC
Permalink
Post by Zac Medico
Post by Brian Dolbec
All these changes as well as the catlayst changes need to be
co-ordinated so that snapshots and portage and stages don't precede the
docs changes.
I suppose all of the docs changes can be made in advance, with mention
of both old a new locations. These commands can be used to check the
portageq get_repo_path / gentoo
portageq distdir
portageq pkgdir
Sounds like a plan .. do we need a tracker bug?! :P

Let's do this! :D

MJE
Zac Medico
2018-08-06 22:39:27 UTC
Permalink
Post by M. J. Everitt
Post by Zac Medico
Post by Brian Dolbec
All these changes as well as the catlayst changes need to be
co-ordinated so that snapshots and portage and stages don't precede the
docs changes.
I suppose all of the docs changes can be made in advance, with mention
of both old a new locations. These commands can be used to check the
portageq get_repo_path / gentoo
portageq distdir
portageq pkgdir
Sounds like a plan .. do we need a tracker bug?! :P
Let's do this! :D
Ok, tracker created:

https://bugs.gentoo.org/662982
--
Thanks,
Zac
Zac Medico
2018-08-06 05:32:34 UTC
Permalink
Update all relevant references in docs, messages, and comments
to refer to /var/db/repos/gentoo instead of /usr/portage. Also
update DISTDIR and PKGDIR references to refer to the new
/var/cache/{distfiles,binpkgs} locations.

Bug: https://bugs.gentoo.org/378603
---
[PATCH 2/2 v2] fixes DISTDIR and PKGDIR references to rever to the
new /var/cache/{distfiles,binpkgs} locations

cnf/make.conf.example | 12 +++++------
lib/portage/__init__.py | 2 +-
lib/portage/cache/flat_hash.py | 2 +-
lib/portage/tests/news/test_NewsItem.py | 2 +-
lib/portage/tests/resolver/ResolverPlayground.py | 2 +-
lib/portage/xml/metadata.py | 4 ++--
man/ebuild.5 | 4 ++--
man/emerge.1 | 6 +++---
man/make.conf.5 | 20 +++++++++---------
man/portage.5 | 26 ++++++++++++------------
man/quickpkg.1 | 2 +-
repoman/lib/repoman/__init__.py | 2 +-
repoman/lib/repoman/checks/herds/herdbase.py | 2 +-
13 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/cnf/make.conf.example b/cnf/make.conf.example
index 04f3a0274..c16f2afbd 100644
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
@@ -14,7 +14,7 @@
# https://wiki.gentoo.org/wiki/Handbook:X86/Working/USE
#
# The available list of use flags with descriptions is in your portage tree.
-# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <--
+# Use 'less' to view them: --> less /var/db/repos/gentoo/profiles/use.desc <--
#
# 'ufed' is an ncurses/dialog interface available in portage to make handling
# useflags for you. 'emerge app-portage/ufed'
@@ -111,7 +111,7 @@
# will protect the default locations of DISTDIR and PKGDIR, but users are
# warned that any other locations inside PORTDIR are not necessarily safe
# for data storage.
-#PORTDIR=/usr/portage
+#PORTDIR=/var/db/repos/gentoo
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. After packages are built, it is safe to remove any and
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations under
-# /usr/portage are not necessarily safe for data storage. See the
+# /var/db/repos/gentoo are not necessarily safe for data storage. See the
# PORTDIR documentation for more information.
-#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/cache/distfiles
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
# up to several hundred megs, or even a few gigs. Note that
-# locations under /usr/portage are not necessarily safe for data
+# locations under /var/db/repos/gentoo are not necessarily safe for data
# storage. See the PORTDIR documentation for more information.
-#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/cache/binpkgs
#
# PORT_LOGDIR is the location where portage will store all the logs it
# creates from each individual merge. They are stored as
diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 166bfc700..61a240100 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -133,7 +133,7 @@ except ImportError as e:
sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n")
sys.stderr.write("!!! portage and failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
sys.stderr.write("!!! There is a README.RESCUE file that details the steps required to perform\n")
sys.stderr.write("!!! a recovery of portage.\n")
sys.stderr.write(" "+str(e)+"\n\n")
diff --git a/lib/portage/cache/flat_hash.py b/lib/portage/cache/flat_hash.py
index 79783245b..1ec32fb5b 100644
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
@@ -144,7 +144,7 @@ class database(fs_template.FsBased):
# Only recurse 1 deep, in order to avoid iteration over
# entries from another nested cache instance. This can
# happen if the user nests an overlay inside
- # /usr/portage/local as in bug #302764.
+ # /var/db/repos/gentoo/local as in bug #302764.
if depth < 1:
dirs.append((depth+1, p))
continue
diff --git a/lib/portage/tests/news/test_NewsItem.py b/lib/portage/tests/news/test_NewsItem.py
index 2f183a7e0..411b8d36d 100644
--- a/lib/portage/tests/news/test_NewsItem.py
+++ b/lib/portage/tests/news/test_NewsItem.py
@@ -43,7 +43,7 @@ against YourSQL:
The revdep-rebuild tool is provided by app-portage/gentoolkit.
"""
def setUp(self):
- self.profile = "/usr/portage/profiles/default-linux/x86/2007.0/"
+ self.profile = "/var/db/repos/gentoo/profiles/default-linux/x86/2007.0/"
self.keywords = "x86"
# Use fake/test dbapi to avoid slow tests
self.vardb = testdbapi()
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index e2e061669..c0fbb541b 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -350,7 +350,7 @@ class ResolverPlayground(object):
f.write("masters =\n")

if repo == "test_repo":
- #Create a minimal profile in /usr/portage
+ #Create a minimal profile in /var/db/repos/gentoo
sub_profile_dir = os.path.join(profile_dir, "default", "linux", "x86", "test_profile")
os.makedirs(sub_profile_dir)

diff --git a/lib/portage/xml/metadata.py b/lib/portage/xml/metadata.py
index 9e48dddde..8e82df0d0 100644
--- a/lib/portage/xml/metadata.py
+++ b/lib/portage/xml/metadata.py
@@ -5,9 +5,9 @@
from portage.xml.metadata import MetaDataXML
- >>> pkg_md = MetaDataXML('/usr/portage/app-misc/gourmet/metadata.xml')
+ >>> pkg_md = MetaDataXML('/var/db/repos/gentoo/app-misc/gourmet/metadata.xml')
pkg_md
- <MetaDataXML '/usr/portage/app-misc/gourmet/metadata.xml'>
+ <MetaDataXML '/var/db/repos/gentoo/app-misc/gourmet/metadata.xml'>
pkg_md.herds()
['no-herd']
diff --git a/man/ebuild.5 b/man/ebuild.5
index 9f491dd73..e6660c283 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -569,7 +569,7 @@ being submitted for inclusion, it must have ~arch set for architectures
where it has been PROVEN TO WORK. (Packages KEYWORDed this way may be
unmasked for testing by setting ACCEPT_KEYWORDS="~arch" on the command
line, or in \fBmake.conf\fR(5)) For an authoritative list please review
-/usr/portage/profiles/arch.list. Please keep this list in alphabetical order.
+/var/db/repos/gentoo/profiles/arch.list. Please keep this list in alphabetical order.
.TP
.B SLOT
This sets the SLOT for packages that may need to have multiple versions
@@ -592,7 +592,7 @@ usage.
.B LICENSE
This should be a space delimited list of licenses that the package falls
under. This \fB_must_\fR be set to a matching license in
-/usr/portage/licenses/. If the license does not exist in portage yet, you
+/var/db/repos/gentoo/licenses/. If the license does not exist in portage yet, you
must add it first.
.TP
.B IUSE
diff --git a/man/emerge.1 b/man/emerge.1
index f53ba92f5..21c3b854c 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -43,7 +43,7 @@ as \fBsys\-apps/portage\fR or \fB=python\-2.2.1\-r2\fR.
\fBemerge\fR
ignores a trailing slash so that filename completion can be used.
The \fIebuild\fR may also be an actual filename, such as
-\fB/usr/portage/app\-admin/python/python\-2.2.1\-r2.ebuild\fR.
+\fB/var/db/repos/gentoo/app\-admin/python/python\-2.2.1\-r2.ebuild\fR.
\fBWARNING:\fR The implementation of \fBemerge /path/to/ebuild\fR is broken and
so this syntax shouldn't be used.
.TP
@@ -1280,7 +1280,7 @@ avoid dependency conflicts and/or unsatisfied dependencies.
.BR package.mask
The \fBpackage.mask\fR file primarily blocks the use of packages that cause
problems or are known to have issues on different systems. It resides in
-\fI/usr/portage/profiles\fR.
+\fI/var/db/repos/gentoo/profiles\fR.
.TP
.BR CHOST
Use the \fBACCEPT_CHOSTS\fR variable in \fBmake.conf\fR(5) to control
@@ -1426,7 +1426,7 @@ files.
Contains profile\-specific variables for the build process. \fBDo not
edit this file\fR.
.TP
-.B /usr/portage/profiles/use.desc
+.B /var/db/repos/gentoo/profiles/use.desc
Contains the master list of USE flags with descriptions of their
functions. \fBDo not edit this file\fR.
.TP
diff --git a/man/make.conf.5 b/man/make.conf.5
index a4e33923c..ba5b8573e 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -219,10 +219,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/distfiles.
+Defaults to /var/cache/distfiles.
.TP
.B DOC_SYMLINKS_DIR
If this variable contains a directory then symlinks to html documentation will
@@ -800,10 +800,10 @@ 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.
+that locations under /var/db/repos/gentoo are not necessarily safe for data storage.
See the \fBPORTDIR\fR documentation for more information.
.br
-Defaults to /usr/portage/packages.
+Defaults to /var/cache/binpkgs.
.TP
.B PORT_LOGDIR
This variable defines the directory in which per\-ebuild logs are kept.
@@ -1033,7 +1033,7 @@ 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.
+Defaults to /var/db/repos/gentoo.
.br
\fB***Warning***\fR
.br
@@ -1118,7 +1118,7 @@ rsync://private\-mirror.com/portage\-module
.br
rsync://rsync\-***@private\-mirror.com:873/gentoo\-portage
.br
-ssh://ssh\-***@192.168.0.1:22/usr/portage
+ssh://ssh\-***@192.168.0.1:22/var/db/repos/gentoo
.br
ssh://ssh\-***@192.168.0.1:22/\\${HOME}/portage\-storage
.TP
@@ -1136,7 +1136,7 @@ Defaults to "/lib/modules/*".
\fBUSE\fR = \fI[space delimited list of USE items]\fR
This variable contains options that control the build behavior of several
packages. More information in \fBebuild\fR(5). Possible USE values
-can be found in \fI/usr/portage/profiles/use.desc\fR.
+can be found in \fI/var/db/repos/gentoo/profiles/use.desc\fR.
.TP
\fBUSE_ORDER\fR = \fI"env:pkg:conf:defaults:pkginternal:features:repo:env.d"\fR
Determines the precedence of layers in the incremental stacking of the USE
@@ -1173,7 +1173,7 @@ for FEATURES=\fBtest\fR.
.TP
.B repo
USE from make.defaults and package.use in the repo's profiles/ top dir
-(e.g. /usr/portage/profiles/package.use) (see \fBportage\fR(5))
+(e.g. /var/db/repos/gentoo/profiles/package.use) (see \fBportage\fR(5))
.TP
.B env.d
USE from the environment variables, such as LINGUAS, defined by files in
@@ -1203,10 +1203,10 @@ Contains the default variables for the build\-process, you should edit
.B /etc/portage/color.map
Contains variables customizing colors.
.TP
-.B /usr/portage/profiles/use.desc
+.B /var/db/repos/gentoo/profiles/use.desc
Contains a list of all global USE flags.
.TP
-.B /usr/portage/profiles/use.local.desc
+.B /var/db/repos/gentoo/profiles/use.local.desc
Contains a list of all local USE variables.
.SH "SEE ALSO"
.BR emerge (1),
diff --git a/man/portage.5 b/man/portage.5
index cd9d5036d..0db8c5258 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -77,18 +77,18 @@ site-specific overrides of \fB/etc/portage/make.profile/\fR
.BR /etc/portage/sets/
user\-defined package sets
.TP
-.BR /usr/portage/
+.BR /var/db/repos/gentoo/
.nf
sets.conf
.fi
.TP
-.BR /usr/portage/metadata/
+.BR /var/db/repos/gentoo/metadata/
.nf
layout.conf
pkg_desc_index
.fi
.TP
-.BR /usr/portage/profiles/
+.BR /var/db/repos/gentoo/profiles/
.nf
arch.list
categories
@@ -214,7 +214,7 @@ More reading:
.TP
\fB/etc/portage/make.profile/\fR or \fB/etc/make.profile/\fR
This is usually just a symlink to the correct profile in
-\fB/usr/portage/profiles/\fR. Since it is part of the portage tree, it
+\fB/var/db/repos/gentoo/profiles/\fR. Since it is part of the portage tree, it
may easily be updated/regenerated by running `emerge \-\-sync`. It defines
what a profile is (usually arch specific stuff). If you need a custom
profile, then you should make your own \fBmake.profile\fR
@@ -251,7 +251,7 @@ explaining how they can upgrade.
default-linux/x86/2005.0
# emerge -n '>=sys-apps/portage-2.0.51'
# rm -f /etc/portage/make.profile
-# ln -s /usr/portage/profiles/default-linux/alpha/2005.0 \
+# ln -s /var/db/repos/gentoo/profiles/default-linux/alpha/2005.0 \
/etc/portage/make.profile
.fi
.TP
@@ -644,7 +644,7 @@ The global custom settings for Portage. See \fBmake.conf\fR(5).
.BR mirrors
Whenever portage encounters a mirror:// style URI it will look up the actual
hosts here. If the mirror set is not found here, it will check the global
-mirrors file at /usr/portage/profiles/thirdpartymirrors. You may also set a
+mirrors file at /var/db/repos/gentoo/profiles/thirdpartymirrors. You may also set a
special mirror type called "local". This list of mirrors will be checked
before GENTOO_MIRRORS and will be used even if the package has
RESTRICT="mirror" or RESTRICT="fetch".
@@ -1059,7 +1059,7 @@ rsync://private\-mirror.com/portage\-module
.br
rsync://rsync\-***@private\-mirror.com:873/gentoo\-portage
.br
-ssh://ssh\-***@192.168.0.1:22/usr/portage
+ssh://ssh\-***@192.168.0.1:22/var/db/repos/gentoo
.br
ssh://ssh\-***@192.168.0.1:22/\\${HOME}/portage\-storage
.RE
@@ -1178,7 +1178,7 @@ masters =

# Repository 'gentoo' synchronized using CVS
[gentoo]
-location = /usr/portage
+location = /var/db/repos/gentoo
sync\-type = cvs
sync\-uri = :pserver:***@anoncvs.gentoo.org:/var/cvsroot
sync\-cvs\-repo = gentoo\-x86
@@ -1195,7 +1195,7 @@ auto\-sync = yes
.TP
.BR sets.conf
A package set configuration file. Settings here override settings from
-\fB/usr/portage/sets.conf\fR and \fB/usr/share/portage/config/sets\fR.
+\fB/var/db/repos/gentoo/sets.conf\fR and \fB/usr/share/portage/config/sets\fR.
The format is described extensively in the
\fIPackage Set Configuration\fR section of the html documentation which
is installed with portage when the "doc" USE flag is enabled.
@@ -1256,7 +1256,7 @@ Also see \fB/var/lib/portage/world_sets\fR and the \fBemerge\fR(1)
\fB\-\-list\-sets\fR option.
.RE
.TP
-.BR /usr/portage/
+.BR /var/db/repos/gentoo/
.RS
.TP
.BR sets.conf
@@ -1265,7 +1265,7 @@ which overrides these settings, and
\fB/usr/share/portage/config/sets\fR which contains default settings.
.RE
.TP
-.BR /usr/portage/metadata/
+.BR /var/db/repos/gentoo/metadata/
.RS
.TP
.BR layout.conf
@@ -1432,7 +1432,7 @@ sys-apps/usleep 0.1: A wrapper for usleep
.fi
.RE
.TP
-.BR /usr/portage/profiles/
+.BR /var/db/repos/gentoo/profiles/
Global Gentoo settings that are controlled by the developers. To override
these settings, you can use the files in \fB/etc/portage/\fR.
.RS
@@ -1643,7 +1643,7 @@ for \fB/etc/portage/repos.conf\fR.
.TP
.BR sets
A directory containing package set configuration files. Also see
-\fB/etc/portage/sets.conf\fR and \fB/usr/portage/sets.conf\fR, both of
+\fB/etc/portage/sets.conf\fR and \fB/var/db/repos/gentoo/sets.conf\fR, both of
which override values set here. Default set configurations are installed
in \fB/usr/share/portage/config/sets/portage.conf\fR.
.RE
diff --git a/man/quickpkg.1 b/man/quickpkg.1
index 06a1f0b6e..9ed366878 100644
--- a/man/quickpkg.1
+++ b/man/quickpkg.1
@@ -17,7 +17,7 @@ modified since they were first installed.
.br
The packages, after being created, will be placed in \fBPKGDIR\fR.
This variable is defined in \fBmake.conf\fR(5) and defaults to
-/usr/portage/packages.
+/var/cache/binpkgs.
.SH OPTIONS
.TP
.B <list of packages or package\-sets>
diff --git a/repoman/lib/repoman/__init__.py b/repoman/lib/repoman/__init__.py
index 89779b95c..d1312a267 100644
--- a/repoman/lib/repoman/__init__.py
+++ b/repoman/lib/repoman/__init__.py
@@ -14,7 +14,7 @@ except ImportError as e:
sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n")
sys.stderr.write("!!! portage and failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
sys.stderr.write("!!! There is a README.RESCUE file that details the steps required to perform\n")
sys.stderr.write("!!! a recovery of portage.\n")
sys.stderr.write(" "+str(e)+"\n\n")
diff --git a/repoman/lib/repoman/checks/herds/herdbase.py b/repoman/lib/repoman/checks/herds/herdbase.py
index ebe6a19b4..1e7c0b27c 100644
--- a/repoman/lib/repoman/checks/herds/herdbase.py
+++ b/repoman/lib/repoman/checks/herds/herdbase.py
@@ -119,7 +119,7 @@ def get_herd_base(repoman_settings):


if __name__ == '__main__':
- h = make_herd_base('/usr/portage/metadata/herds.xml')
+ h = make_herd_base('/var/db/repos/gentoo/metadata/herds.xml')

assert(h.known_herd('sound'))
assert(not h.known_herd('media-sound'))
--
2.16.4
Brian Dolbec
2018-08-06 07:44:41 UTC
Permalink
On Sun, 5 Aug 2018 22:32:34 -0700
Post by Zac Medico
Update all relevant references in docs, messages, and comments
to refer to /var/db/repos/gentoo instead of /usr/portage. Also
update DISTDIR and PKGDIR references to refer to the new
/var/cache/{distfiles,binpkgs} locations.
Bug: https://bugs.gentoo.org/378603
---
[PATCH 2/2 v2] fixes DISTDIR and PKGDIR references to rever to the
new /var/cache/{distfiles,binpkgs} locations
cnf/make.conf.example | 12 +++++------
lib/portage/__init__.py | 2 +-
lib/portage/cache/flat_hash.py | 2 +-
lib/portage/tests/news/test_NewsItem.py | 2 +-
lib/portage/tests/resolver/ResolverPlayground.py | 2 +-
lib/portage/xml/metadata.py | 4 ++--
man/ebuild.5 | 4 ++--
man/emerge.1 | 6 +++---
man/make.conf.5 | 20
+++++++++--------- man/portage.5 |
26 ++++++++++++------------
man/quickpkg.1 | 2 +-
repoman/lib/repoman/__init__.py | 2 +-
repoman/lib/repoman/checks/herds/herdbase.py | 2 +- 13 files
changed, 43 insertions(+), 43 deletions(-)
diff --git a/cnf/make.conf.example b/cnf/make.conf.example
index 04f3a0274..c16f2afbd 100644
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
@@ -14,7 +14,7 @@
# https://wiki.gentoo.org/wiki/Handbook:X86/Working/USE
#
# The available list of use flags with descriptions is in your
portage tree. -# Use 'less' to view them: -->
--> less /var/db/repos/gentoo/profiles/use.desc <-- #
# 'ufed' is an ncurses/dialog interface available in portage to make
handling # useflags for you. 'emerge app-portage/ufed'
@@ -111,7 +111,7 @@
# will protect the default locations of DISTDIR and PKGDIR, but
users are # warned that any other locations inside PORTDIR are
not necessarily safe # for data storage.
-#PORTDIR=/usr/portage
+#PORTDIR=/var/db/repos/gentoo
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. After packages are built, it is safe to remove any and
@@ -119,16 +119,16 @@
# fetched on demand for a given build. If you would like to
# selectively prune obsolete files from this directory, see
# eclean from the gentoolkit package. Note that locations under
-# /usr/portage are not necessarily safe for data storage. See the
+# /var/db/repos/gentoo are not necessarily safe for data
storage. See the # PORTDIR documentation for more information.
-#DISTDIR=/usr/portage/distfiles
+#DISTDIR=/var/cache/distfiles
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can
get # up to several hundred megs, or even a few gigs. Note that
-# locations under /usr/portage are not necessarily safe for data
+# locations under /var/db/repos/gentoo are not necessarily safe
for data # storage. See the PORTDIR documentation for more
information. -#PKGDIR=/usr/portage/packages
+#PKGDIR=/var/cache/binpkgs
#
# PORT_LOGDIR is the location where portage will store all the logs
it # creates from each individual merge. They are stored as
diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 166bfc700..61a240100 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
sys.stderr.write("!!! Failed to complete portage imports.
There are internal modules for\n") sys.stderr.write("!!! portage and
failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue
portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
This should also get updated replacing "portage tree" with "gentoo
tree"


...
Post by Zac Medico
The packages, after being created, will be placed in \fBPKGDIR\fR.
This variable is defined in \fBmake.conf\fR(5) and defaults to
-/usr/portage/packages.
+/var/cache/binpkgs.
.SH OPTIONS
.TP
.B <list of packages or package\-sets>
diff --git a/repoman/lib/repoman/__init__.py
b/repoman/lib/repoman/__init__.py index 89779b95c..d1312a267 100644
--- a/repoman/lib/repoman/__init__.py
+++ b/repoman/lib/repoman/__init__.py
sys.stderr.write("!!! Failed to complete portage imports.
There are internal modules for\n") sys.stderr.write("!!! portage and
failure here indicates that you have a problem with your\n")
sys.stderr.write("!!! installation of portage. Please try a rescue
portage located in the\n")
- sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n")
+ sys.stderr.write("!!! portage tree under '/var/db/repos/gentoo/sys-apps/portage/files/' (default).\n")
same again here replace "portage tree" with "gentoo tree"
Post by Zac Medico
sys.stderr.write("!!! There is a README.RESCUE file that details the
steps required to perform\n") sys.stderr.write("!!! a recovery of
portage.\n") sys.stderr.write(" "+str(e)+"\n\n") diff --git
a/repoman/lib/repoman/checks/herds/herdbase.py
b/repoman/lib/repoman/checks/herds/herdbase.py index
ebe6a19b4..1e7c0b27c 100644 ---
a/repoman/lib/repoman/checks/herds/herdbase.py +++
- h = make_herd_base('/usr/portage/metadata/herds.xml')
+ h = make_herd_base('/var/db/repos/gentoo/metadata/herds.xml')
assert(h.known_herd('sound'))
assert(not h.known_herd('media-sound'))
Has it been long enough since herds are removed from gentoo that we
can drop the herds code completey? but otherwise the change itself is
fine.
Zac Medico
2018-08-06 18:46:14 UTC
Permalink
Post by Brian Dolbec
On Sun, 5 Aug 2018 22:32:34 -0700
Post by Zac Medico
a/repoman/lib/repoman/checks/herds/herdbase.py
b/repoman/lib/repoman/checks/herds/herdbase.py index
ebe6a19b4..1e7c0b27c 100644 ---
a/repoman/lib/repoman/checks/herds/herdbase.py +++
- h = make_herd_base('/usr/portage/metadata/herds.xml')
+ h = make_herd_base('/var/db/repos/gentoo/metadata/herds.xml')
assert(h.known_herd('sound'))
assert(not h.known_herd('media-sound'))
Has it been long enough since herds are removed from gentoo that we
can drop the herds code completey? but otherwise the change itself is
fine.
Yeah, let's remove it:

https://github.com/gentoo/portage/pull/353
--
Thanks,
Zac
Loading...