1 |
commit: 9f786534a3828be4f3d7030d773e7a82a542d7f5 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 28 14:46:53 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 28 14:46:53 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=9f786534 |
7 |
|
8 |
Introduce an abstract exactly-one-of dep. |
9 |
|
10 |
--- |
11 |
gentoopm/basepm/depend.py | 12 ++++++++++++ |
12 |
1 files changed, 12 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/gentoopm/basepm/depend.py b/gentoopm/basepm/depend.py |
15 |
index ca6d2c5..923cdbf 100644 |
16 |
--- a/gentoopm/basepm/depend.py |
17 |
+++ b/gentoopm/basepm/depend.py |
18 |
@@ -100,6 +100,18 @@ class PMAnyOfDep(PMBaseDep): |
19 |
class PMUncondAnyOfDep(PMAnyOfDep, PMUncondBaseDep): |
20 |
pass |
21 |
|
22 |
+class PMExactlyOneOfDep(PMBaseDep): |
23 |
+ """ |
24 |
+ An exactly-one-of (xor) dependency set (C{^^ ( ... )}). |
25 |
+ """ |
26 |
+ |
27 |
+ @property |
28 |
+ def without_conditionals(self): |
29 |
+ return PMUncondExactlyOneOfDep(self) |
30 |
+ |
31 |
+class PMUncondExactlyOneOfDep(PMExactlyOneOfDep, PMUncondBaseDep): |
32 |
+ pass |
33 |
+ |
34 |
class PMPackageDepSet(PMAllOfDep): |
35 |
""" |
36 |
A base class representing a depset (or depset-like variable) of a single |