public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/_config/
Date: Thu, 23 Jan 2020 06:04:48 +0000 (UTC)	[thread overview]
Message-ID: <1579759274.7e50a057958624dd728e858a3c07517240f85d02.zmedico@gentoo> (raw)

commit:     7e50a057958624dd728e858a3c07517240f85d02
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 18 06:06:27 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan 23 06:01:14 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7e50a057

UserWarning if /etc/portage/package.keywords exists

The /etc/portage/package.keywords file has been long deprecated
in favor of /etc/portage/package.accept_keywords. The file would
be useful if we could make it behave like package.keywords in
profiles (see bug 491166), but it's safest if we trigger a
UserWarning for some time before we change the meaning in a
future version of portage. The message looks like this:

UserWarning: /etc/portage/package.keywords is deprecated, use /etc/portage/package.accept_keywords instead

Bug: https://bugs.gentoo.org/491166
Bug: https://bugs.gentoo.org/607852
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/package/ebuild/_config/KeywordsManager.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/portage/package/ebuild/_config/KeywordsManager.py b/lib/portage/package/ebuild/_config/KeywordsManager.py
index fd0a6318d..1c12ce58e 100644
--- a/lib/portage/package/ebuild/_config/KeywordsManager.py
+++ b/lib/portage/package/ebuild/_config/KeywordsManager.py
@@ -5,6 +5,8 @@ __all__ = (
 	'KeywordsManager',
 )
 
+import warnings
+
 from _emerge.Package import Package
 from portage import os
 from portage.dep import ExtendedAtomDict, _repo_separator, _slot_separator
@@ -54,13 +56,20 @@ class KeywordsManager(object):
 		self.pkeywordsdict = ExtendedAtomDict(dict)
 
 		if user_config:
+			user_accept_kwrds_path = os.path.join(abs_user_config, "package.accept_keywords")
+			user_kwrds_path = os.path.join(abs_user_config, "package.keywords")
 			pkgdict = grabdict_package(
-				os.path.join(abs_user_config, "package.keywords"),
+				user_kwrds_path,
 				recursive=1, allow_wildcard=True, allow_repo=True,
 				verify_eapi=False, allow_build_id=True)
 
+			if pkgdict:
+				warnings.warn(_("%s is deprecated, use %s instead") %
+					(user_kwrds_path, user_accept_kwrds_path),
+					UserWarning)
+
 			for k, v in grabdict_package(
-				os.path.join(abs_user_config, "package.accept_keywords"),
+				user_accept_kwrds_path,
 				recursive=1, allow_wildcard=True, allow_repo=True,
 				verify_eapi=False, allow_build_id=True).items():
 				pkgdict.setdefault(k, []).extend(v)


             reply	other threads:[~2020-01-23  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  6:04 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-03 21:42 [gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/_config/ Zac Medico
2020-04-12 23:46 Zac Medico
2020-01-28  5:04 Zac Medico
2019-05-20 19:47 Zac Medico
2018-08-17 23:13 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1579759274.7e50a057958624dd728e858a3c07517240f85d02.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox