#!/usr/bin/env python import sys import portage portdb = portage.portdb for t in portdb.porttrees: if t != portdb.porttree_root: portdb.porttrees.remove(t) depkeys = ["DEPEND","RDEPEND","PDEPEND"] for cp in portdb.cp_all(): cat, pkg = cp.split("/") for cpv in portdb.cp_list(cp): depvals = portdb.aux_get(cpv, depkeys) for x in depvals: if x.find(") virtual/x11 )") != -1: #print cpv pf = cpv.split("/")[1] print cat + "/" + pkg + "/" + pf + ".ebuild" break