summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/sets/dbapi.py')
-rw-r--r--pym/portage/sets/dbapi.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/pym/portage/sets/dbapi.py b/pym/portage/sets/dbapi.py
index 877c45ce..65d05a2a 100644
--- a/pym/portage/sets/dbapi.py
+++ b/pym/portage/sets/dbapi.py
@@ -179,6 +179,33 @@ class DowngradeSet(PackageSet):
singleBuilder = classmethod(singleBuilder)
+class UnavailableSet(EverythingSet):
+
+ _operations = ["unmerge"]
+
+ description = "Package set which contains all installed " + \
+ "packages for which there are no visible ebuilds " + \
+ "corresponding to the same $CATEGORY/$PN:$SLOT."
+
+ def __init__(self, vardb, metadatadb=None):
+ super(UnavailableSet, self).__init__(vardb)
+ self._metadatadb = metadatadb
+
+ def _filter(self, atom):
+ return not self._metadatadb.match(atom)
+
+ def singleBuilder(cls, options, settings, trees):
+
+ metadatadb = options.get("metadata-source", "porttree")
+ if not metadatadb in trees:
+ raise SetConfigError(("invalid value '%s' for option " + \
+ "metadata-source") % (metadatadb,))
+
+ return cls(trees["vartree"].dbapi,
+ metadatadb=trees[metadatadb].dbapi)
+
+ singleBuilder = classmethod(singleBuilder)
+
class CategorySet(PackageSet):
_operations = ["merge", "unmerge"]