summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-22 01:53:50 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-22 01:53:50 +0000
commitc0cfcc8a6eb2e4adff8eb3d3bb9f44d9b7124ccd (patch)
tree52cfa5cff4798cc05c2163976cd41bea3f678ddd /bin
parent337f4de4c1bfb38e02a9f2b5be05884e68299d01 (diff)
downloadportage-c0cfcc8a6eb2e4adff8eb3d3bb9f44d9b7124ccd.tar.gz
portage-c0cfcc8a6eb2e4adff8eb3d3bb9f44d9b7124ccd.tar.bz2
portage-c0cfcc8a6eb2e4adff8eb3d3bb9f44d9b7124ccd.zip
Remove lots of unnecessary list generation via dict.keys(). (trunk r6911)
svn path=/main/branches/2.1.2/; revision=6930
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge14
-rwxr-xr-xbin/fix-db.py4
-rwxr-xr-xbin/md5check.py8
-rwxr-xr-xbin/repoman6
4 files changed, 16 insertions, 16 deletions
diff --git a/bin/emerge b/bin/emerge
index 4e3197bf0..c2053c0a9 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -439,7 +439,7 @@ class search:
if self.searchre.search(full_desc):
self.matches["desc"].append([full_package,masked])
self.mlen=0
- for mtype in self.matches.keys():
+ for mtype in self.matches:
self.matches[mtype].sort()
self.mlen += len(self.matches[mtype])
@@ -448,7 +448,7 @@ class search:
print "\b\b \n[ Results for search key : "+white(self.searchkey)+" ]"
print "[ Applications found : "+white(str(self.mlen))+" ]"
print " "
- for mtype in self.matches.keys():
+ for mtype in self.matches:
for match,masked in self.matches[mtype]:
if mtype=="pkg":
catpack=match
@@ -2182,7 +2182,7 @@ class depgraph:
mylist = getlist(self.settings, "system")
worlddict=genericdict(worldlist)
- for x in worlddict.keys():
+ for x in worlddict:
if not portage.isvalidatom(x):
world_problems = True
continue
@@ -2665,7 +2665,7 @@ class depgraph:
if myfilesdict is None:
myfilesdict="[empty/missing/bad digest]"
else:
- for myfetchfile in myfilesdict.keys():
+ for myfetchfile in myfilesdict:
if myfetchfile not in myfetchlist:
mysize+=myfilesdict[myfetchfile]
myfetchlist.append(myfetchfile)
@@ -3554,7 +3554,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
if not slotmap.has_key(myslot):
slotmap[myslot]={}
slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg
- for myslot in slotmap.keys():
+ for myslot in slotmap:
counterkeys=slotmap[myslot].keys()
counterkeys.sort()
if not counterkeys:
@@ -3581,7 +3581,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
finally:
if vdb_lock:
portage_locks.unlockdir(vdb_lock)
- for x in pkgmap.keys():
+ for x in pkgmap:
for y in localtree.dep_match(x):
if y not in pkgmap[x]["omitted"] and \
y not in pkgmap[x]["selected"] and \
@@ -3637,7 +3637,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
if not autoclean:
countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging")
- for x in pkgmap.keys():
+ for x in pkgmap:
for y in pkgmap[x]["selected"]:
print ">>> Unmerging "+y+"..."
emergelog(xterm_titles, "=== Unmerging... ("+y+")")
diff --git a/bin/fix-db.py b/bin/fix-db.py
index 8292bc960..301ec8002 100755
--- a/bin/fix-db.py
+++ b/bin/fix-db.py
@@ -136,7 +136,7 @@ for cat in os.listdir(vardbdir):
actions = {}
writemsg("\n\n")
-for catpkg in bad.keys():
+for catpkg in bad:
bad[catpkg].sort()
mystr = ""
@@ -155,7 +155,7 @@ for catpkg in bad.keys():
if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"):
writemsg("These are only directions, at the moment.")
- for catpkg in actions.keys():
+ for catpkg in actions:
action = actions[catpkg]
writemsg("We will now '%s' '%s'..." % (action, catpkg))
#if action ==
diff --git a/bin/md5check.py b/bin/md5check.py
index 8f1159e75..5d960a402 100755
--- a/bin/md5check.py
+++ b/bin/md5check.py
@@ -68,10 +68,10 @@ for mycpv in hugelist:
else:
continue
- if mybn not in md5sums.keys():
+ if mybn not in md5sums:
portage_util.writemsg("Missing md5sum: %s in %s\n" % (mybn, mycpv))
else:
- if mybn in md5_list.keys():
+ if mybn in md5_list:
if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \
(md5_list[mybn]["size"] != md5sums[mybn]["size"]):
@@ -89,12 +89,12 @@ for mycpv in hugelist:
del md5sums[mybn]
#portage.writemsg(str(bn_list)+"\n")
- for x in md5sums.keys():
+ for x in md5sums:
if x not in bn_list:
portage.writemsg("Extra md5sum: %s in %s\n" % (x, mycpv))
print col_list
print
-print str(len(md5_list.keys()))+" unique distfile md5s."
+print str(len(md5_list))+" unique distfile md5s."
print str(len(bn_list))+" unique distfile names."
diff --git a/bin/repoman b/bin/repoman
index f5ef34dca..a93965ff3 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -349,9 +349,9 @@ myoptions=[]
if len(sys.argv)>1:
x=1
while x < len(sys.argv):
- if sys.argv[x] in shortmodes.keys():
+ if sys.argv[x] in shortmodes:
sys.argv[x]=shortmodes[sys.argv[x]]
- elif sys.argv[x] in repoman_shortoptions.keys():
+ elif sys.argv[x] in repoman_shortoptions:
sys.argv[x] = repoman_shortoptions[sys.argv[x]]
if sys.argv[x] in modes:
if mymode is None:
@@ -1477,7 +1477,7 @@ def grouplist(mylist,seperator="/"):
xs=x.split(seperator)
if xs[0]==".":
xs=xs[1:]
- if xs[0] not in mygroups.keys():
+ if xs[0] not in mygroups:
mygroups[xs[0]]=[seperator.join(xs[1:])]
else:
mygroups[xs[0]]+=[seperator.join(xs[1:])]