#!/usr/bin/python import os import sys sys.path.insert(0, "/usr/lib/portage/pym") import portage from portage_util import unique_array porttree = portage.db[portage.root]["porttree"] vartree = portage.db[portage.root]["vartree"] virtuals = portage.db[portage.root]["virtuals"] def find_all_ebuilds(): """Returns a list of all known ebuilds, installed or not.""" # Find all packages t = porttree.dbapi.cp_all() t += vartree.dbapi.cp_all() t = unique_array(t) t.sort() # Find all ebuilds for the packages t2 = [] for x in t: t2 += porttree.dbapi.cp_list(x) t2 += vartree.dbapi.cp_list(x) t2 = unique_array(t2) t2.sort() return t2 if __name__ == "__main__": print "Finding all ebuilds" for i in find_all_ebuilds(): print i