From: "Thomas Sachau" <tommy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:multilib commit in: pym/portage/package/ebuild/_config/
Date: Sun, 6 Feb 2011 13:09:53 +0000 (UTC) [thread overview]
Message-ID: <60ffb9adc463f62663095a5d7588f9ae7edd097f.tommy@gentoo> (raw)
commit: 60ffb9adc463f62663095a5d7588f9ae7edd097f
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Mon Jan 31 04:36:45 2011 +0000
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Mon Jan 31 05:38:21 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60ffb9ad
Properly fix my earlier breakage
---
.../package/ebuild/_config/KeywordsManager.py | 59 +++++++-------------
1 files changed, 21 insertions(+), 38 deletions(-)
diff --git a/pym/portage/package/ebuild/_config/KeywordsManager.py b/pym/portage/package/ebuild/_config/KeywordsManager.py
index b01604e..d153e95 100644
--- a/pym/portage/package/ebuild/_config/KeywordsManager.py
+++ b/pym/portage/package/ebuild/_config/KeywordsManager.py
@@ -118,31 +118,19 @@ class KeywordsManager(object):
mygroups = self.getKeywords(cpv, slot, keywords, repo)
# Repoman may modify this attribute as necessary.
- pgroups = global_accept_keywords.split()
+ pgroups = set(global_accept_keywords.split())
unmaskgroups = self.getPKeywords(cpv, slot, repo,
global_accept_keywords)
- pgroups.extend(unmaskgroups)
+ pgroups.update(unmaskgroups)
# Hack: Need to check the env directly here as otherwise stacking
# doesn't work properly as negative values are lost in the config
# object (bug #139600)
- egroups = self._getEgroups(backuped_accept_keywords)
- pgroups.extend(egroups)
+ egroups = backuped_accept_keywords.split()
if unmaskgroups or egroups:
- inc_pgroups = set()
- for x in pgroups:
- if x[:1] == "-":
- if x == "-*":
- inc_pgroups.clear()
- else:
- inc_pgroups.discard(x[1:])
- else:
- inc_pgroups.add(x)
- pgroups = inc_pgroups
- else:
- pgroups = set(pgroups)
+ pgroups = self._getEgroups(egroups, pgroups.copy())
return self._getMissingKeywords(cpv, pgroups, mygroups)
@@ -178,7 +166,7 @@ class KeywordsManager(object):
mygroups = self.getKeywords(cpv, slot, keywords, repo)
# Repoman may modify this attribute as necessary.
- pgroups = global_accept_keywords.split()
+ pgroups = set(global_accept_keywords.split())
# Hack: Need to check the env directly here as otherwise stacking
# doesn't work properly as negative values are lost in the config
@@ -186,18 +174,18 @@ class KeywordsManager(object):
# we want to use the environment keywords here,
# but stripped to it's base arch
# we want the raw keywords needed to be accepted from the ebuild
- egroups = self._getEgroups(backuped_accept_keywords)
- egroups = [x.lstrip('~') for x in egroups]
-
- pgroups.extend(egroups)
+ if backuped_accept_keywords:
+ egroups = self._getEgroups(backuped_accept_keywords.split(),
+ pgroups.copy())
+ pgroups = set([x.lstrip('~') for x in egroups])
missing = self._getMissingKeywords(cpv, pgroups, mygroups)
- return missing, pgroups
+ return missing, list(pgroups)
@staticmethod
- def _getEgroups(backuped_accept_keywords):
+ def _getEgroups(egroups, mygroups):
"""gets any keywords defined in the environment
@param backuped_accept_keywords: ACCEPT_KEYWORDS from the backup env
@@ -205,22 +193,17 @@ class KeywordsManager(object):
@rtype: List
@return: list of KEYWORDS that have been accepted
"""
- egroups = backuped_accept_keywords.split()
- pgroups = []
- if egroups:
- pgroups.extend(egroups)
- inc_pgroups = set()
- for x in pgroups:
- if x.startswith("-"):
- if x == "-*":
- inc_pgroups.clear()
- else:
- inc_pgroups.discard(x[1:])
+ mygroups.update(egroups)
+ inc_pgroups = set()
+ for x in mygroups:
+ if x.startswith("-"):
+ if x == "-*":
+ inc_pgroups.clear()
else:
- inc_pgroups.add(x)
- pgroups = inc_pgroups
- del inc_pgroups
- return pgroups
+ inc_pgroups.discard(x[1:])
+ else:
+ inc_pgroups.add(x)
+ return inc_pgroups
@staticmethod
next reply other threads:[~2011-02-06 13:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 13:09 Thomas Sachau [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-02-06 13:09 [gentoo-commits] proj/portage:multilib commit in: pym/portage/package/ebuild/_config/ Thomas Sachau
2011-02-06 13:09 Thomas Sachau
2011-02-06 13:09 Thomas Sachau
2011-02-06 13:09 Thomas Sachau
2011-02-06 13:09 Thomas Sachau
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=60ffb9adc463f62663095a5d7588f9ae7edd097f.tommy@gentoo \
--to=tommy@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