diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-08-11 19:31:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-08-11 19:31:20 +0000 |
commit | 1e05ec1d75be4bbdacf52ce22ad70c7fda75c338 (patch) | |
tree | 481b93cf50e1a7db4c85cc8ef72837c861b399a2 | |
parent | 41aafaed56515448bd7762e5b04e10716727170a (diff) | |
download | portage-1e05ec1d75be4bbdacf52ce22ad70c7fda75c338.tar.gz portage-1e05ec1d75be4bbdacf52ce22ad70c7fda75c338.tar.bz2 portage-1e05ec1d75be4bbdacf52ce22ad70c7fda75c338.zip |
Fix stack_dictlist() so that incremental stacking behaves more like it does in config.regenerate().
svn path=/main/trunk/; revision=4213
-rw-r--r-- | pym/portage_util.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py index d318f80c2..e159c3766 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -81,7 +81,6 @@ def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0 overwriting matching key/value pairs for the dict[key]->list. Returns a single dict. Higher index in lists is preferenced.""" final_dict = None - kill_list = {} for mydict in original_dicts: if mydict is None: continue @@ -90,19 +89,21 @@ def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0 for y in mydict.keys(): if not final_dict.has_key(y): final_dict[y] = [] - if not kill_list.has_key(y): - kill_list[y] = [] - mydict[y].reverse() for thing in mydict[y]: - if thing and (thing not in kill_list[y]) and ("*" not in kill_list[y]): - if (incremental or (y in incrementals)) and thing[0] == '-': - if thing[1:] not in kill_list[y]: - kill_list[y] += [thing[1:]] - else: - if thing not in final_dict[y]: - final_dict[y].append(thing[:]) - mydict[y].reverse() + if thing: + if incremental or y in incrementals: + if thing == "-*": + final_dict[y] = [] + continue + elif thing.startswith("-"): + try: + final_dict[y].remove(thing[1:]) + except ValueError: + pass + continue + if thing not in final_dict[y]: + final_dict[y].append(thing) if final_dict.has_key(y) and not final_dict[y]: del final_dict[y] return final_dict |