aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cnf/make.globals2
-rw-r--r--lib/portage/_compat_upgrade/default_locations.py13
-rw-r--r--man/make.conf.54
3 files changed, 15 insertions, 4 deletions
diff --git a/cnf/make.globals b/cnf/make.globals
index b01cca599..9eeb7a01e 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -29,7 +29,7 @@ ACCEPT_RESTRICT="*"
# Miscellaneous paths
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"
-RPMDIR="/usr/portage/rpm"
+RPMDIR="/var/cache/rpm"
# Temporary build directory
PORTAGE_TMPDIR="/var/tmp"
diff --git a/lib/portage/_compat_upgrade/default_locations.py b/lib/portage/_compat_upgrade/default_locations.py
index 91f300637..e61a72e3d 100644
--- a/lib/portage/_compat_upgrade/default_locations.py
+++ b/lib/portage/_compat_upgrade/default_locations.py
@@ -9,6 +9,7 @@ from portage.const import GLOBAL_CONFIG_PATH
COMPAT_DISTDIR = 'usr/portage/distfiles'
COMPAT_PKGDIR = 'usr/portage/packages'
+COMPAT_RPMDIR = 'usr/portage/rpm'
COMPAT_MAIN_REPO = 'usr/portage'
@@ -46,13 +47,19 @@ def main():
except OSError:
do_pkgdir = False
+ compat_rpmdir = os.path.join(portage.const.EPREFIX or '/', COMPAT_RPMDIR)
+ try:
+ do_rpmdir = os.path.samefile(config['RPMDIR'], compat_rpmdir)
+ except OSError:
+ do_rpmdir = 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:
+ if do_distdir or do_pkgdir or do_rpmdir:
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()
@@ -64,6 +71,10 @@ def main():
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)
+ if do_rpmdir:
+ compat_setting = 'RPMDIR="{}"'.format(compat_rpmdir)
+ out.einfo('Setting make.globals default {} for backward compatibility'.format(compat_setting))
+ content = re.sub('^RPMDIR=.*$', compat_setting, content, flags=re.MULTILINE)
with open(config_path, 'wt') as f:
f.write(content)
diff --git a/man/make.conf.5 b/man/make.conf.5
index 4c9f00675..d73bb9bac 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Apr 2019" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jun 2019" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -1125,7 +1125,7 @@ Defaults to /.
\fBRPMDIR\fR = \fI[path]\fR
Defines the location where created RPM packages will be stored.
.br
-Defaults to /usr/portage/rpm.
+Defaults to /var/cache/rpm.
.TP
\fBSYNC\fR = \fI[RSYNC]\fR
Insert your preferred rsync mirror here. This rsync server