[installed category packages]
class = portage.sets.dbapi.CategorySet
multiset = true
+ repository = vartree
name_pattern = $category/*
</programlisting>
</para>
<listitem><para><varname>category</varname>: Required. The name of an existing ebuild
category which should be used to create the package set.</para>
</listitem>
+ <listitem><para><varname>repository</varname>: Optional, defaults to
+ <parameter>porttree</parameter>. It determines which repository class should
+ be used to create the package set. Valid values for this option are:
+ <parameter>porttree</parameter> (normal ebuild repository),
+ <parameter>vartree</parameter> (installed package repository)
+ and <parameter>bintree</parameter> (local binary package repository).</para>
+ </listitem>
<listitem><para><varname>only_visible</varname>: Optional, defaults to <parameter>true</parameter>.
When set to <parameter>true</parameter> the set will only include visible packages,
when set to <parameter>false</parameter> it will also include masked packages.
myatoms.append(cp)
self._setAtoms(myatoms)
+ def _builderGetRepository(cls, options, repositories):
+ repository = options.get("repository", "porttree")
+ if not repository in repositories:
+ raise SetConfigError(_("invalid repository class '%s'") % repository)
+ return repository
+ _builderGetRepository = classmethod(_builderGetRepository)
+
def _builderGetVisible(cls, options):
return get_boolean(options, "only_visible", True)
_builderGetVisible = classmethod(_builderGetVisible)
if not category in settings.categories:
raise SetConfigError(_("invalid category name '%s'") % category)
+ repository = cls._builderGetRepository(options, trees.keys())
visible = cls._builderGetVisible(options)
- return CategorySet(category, dbapi=trees["porttree"].dbapi, only_visible=visible)
+ return CategorySet(category, dbapi=trees[repository].dbapi, only_visible=visible)
singleBuilder = classmethod(singleBuilder)
def multiBuilder(cls, options, settings, trees):
else:
categories = settings.categories
+ repository = cls._builderGetRepository(options, trees.keys())
visible = cls._builderGetVisible(options)
name_pattern = options.get("name_pattern", "$category/*")
raise SetConfigError(_("name_pattern doesn't include $category placeholder"))
for cat in categories:
- myset = CategorySet(cat, trees["porttree"].dbapi, only_visible=visible)
+ myset = CategorySet(cat, trees[repository].dbapi, only_visible=visible)
myname = name_pattern.replace("$category", cat)
myname = myname.replace("${category}", cat)
rValue[myname] = myset