commit: 4fc481827a27a2f83ccc466ec4b47057a8ec949b Author: M. J. Everitt <m.j.everitt <AT> iee <DOT> org> AuthorDate: Sat Dec 15 01:50:17 2018 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Thu Dec 20 04:24:29 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4fc48182
Renamed PORT_LOGDIR[_CLEAN] to PORTAGE_LOGDIR[_CLEAN] To match similar existing PORTAGE_* variables Suggested-by: Zac Medico <zmedico <AT> gentoo.org> Acked-by: Michael Everitt <m.j.everitt <AT> iee.org> Bug: https://bugs.gentoo.org/668538 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> NEWS | 2 +- cnf/make.conf.example | 12 +++++----- cnf/make.globals | 2 +- lib/_emerge/post_emerge.py | 2 +- lib/portage/dbapi/vartree.py | 2 +- lib/portage/elog/mod_echo.py | 2 +- lib/portage/elog/mod_save.py | 4 ++-- lib/portage/elog/mod_save_summary.py | 4 ++-- lib/portage/emaint/modules/logs/__init__.py | 2 +- lib/portage/emaint/modules/logs/logs.py | 22 +++++++++--------- .../package/ebuild/_config/special_env_vars.py | 2 +- lib/portage/package/ebuild/prepare_build_dirs.py | 26 +++++++++++----------- lib/portage/tests/emerge/test_simple.py | 2 +- man/ebuild.5 | 2 +- man/emaint.1 | 6 ++--- man/emerge.1 | 2 +- man/make.conf.5 | 18 +++++++-------- 17 files changed, 56 insertions(+), 56 deletions(-) diff --git a/NEWS b/NEWS index f77c310e3..b430f273f 100644 --- a/NEWS +++ b/NEWS @@ -389,7 +389,7 @@ portage-2.1 (ongoing via pre releases) * Make --emptytree only apply to ${ROOT} rather than always including /. * Allow packages to be upgraded that are only depended on via a "|| ( =cat/pkg-1* =cat/pkg-2* )" construct. -* Ebuild output is no longer cut off early when using PORT_LOGDIR. +* Ebuild output is no longer cut off early when using PORTAGE_LOGDIR. * Distfiles indirection- $DISTFILES access goes through a tmp dir to fail access to files not listed in SRC_URI. * Emerge now uses --resume to restart itself after portage upgrade. diff --git a/cnf/make.conf.example b/cnf/make.conf.example index 36fc9a8e4..ffebd24d4 100644 --- a/cnf/make.conf.example +++ b/cnf/make.conf.example @@ -130,13 +130,13 @@ # storage. See the PORTDIR documentation for more information. #PKGDIR=/usr/portage/packages # -# PORT_LOGDIR is the location where portage will store all the logs it +# PORTAGE_LOGDIR is the location where portage will store all the logs it # creates from each individual merge. They are stored as # ${CATEGORY}:${PF}:YYYYMMDD-HHMMSS.log in the directory specified. # If the directory does not exist, it will be created automatically and # group permissions will be applied to it. If the directory already # exists, portage will not modify its permissions. -#PORT_LOGDIR="" +#PORTAGE_LOGDIR="" # # PORTDIR_OVERLAY is a directory where local ebuilds may be stored without # concern that they will be deleted by rsync updates. Default is not @@ -306,16 +306,16 @@ # PORTAGE_ELOG_SYSTEM: selects the module(s) to process the log messages. Modules # included in portage are (empty means logging is disabled): # echo (display messages again when emerge exits) -# save (saves one log per package in $PORT_LOGDIR/elog, -# /var/log/portage/elog if $PORT_LOGDIR is unset) +# save (saves one log per package in $PORTAGE_LOGDIR/elog, +# /var/log/portage/elog if $PORTAGE_LOGDIR is unset) # custom (passes all messages to $PORTAGE_ELOG_COMMAND) # syslog (sends all messages to syslog) # mail (send all messages to the mailserver defined # in $PORTAGE_ELOG_MAILURI) # save_summary (like "save" but merges all messages -# in $PORT_LOGDIR/elog/summary.log, +# in $PORTAGE_LOGDIR/elog/summary.log, # /var/log/portage/elog/summary.log if -# $PORT_LOGDIR is unset) +# $PORTAGE_LOGDIR is unset) # mail_summary (like "mail" but sends all messages in # a single mail when emerge exits) # To use elog you should enable at least one module diff --git a/cnf/make.globals b/cnf/make.globals index 1bcc7ce64..5a3015ae2 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -101,7 +101,7 @@ PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir- PORTAGE_SYNC_STALE="30" # Executed before emerge exit if FEATURES=clean-logs is enabled. -PORT_LOGDIR_CLEAN="find \"\${PORT_LOGDIR}\" -type f ! -name \"summary.log*\" -mtime +7 -delete" +PORTAGE_LOGDIR_CLEAN="find \"\${PORTAGE_LOGDIR}\" -type f ! -name \"summary.log*\" -mtime +7 -delete" # Minimal CONFIG_PROTECT CONFIG_PROTECT="/etc" diff --git a/lib/_emerge/post_emerge.py b/lib/_emerge/post_emerge.py index 7e6063c52..e971cf40d 100644 --- a/lib/_emerge/post_emerge.py +++ b/lib/_emerge/post_emerge.py @@ -24,7 +24,7 @@ def clean_logs(settings): if "clean-logs" not in settings.features: return - logdir = settings.get("PORT_LOGDIR") + logdir = settings.get("PORTAGE_LOGDIR") if logdir is None or not os.path.isdir(logdir): return diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py index fd8aaeb8e..9febf0c71 100644 --- a/lib/portage/dbapi/vartree.py +++ b/lib/portage/dbapi/vartree.py @@ -2225,7 +2225,7 @@ class dblink(object): # Restore this since it gets lost somewhere above and it # needs to be set for _display_merge() to be able to log. # Note that the log isn't necessarily supposed to exist - # since if PORT_LOGDIR is unset then it's a temp file + # since if PORTAGE_LOGDIR is unset then it's a temp file # so it gets cleaned above. self.settings["PORTAGE_LOG_FILE"] = log_path else: diff --git a/lib/portage/elog/mod_echo.py b/lib/portage/elog/mod_echo.py index fb86547a4..8cdf6ac7d 100644 --- a/lib/portage/elog/mod_echo.py +++ b/lib/portage/elog/mod_echo.py @@ -20,7 +20,7 @@ def process(mysettings, key, logentries, fulltext): # output logfile explicitly only if it isn't in tempdir, otherwise # it will be removed anyway if (key == mysettings.mycpv and - "PORT_LOGDIR" in mysettings and + "PORTAGE_LOGDIR" in mysettings and "PORTAGE_LOG_FILE" in mysettings): logfile = mysettings["PORTAGE_LOG_FILE"] _items.append((mysettings["ROOT"], key, logentries, logfile)) diff --git a/lib/portage/elog/mod_save.py b/lib/portage/elog/mod_save.py index 829ec6c5e..a98ca9377 100644 --- a/lib/portage/elog/mod_save.py +++ b/lib/portage/elog/mod_save.py @@ -16,8 +16,8 @@ from portage.util import apply_permissions, ensure_dirs, normalize_path def process(mysettings, key, logentries, fulltext): - if mysettings.get("PORT_LOGDIR"): - logdir = normalize_path(mysettings["PORT_LOGDIR"]) + if mysettings.get("PORTAGE_LOGDIR"): + logdir = normalize_path(mysettings["PORTAGE_LOGDIR"]) else: logdir = os.path.join(os.sep, mysettings["EPREFIX"].lstrip(os.sep), "var", "log", "portage") diff --git a/lib/portage/elog/mod_save_summary.py b/lib/portage/elog/mod_save_summary.py index 786f89454..e4924b66b 100644 --- a/lib/portage/elog/mod_save_summary.py +++ b/lib/portage/elog/mod_save_summary.py @@ -19,8 +19,8 @@ from portage.package.ebuild.prepare_build_dirs import _ensure_log_subdirs from portage.util import apply_permissions, ensure_dirs, normalize_path def process(mysettings, key, logentries, fulltext): - if mysettings.get("PORT_LOGDIR"): - logdir = normalize_path(mysettings["PORT_LOGDIR"]) + if mysettings.get("PORTAGE_LOGDIR"): + logdir = normalize_path(mysettings["PORTAGE_LOGDIR"]) else: logdir = os.path.join(os.sep, mysettings["EPREFIX"].lstrip(os.sep), "var", "log", "portage") diff --git a/lib/portage/emaint/modules/logs/__init__.py b/lib/portage/emaint/modules/logs/__init__.py index 5b78d71ff..ab83155e3 100644 --- a/lib/portage/emaint/modules/logs/__init__.py +++ b/lib/portage/emaint/modules/logs/__init__.py @@ -1,7 +1,7 @@ # Copyright 2005-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -doc = """Check and clean old logs in the PORT_LOGDIR.""" +doc = """Check and clean old logs in the PORTAGE_LOGDIR.""" __doc__ = doc diff --git a/lib/portage/emaint/modules/logs/logs.py b/lib/portage/emaint/modules/logs/logs.py index 97b45475d..a3fa2b5b8 100644 --- a/lib/portage/emaint/modules/logs/logs.py +++ b/lib/portage/emaint/modules/logs/logs.py @@ -6,17 +6,17 @@ from portage import os from portage.util import shlex_split, varexpand ## default clean command from make.globals -## PORT_LOGDIR_CLEAN = 'find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +7 -delete' +## PORTAGE_LOGDIR_CLEAN = 'find "${PORTAGE_LOGDIR}" -type f ! -name "summary.log*" -mtime +7 -delete' ERROR_MESSAGES = { - 78 : "PORT_LOGDIR variable not set or PORT_LOGDIR not a directory.", - 127 : "PORT_LOGDIR_CLEAN command not found." + 78 : "PORTAGE_LOGDIR variable not set or PORTAGE_LOGDIR not a directory.", + 127 : "PORTAGE_LOGDIR_CLEAN command not found." } class CleanLogs(object): - short_desc = "Clean PORT_LOGDIR logs" + short_desc = "Clean PORTAGE_LOGDIR logs" @staticmethod def name(): @@ -39,8 +39,8 @@ class CleanLogs(object): @param **kwargs: optional dictionary of values used in this function are: settings: portage settings instance: defaults to portage.settings - "PORT_LOGDIR": directory to clean - "PORT_LOGDIR_CLEAN": command for cleaning the logs. + "PORTAGE_LOGDIR": directory to clean + "PORTAGE_LOGDIR_CLEAN": command for cleaning the logs. options: dict: 'NUM': int: number of days 'pretend': boolean @@ -57,7 +57,7 @@ class CleanLogs(object): num_of_days = options.get('NUM', None) pretend = options.get('pretend', False) - clean_cmd = settings.get("PORT_LOGDIR_CLEAN") + clean_cmd = settings.get("PORTAGE_LOGDIR_CLEAN") if clean_cmd: clean_cmd = shlex_split(clean_cmd) if '-mtime' in clean_cmd and num_of_days is not None: @@ -83,11 +83,11 @@ class CleanLogs(object): @staticmethod def _clean_logs(clean_cmd, settings): - logdir = settings.get("PORT_LOGDIR") + logdir = settings.get("PORTAGE_LOGDIR") if logdir is None or not os.path.isdir(logdir): return 78 - variables = {"PORT_LOGDIR" : logdir} + variables = {"PORTAGE_LOGDIR" : logdir} cmd = [varexpand(x, mydict=variables) for x in clean_cmd] try: @@ -104,7 +104,7 @@ class CleanLogs(object): if rval in ERROR_MESSAGES: msg.append(ERROR_MESSAGES[rval]) else: - msg.append("PORT_LOGDIR_CLEAN command returned %s" % rval) + msg.append("PORTAGE_LOGDIR_CLEAN command returned %s" % rval) msg.append("See the make.conf(5) man page for " - "PORT_LOGDIR_CLEAN usage instructions.") + "PORTAGE_LOGDIR_CLEAN usage instructions.") return msg diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py b/lib/portage/package/ebuild/_config/special_env_vars.py index a308518af..f4f2bec2c 100644 --- a/lib/portage/package/ebuild/_config/special_env_vars.py +++ b/lib/portage/package/ebuild/_config/special_env_vars.py @@ -176,7 +176,7 @@ environ_filter += [ "PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS", "PORTAGE_RSYNC_RETRIES", "PORTAGE_SSH_OPTS", "PORTAGE_SYNC_STALE", "PORTAGE_USE", - "PORT_LOGDIR", "PORT_LOGDIR_CLEAN", + "PORTAGE_LOGDIR", "PORTAGE_LOGDIR_CLEAN", "QUICKPKG_DEFAULT_OPTS", "REPOMAN_DEFAULT_OPTS", "RESUMECOMMAND", "RESUMECOMMAND_FTP", "RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTPS", diff --git a/lib/portage/package/ebuild/prepare_build_dirs.py b/lib/portage/package/ebuild/prepare_build_dirs.py index e53ccd0fb..c325819d1 100644 --- a/lib/portage/package/ebuild/prepare_build_dirs.py +++ b/lib/portage/package/ebuild/prepare_build_dirs.py @@ -278,36 +278,36 @@ def _prepare_workdir(mysettings): except FileNotFound: pass # ebuild.sh will create it - if mysettings.get("PORT_LOGDIR", "") == "": - while "PORT_LOGDIR" in mysettings: - del mysettings["PORT_LOGDIR"] - if "PORT_LOGDIR" in mysettings: + if mysettings.get("PORTAGE_LOGDIR", "") == "": + while "PORTAGE_LOGDIR" in mysettings: + del mysettings["PORTAGE_LOGDIR"] + if "PORTAGE_LOGDIR" in mysettings: try: - modified = ensure_dirs(mysettings["PORT_LOGDIR"]) + modified = ensure_dirs(mysettings["PORTAGE_LOGDIR"]) if modified: # Only initialize group/mode if the directory doesn't # exist, so that we don't override permissions if they # were previously set by the administrator. # NOTE: These permissions should be compatible with our # default logrotate config as discussed in bug 374287. - apply_secpass_permissions(mysettings["PORT_LOGDIR"], + apply_secpass_permissions(mysettings["PORTAGE_LOGDIR"], uid=portage_uid, gid=portage_gid, mode=0o2770) except PortageException as e: writemsg("!!! %s\n" % str(e), noiselevel=-1) - writemsg(_("!!! Permission issues with PORT_LOGDIR='%s'\n") % \ - mysettings["PORT_LOGDIR"], noiselevel=-1) + writemsg(_("!!! Permission issues with PORTAGE_LOGDIR='%s'\n") % \ + mysettings["PORTAGE_LOGDIR"], noiselevel=-1) writemsg(_("!!! Disabling logging.\n"), noiselevel=-1) - while "PORT_LOGDIR" in mysettings: - del mysettings["PORT_LOGDIR"] + while "PORTAGE_LOGDIR" in mysettings: + del mysettings["PORTAGE_LOGDIR"] compress_log_ext = '' if 'compress-build-logs' in mysettings.features: compress_log_ext = '.gz' logdir_subdir_ok = False - if "PORT_LOGDIR" in mysettings and \ - os.access(mysettings["PORT_LOGDIR"], os.W_OK): - logdir = normalize_path(mysettings["PORT_LOGDIR"]) + if "PORTAGE_LOGDIR" in mysettings and \ + os.access(mysettings["PORTAGE_LOGDIR"], os.W_OK): + logdir = normalize_path(mysettings["PORTAGE_LOGDIR"]) logid_path = os.path.join(mysettings["PORTAGE_BUILDDIR"], ".logid") if not os.path.exists(logid_path): open(_unicode_encode(logid_path), 'w').close() diff --git a/lib/portage/tests/emerge/test_simple.py b/lib/portage/tests/emerge/test_simple.py index b1402ddd5..866521488 100644 --- a/lib/portage/tests/emerge/test_simple.py +++ b/lib/portage/tests/emerge/test_simple.py @@ -420,7 +420,7 @@ call_has_and_best_version() { "PORTAGE_PYTHON" : portage_python, "PORTAGE_REPOSITORIES" : settings.repositories.config_string(), "PORTAGE_TMPDIR" : portage_tmpdir, - "PORT_LOGDIR" : portage_tmpdir, + "PORTAGE_LOGDIR" : portage_tmpdir, "PYTHONDONTWRITEBYTECODE" : os.environ.get("PYTHONDONTWRITEBYTECODE", ""), "PYTHONPATH" : pythonpath, "__PORTAGE_TEST_PATH_OVERRIDE" : fake_bin, diff --git a/man/ebuild.5 b/man/ebuild.5 index d085d5a92..5ae84eb74 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -488,7 +488,7 @@ excluded during genertion of \fBPROVIDES\fR metadata (see possible to create patterns containing quoted whitespace. .TP .B PORTAGE_LOG_FILE -Contains the path of the build log. If \fBPORT_LOGDIR\fR variable is unset then +Contains the path of the build log. If \fBPORTAGE_LOGDIR\fR variable is unset then PORTAGE_LOG_FILE=\fI"${T}/build.log"\fR. .TP .B PORTAGE_SOCKS5_PROXY diff --git a/man/emaint.1 b/man/emaint.1 index 4ded0058a..d244756e9 100644 --- a/man/emaint.1 +++ b/man/emaint.1 @@ -32,8 +32,8 @@ Discard merge lists saved for the \fBemerge\fR(1) \fB--resume\fR action. OPTIONS: check, fix .TP .BR logs -Clean out old logs from the \fBPORT_LOGDIR\fR using the command -\fBPORT_LOGDIR_CLEAN\fR. +Clean out old logs from the \fBPORTAGE_LOGDIR\fR using the command +\fBPORTAGE_LOGDIR_CLEAN\fR. See the \fBmake.conf\fR(5) man page for additional information as well as enabling the \fB'clean-logs'\fR feature in emerge to do this automatically. .br @@ -73,7 +73,7 @@ Fix any problems that may exist. .SH OPTIONS logs command only .TP .BR \-C ", " \-\-clean -Cleans the logs from \fBPORT_LOGDIR\fR +Cleans the logs from \fBPORTAGE_LOGDIR\fR .TP .BR \-p ", " \-\-pretend Sets pretend mode (same as \-c, \-\-check) for use with the \-C, \-\-clean diff --git a/man/emerge.1 b/man/emerge.1 index 8662f5514..6f53680b4 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -584,7 +584,7 @@ matches any of the given package atoms. Clean up temporary files after a build failure. This is particularly useful if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this option is enabled, you probably also want -to enable \fBPORT_LOGDIR\fR (see \fBmake.conf\fR(5)) in +to enable \fBPORTAGE_LOGDIR\fR (see \fBmake.conf\fR(5)) in order to save the build log. .TP .BR \-\-fetchonly ", " \-f diff --git a/man/make.conf.5 b/man/make.conf.5 index de04e5e34..a0faf51bf 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -291,7 +291,7 @@ strips (or splits) them before installing. .TP .B binpkg\-logs Keep logs from successful binary package merges. This is relevant only when -\fBPORT_LOGDIR\fR is set. +\fBPORTAGE_LOGDIR\fR is set. .TP .B binpkg\-multi\-instance Enable support for multiple binary package instances per ebuild. @@ -356,8 +356,8 @@ emerge to safely kill all subprocesses when ebuild phase exits. .TP .B clean\-logs Enable automatic execution of the command specified by the -PORT_LOGDIR_CLEAN variable. The default PORT_LOGDIR_CLEAN setting will -remove all files from PORT_LOGDIR that were last modified at least 7 +PORTAGE_LOGDIR_CLEAN variable. The default PORTAGE_LOGDIR_CLEAN setting will +remove all files from PORTAGE_LOGDIR that were last modified at least 7 days ago. .TP .B collision\-protect @@ -422,7 +422,7 @@ concurrently. Also see \fIparallel\-install\fR. .B fail\-clean Clean up temporary files after a build failure. This is particularly useful if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you -probably also want to enable \fBPORT_LOGDIR\fR in order to save the build log. +probably also want to enable \fBPORTAGE_LOGDIR\fR in order to save the build log. Both the \fBebuild\fR(1) command and the \fInoclean\fR feature cause the \fIfail\-clean\fR feature to be automatically disabled. .TP @@ -632,12 +632,12 @@ incompatibility. .TP .B split\-elog Store logs created by \fBPORTAGE_ELOG_SYSTEM="save"\fR in category -subdirectories of \fBPORT_LOGDIR/elog\fR, instead of using -\fBPORT_LOGDIR/elog\fR directly. +subdirectories of \fBPORTAGE_LOGDIR/elog\fR, instead of using +\fBPORTAGE_LOGDIR/elog\fR directly. .TP .B split\-log -Store build logs in category subdirectories of \fBPORT_LOGDIR/build\fR, -instead of using \fBPORT_LOGDIR\fR directly. +Store build logs in category subdirectories of \fBPORTAGE_LOGDIR/build\fR, +instead of using \fBPORTAGE_LOGDIR\fR directly. .TP .B splitdebug Prior to stripping ELF etdyn and etexec files, the debugging info is @@ -691,7 +691,7 @@ Also see the related \fIdowngrade\-backup\fR feature. .TP .B unmerge\-logs Keep logs from successful unmerge phases. This is relevant only when -\fBPORT_LOGDIR\fR is set. +\fBPORTAGE_LOGDIR\fR is set. .TP .B unmerge\-orphans If a file is not claimed by another package in the same slot and it is not