public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/ekeyword/
Date: Wed, 27 Jan 2016 23:35:01 +0000 (UTC)	[thread overview]
Message-ID: <1453937577.1b33e0ae109e11b1ee696ea6c6919bb86ecbc66f.vapier@gentoo> (raw)

commit:     1b33e0ae109e11b1ee696ea6c6919bb86ecbc66f
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 27 23:32:57 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 23:32:57 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1b33e0ae

ekeyword: fix "all" keyword handling w/-keywords

When an ebuild has a keyword like '-sparc', we don't want the magic
"all" or "~all" keywords to change it to 'sparc' or '~sparc'.

 src/ekeyword/ekeyword.py          | 8 ++++++++
 src/ekeyword/ekeyword_unittest.py | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/ekeyword/ekeyword.py b/src/ekeyword/ekeyword.py
index 64f4eb0..e4a8197 100755
--- a/src/ekeyword/ekeyword.py
+++ b/src/ekeyword/ekeyword.py
@@ -180,9 +180,17 @@ def process_keywords(keywords, ops, arch_status=None):
 				# master list.  If it lacks some keywords, then we might miss
 				# somethings here, but not much we can do.
 				arches = old_arches
+
 			# We ignore the glob arch as we never want to tweak it.
 			if '*' in arches:
 				arches.remove('*')
+
+			# For keywords that are explicitly disabled, do not update.  When
+			# people use `ekeyword ~all ...` or `ekeyword all ...`, they rarely
+			# (if ever) want to change a '-sparc' to 'sparc' or '-sparc' to
+			# '~sparc'.  We force people to explicitly do `ekeyword sparc ...`
+			# in these cases.
+			arches = [x for x in arches if '-' + x not in new_keywords]
 		else:
 			arches = (oarch,)
 

diff --git a/src/ekeyword/ekeyword_unittest.py b/src/ekeyword/ekeyword_unittest.py
index 134dd80..473113b 100755
--- a/src/ekeyword/ekeyword_unittest.py
+++ b/src/ekeyword/ekeyword_unittest.py
@@ -196,6 +196,14 @@ class TestProcessKeywords(unittest.TestCase):
 		self._test('-* ~* * alpha arm arm64 m68k', ops,
 		           '-* ~* * ~alpha arm ~arm64 ~m68k', arch_status)
 
+	def testAllDisabled(self):
+		"""Make sure ~all does not change -arch to ~arch"""
+		ops = (
+			ekeyword.Op('~', 'all', None),
+		)
+		self._test('alpha -sparc ~x86', ops,
+		           '~alpha -sparc ~x86', {})
+
 
 class TestProcessContent(unittest.TestCase):
 	"""Tests for process_content"""


             reply	other threads:[~2016-01-27 23:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27 23:35 Mike Frysinger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-03-08  0:16 [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/ekeyword/ Mike Frysinger
2017-03-08  0:16 Mike Frysinger
2017-02-18  5:24 Mike Frysinger
2017-02-16  7:25 Mike Frysinger
2017-02-16  7:25 Mike Frysinger
2016-01-27 23:35 Mike Frysinger
2015-04-04 21:26 Mike Frysinger
2015-04-04 21:26 Mike Frysinger
2015-04-04 21:26 Mike Frysinger
2014-11-18 18:24 Mike Gilbert
2014-11-13 22:51 Mike Frysinger
2014-01-27 23:14 Mike Frysinger
2014-01-25 22:00 Mike Frysinger
2014-01-25 22:00 Mike Frysinger
2014-01-25 22:00 Mike Frysinger
2014-01-20 16:29 Mike Frysinger
2014-01-20  6:17 Mike Frysinger
2012-04-23  3:02 Christian Ruppert
2012-04-23  3:02 Christian Ruppert

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=1453937577.1b33e0ae109e11b1ee696ea6c6919bb86ecbc66f.vapier@gentoo \
    --to=vapier@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