summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-17 09:49:48 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-17 09:49:48 +0000
commit9a16eb4a668c1aab4a91e0f08c8b01a0120d3c14 (patch)
treeca7a66eed65939a5767582ef4d63c02b302cc628
parent64948b131b2e2d553d0d666c68d7e48276d2c3e4 (diff)
downloadportage-9a16eb4a668c1aab4a91e0f08c8b01a0120d3c14.tar.gz
portage-9a16eb4a668c1aab4a91e0f08c8b01a0120d3c14.tar.bz2
portage-9a16eb4a668c1aab4a91e0f08c8b01a0120d3c14.zip
Add -* support to stack_lists() and use dict.pop() for removal of flags when appropriate.
svn path=/main/trunk/; revision=4736
-rw-r--r--pym/portage_util.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py
index 995688d03..d07fe63c9 100644
--- a/pym/portage_util.py
+++ b/pym/portage_util.py
@@ -137,9 +137,13 @@ def stack_lists(lists, incremental=1):
new_list = {}
for x in lists:
for y in filter(None, x):
- if incremental and y.startswith("-"):
- if y[1:] in new_list:
- del new_list[y[1:]]
+ if incremental:
+ if y == "-*":
+ new_list.clear()
+ elif y.startswith("-"):
+ new_list.pop(y[1:], None)
+ else:
+ new_list[y] = True
else:
new_list[y] = True
return new_list.keys()