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
</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>
<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
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"]