summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cnf/sets.conf8
-rw-r--r--doc/config/sets.docbook15
-rw-r--r--pym/portage/sets/dbapi.py27
3 files changed, 46 insertions, 4 deletions
diff --git a/cnf/sets.conf b/cnf/sets.conf
index 84f6a6e6..36e2f7f4 100644
--- a/cnf/sets.conf
+++ b/cnf/sets.conf
@@ -59,8 +59,8 @@ class = portage.sets.dbapi.OwnerSet
world-candidate = False
files = /lib/modules
-# Installed packages for which the highest visible ebuild
-# version is lower than the currently installed version.
-[downgrade]
-class = portage.sets.dbapi.DowngradeSet
+# Installed packages for which there are no visible ebuilds
+# corresponding to the same $CATEGORY/$PN:$SLOT.
+[unavailable]
+class = portage.sets.dbapi.UnavailableSet
world-candidate = False
diff --git a/doc/config/sets.docbook b/doc/config/sets.docbook
index d993024b..dc26b1a0 100644
--- a/doc/config/sets.docbook
+++ b/doc/config/sets.docbook
@@ -522,6 +522,20 @@
</itemizedlist>
</para>
</sect2>
+ <sect2 id='config-set-classes-UnavailableSet'>
+ <title>portage.sets.dbapi.UnavailableSet</title>
+ <para>
+ Package set which contains all installed
+ packages for which there are no visible ebuilds
+ corresponding to the same $CATEGORY/$PN:$SLOT.
+ This class supports the following options:
+ <itemizedlist>
+ <listitem><varname>metadata-source</varname>: Optional, defaults to
+ "porttree". Specifies the repository to use for getting the metadata
+ to check.</listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
<sect2 id='config-set-classes-DowngradeSet'>
<title>portage.sets.dbapi.DowngradeSet</title>
<para>
@@ -571,6 +585,7 @@
<listitem><varname>live-rebuild</varname>: uses <classname>VariableSet</classname></listitem>
<listitem><varname>module-rebuild</varname>: uses <classname>OwnerSet</classname></listitem>
<listitem><varname>downgrade</varname>: uses <classname>DowngradeSet</classname></listitem>
+ <listitem><varname>unavailable</varname>: uses <classname>UnavailableSet</classname></listitem>
</itemizedlist>
Additionally the default configuration includes a multi set section based on
the <classname>StaticFileSet</classname> defaults that creates a set for each
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"]