Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 668538

Summary: sys-apps/portage: rename PORT_LOGDIR and PORT_LOGDIR_CLEAN variables to PORTAGE_LOGDIR and PORTAGE_LOGDIR_CLEAN
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, josef64
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 671498    

Description Zac Medico gentoo-dev 2018-10-13 21:32:05 UTC
The PORT_LOGDIR and PORT_LOGDIR_CLEAN variables are the only variables that start with PORT_. For consistency, we can add support for PORTAGE_LOGDIR and PORTAGE_LOGDIR_CLEAN, and make the previous variables into aliases that we can deprecate.
Comment 1 Michael 'veremitz' Everitt 2018-10-13 21:35:08 UTC
Wondered whether I was going mad, when I had 'PORTAGE_LOGDIR' in my make.confs, and nothing was happening...

Thanks Zac for the troubleshooting, and bug!
Comment 2 Zac Medico gentoo-dev 2018-12-15 00:09:40 UTC
This is a start: git grep -l PORT_LOGDIR | xargs sed -i 's:PORT_LOGDIR:PORTAGE_LOGDIR:g'

In lib/portage/package/ebuild/config.py we can add the fallback in the _getitem method, just before the end: raise KeyError(mykey).

We can have a dictionary, defined near _constant_keys, like:

    _deprecated_keys = {'PORTAGE_LOGDIR': 'PORT_LOGDIR'}

Do something like this:

  deprecated_key = self._deprecated_keys.get(mykey)
  if deprecated_key is not None:
    value = self._getitem(deprecated_key)
    warnings.warn("{} replaced by {}".format(deprecated_key, mykey), UserWarning)
    return value
Comment 3 Michael 'veremitz' Everitt 2018-12-15 02:40:05 UTC
Submitted for review:

https://archives.gentoo.org/gentoo-portage-dev/message/ed654e121c931ebc7ede92b110a06f62
Comment 4 Larry the Git Cow gentoo-dev 2018-12-20 04:29:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=45dc31673576cf9faca1ac5304e9c067ace27bb7

commit 45dc31673576cf9faca1ac5304e9c067ace27bb7
Author:     M. J. Everitt <m.j.everitt@iee.org>
AuthorDate: 2018-12-15 02:00:49 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-12-20 04:24:32 +0000

    Add note to NEWS/ChangeLog for PORT_LOGDIR* changes
    
    Suggested-by: Michael Everitt <m.j.everitt@iee.org>
    Bug: https://bugs.gentoo.org/668538
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 NEWS | 6 ++++++
 1 file changed, 6 insertions(+)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=38262ec5c16907161a5e4720d620f7c36be86941

commit 38262ec5c16907161a5e4720d620f7c36be86941
Author:     M. J. Everitt <m.j.everitt@iee.org>
AuthorDate: 2018-12-15 01:59:00 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-12-20 04:24:32 +0000

    Update documentation for PORT_LOGDIR* changes
    
    Suggested-by: Michael Everitt <m.j.everitt@iee.org>
    Bug: https://bugs.gentoo.org/668538
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 man/make.conf.5 | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=22e8951521558a4488a44f4bdd276ced7c24b950

commit 22e8951521558a4488a44f4bdd276ced7c24b950
Author:     M. J. Everitt <m.j.everitt@iee.org>
AuthorDate: 2018-12-15 01:52:54 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-12-20 04:24:31 +0000

    Provide compatibility support for old PORT_LOGDIR* variable names
    
    Suggested-by: Zac Medico <zmedico@gentoo.org>
    Acked-by: Michael Everitt <m.j.everitt@iee.org>
    Bug: https://bugs.gentoo.org/668538
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/package/ebuild/config.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=4fc481827a27a2f83ccc466ec4b47057a8ec949b

commit 4fc481827a27a2f83ccc466ec4b47057a8ec949b
Author:     M. J. Everitt <m.j.everitt@iee.org>
AuthorDate: 2018-12-15 01:50:17 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-12-20 04:24:29 +0000

    Renamed PORT_LOGDIR[_CLEAN] to PORTAGE_LOGDIR[_CLEAN]
    
    To match similar existing PORTAGE_* variables
    
    Suggested-by: Zac Medico <zmedico@gentoo.org>
    Acked-by: Michael Everitt <m.j.everitt@iee.org>
    Bug: https://bugs.gentoo.org/668538
    Signed-off-by: Zac Medico <zmedico@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(-)
Comment 5 Zac Medico gentoo-dev 2019-04-10 04:34:56 UTC
Fixed in portage-2.3.62.