1 |
commit: d9388437a685c70db9dca26764873824e995c69e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 23 09:21:58 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 23 09:21:58 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=d9388437 |
7 |
|
8 |
Make repository comparison support obligatory. |
9 |
|
10 |
--- |
11 |
gentoopm/basepm/repo.py | 8 ++++++-- |
12 |
gentoopm/paludispm/repo.py | 3 +++ |
13 |
2 files changed, 9 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/gentoopm/basepm/repo.py b/gentoopm/basepm/repo.py |
16 |
index 8456a13..e9beca7 100644 |
17 |
--- a/gentoopm/basepm/repo.py |
18 |
+++ b/gentoopm/basepm/repo.py |
19 |
@@ -7,7 +7,7 @@ import os.path |
20 |
from abc import abstractmethod, abstractproperty |
21 |
|
22 |
from gentoopm.basepm.pkgset import PMPackageSet |
23 |
-from gentoopm.util import ABCObject, FillMissingNotEqual |
24 |
+from gentoopm.util import ABCObject, FillMissingComparisons |
25 |
|
26 |
class PMRepositoryDict(ABCObject): |
27 |
""" |
28 |
@@ -71,7 +71,7 @@ class PMRepository(PMPackageSet): |
29 |
Base abstract class for a single repository. |
30 |
""" |
31 |
|
32 |
-class PMEbuildRepository(PMRepository, FillMissingNotEqual): |
33 |
+class PMEbuildRepository(PMRepository, FillMissingComparisons): |
34 |
""" |
35 |
Base abstract class for an ebuild repository (on livefs). |
36 |
""" |
37 |
@@ -95,6 +95,10 @@ class PMEbuildRepository(PMRepository, FillMissingNotEqual): |
38 |
""" |
39 |
pass |
40 |
|
41 |
+ @abstractmethod |
42 |
+ def __lt__(self, other): |
43 |
+ pass |
44 |
+ |
45 |
def __eq__(self, other): |
46 |
if not isinstance(other, self.__class__): |
47 |
return False |
48 |
|
49 |
diff --git a/gentoopm/paludispm/repo.py b/gentoopm/paludispm/repo.py |
50 |
index 3f82bcd..6179c9a 100644 |
51 |
--- a/gentoopm/paludispm/repo.py |
52 |
+++ b/gentoopm/paludispm/repo.py |
53 |
@@ -109,6 +109,9 @@ class PaludisLivefsRepository(PaludisBaseRepo, PMEbuildRepository): |
54 |
def path(self): |
55 |
return self._repo.location_key().parse_value() |
56 |
|
57 |
+ def __lt__(self, other): |
58 |
+ return self._env.more_important_than(other.name, self.name) |
59 |
+ |
60 |
class PaludisInstalledRepo(PaludisBaseRepo): |
61 |
_pkg_class = PaludisInstalledID |