diff options
author | Felix Bier <flx.bier@gmail.com> | 2021-05-09 23:53:46 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2021-05-23 23:33:17 -0700 |
commit | 9dcfad7bcd940337635234e315281701a87a9d83 (patch) | |
tree | d9e07f80d060910627b3209fce32698266855e38 | |
parent | unmerge: Reuse helper variable quiet (diff) | |
download | portage-9dcfad7bcd940337635234e315281701a87a9d83.tar.gz portage-9dcfad7bcd940337635234e315281701a87a9d83.tar.bz2 portage-9dcfad7bcd940337635234e315281701a87a9d83.zip |
unmerge: Remove vartree alias
This commit removes the variable localtree, which is assigned once
to point to vartree and then never modified.
Closes: https://github.com/gentoo/portage/pull/705
Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/_emerge/unmerge.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/_emerge/unmerge.py b/lib/_emerge/unmerge.py index b0067f8e6..5cbb6f825 100644 --- a/lib/_emerge/unmerge.py +++ b/lib/_emerge/unmerge.py @@ -99,7 +99,6 @@ def _unmerge_display(root_config, myopts, unmerge_action, global_unmerge = 1 - localtree = vartree # process all arguments and add all # valid db entries to candidate_catpkgs if global_unmerge: @@ -199,7 +198,7 @@ def _unmerge_display(root_config, myopts, unmerge_action, sys.exit(1) if not mymatch and x[0] not in "<>=~": - mymatch = localtree.dep_match(x) + mymatch = vartree.dep_match(x) if not mymatch: portage.writemsg("\n--- Couldn't find '%s' to %s.\n" % \ (x.replace("null/", ""), unmerge_action), noiselevel=-1) @@ -242,14 +241,14 @@ def _unmerge_display(root_config, myopts, unmerge_action, slotmap={} for mypkg in mymatch: if unmerge_action == "clean": - myslot = localtree.getslot(mypkg) + myslot = vartree.getslot(mypkg) else: # since we're pruning, we don't care about slots # and put all the pkgs in together myslot = 0 if myslot not in slotmap: slotmap[myslot] = {} - slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)] = mypkg + slotmap[myslot][vartree.dbapi.cpv_counter(mypkg)] = mypkg for mypkg in vartree.dbapi.cp_list( portage.cpv_getkey(mymatch[0])): @@ -445,7 +444,7 @@ def _unmerge_display(root_config, myopts, unmerge_action, continue mylist.difference_update(all_selected) cp = portage.cpv_getkey(next(iter(selected))) - for y in localtree.dep_match(cp): + for y in vartree.dep_match(cp): if y not in pkgmap[x]["omitted"] and \ y not in pkgmap[x]["selected"] and \ y not in pkgmap[x]["protected"] and \ |