1 |
Author: zmedico |
2 |
Date: 2008-11-22 21:58:37 +0000 (Sat, 22 Nov 2008) |
3 |
New Revision: 12043 |
4 |
|
5 |
Modified: |
6 |
main/trunk/cnf/sets.conf |
7 |
main/trunk/doc/config/sets.docbook |
8 |
main/trunk/pym/portage/sets/dbapi.py |
9 |
Log: |
10 |
Add new @unavailable package set which contains all installed |
11 |
packages for which there are no visible ebuilds corresponding |
12 |
to the same $CATEGORY/$PN:$SLOT. |
13 |
|
14 |
|
15 |
Modified: main/trunk/cnf/sets.conf |
16 |
=================================================================== |
17 |
--- main/trunk/cnf/sets.conf 2008-11-22 18:48:39 UTC (rev 12042) |
18 |
+++ main/trunk/cnf/sets.conf 2008-11-22 21:58:37 UTC (rev 12043) |
19 |
@@ -59,8 +59,8 @@ |
20 |
world-candidate = False |
21 |
files = /lib/modules |
22 |
|
23 |
-# Installed packages for which the highest visible ebuild |
24 |
-# version is lower than the currently installed version. |
25 |
-[downgrade] |
26 |
-class = portage.sets.dbapi.DowngradeSet |
27 |
+# Installed packages for which there are no visible ebuilds |
28 |
+# corresponding to the same $CATEGORY/$PN:$SLOT. |
29 |
+[unavailable] |
30 |
+class = portage.sets.dbapi.UnavailableSet |
31 |
world-candidate = False |
32 |
|
33 |
Modified: main/trunk/doc/config/sets.docbook |
34 |
=================================================================== |
35 |
--- main/trunk/doc/config/sets.docbook 2008-11-22 18:48:39 UTC (rev 12042) |
36 |
+++ main/trunk/doc/config/sets.docbook 2008-11-22 21:58:37 UTC (rev 12043) |
37 |
@@ -522,6 +522,20 @@ |
38 |
</itemizedlist> |
39 |
</para> |
40 |
</sect2> |
41 |
+ <sect2 id='config-set-classes-UnavailableSet'> |
42 |
+ <title>portage.sets.dbapi.UnavailableSet</title> |
43 |
+ <para> |
44 |
+ Package set which contains all installed |
45 |
+ packages for which there are no visible ebuilds |
46 |
+ corresponding to the same $CATEGORY/$PN:$SLOT. |
47 |
+ This class supports the following options: |
48 |
+ <itemizedlist> |
49 |
+ <listitem><varname>metadata-source</varname>: Optional, defaults to |
50 |
+ "porttree". Specifies the repository to use for getting the metadata |
51 |
+ to check.</listitem> |
52 |
+ </itemizedlist> |
53 |
+ </para> |
54 |
+ </sect2> |
55 |
<sect2 id='config-set-classes-DowngradeSet'> |
56 |
<title>portage.sets.dbapi.DowngradeSet</title> |
57 |
<para> |
58 |
@@ -571,6 +585,7 @@ |
59 |
<listitem><varname>live-rebuild</varname>: uses <classname>VariableSet</classname></listitem> |
60 |
<listitem><varname>module-rebuild</varname>: uses <classname>OwnerSet</classname></listitem> |
61 |
<listitem><varname>downgrade</varname>: uses <classname>DowngradeSet</classname></listitem> |
62 |
+ <listitem><varname>unavailable</varname>: uses <classname>UnavailableSet</classname></listitem> |
63 |
</itemizedlist> |
64 |
Additionally the default configuration includes a multi set section based on |
65 |
the <classname>StaticFileSet</classname> defaults that creates a set for each |
66 |
|
67 |
Modified: main/trunk/pym/portage/sets/dbapi.py |
68 |
=================================================================== |
69 |
--- main/trunk/pym/portage/sets/dbapi.py 2008-11-22 18:48:39 UTC (rev 12042) |
70 |
+++ main/trunk/pym/portage/sets/dbapi.py 2008-11-22 21:58:37 UTC (rev 12043) |
71 |
@@ -179,6 +179,33 @@ |
72 |
|
73 |
singleBuilder = classmethod(singleBuilder) |
74 |
|
75 |
+class UnavailableSet(EverythingSet): |
76 |
+ |
77 |
+ _operations = ["unmerge"] |
78 |
+ |
79 |
+ description = "Package set which contains all installed " + \ |
80 |
+ "packages for which there are no visible ebuilds " + \ |
81 |
+ "corresponding to the same $CATEGORY/$PN:$SLOT." |
82 |
+ |
83 |
+ def __init__(self, vardb, metadatadb=None): |
84 |
+ super(UnavailableSet, self).__init__(vardb) |
85 |
+ self._metadatadb = metadatadb |
86 |
+ |
87 |
+ def _filter(self, atom): |
88 |
+ return not self._metadatadb.match(atom) |
89 |
+ |
90 |
+ def singleBuilder(cls, options, settings, trees): |
91 |
+ |
92 |
+ metadatadb = options.get("metadata-source", "porttree") |
93 |
+ if not metadatadb in trees: |
94 |
+ raise SetConfigError(("invalid value '%s' for option " + \ |
95 |
+ "metadata-source") % (metadatadb,)) |
96 |
+ |
97 |
+ return cls(trees["vartree"].dbapi, |
98 |
+ metadatadb=trees[metadatadb].dbapi) |
99 |
+ |
100 |
+ singleBuilder = classmethod(singleBuilder) |
101 |
+ |
102 |
class CategorySet(PackageSet): |
103 |
_operations = ["merge", "unmerge"] |