summaryrefslogtreecommitdiff
path: root/portato/backend/system_interface.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/backend/system_interface.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/portato/backend/system_interface.py b/portato/backend/system_interface.py
index be79de2..f0bfdf6 100644
--- a/portato/backend/system_interface.py
+++ b/portato/backend/system_interface.py
@@ -68,6 +68,18 @@ class SystemInterface (object):
"""
raise NotImplementedError
+
+ def compare_versions(self, v1, v2):
+ """Compares two CPVs; returns -1, 0, 1.
+
+ @param v1: one CPV
+ @type v1: cpv
+ @param v2: the second CPV
+ @type v2: cpv
+ @returns: -1, 0 or 1
+ @rtype: int"""
+
+ raise NotImplementedError
def find_best(self, list, only_cpv = False):
"""Returns the best package out of a list of packages.
@@ -134,11 +146,13 @@ class SystemInterface (object):
raise NotImplementedError
- def sort_package_list(self, pkglist):
+ def sort_package_list(self, pkglist, only_cpv = False):
"""Sorts a package list in the same manner portage does.
@param pkglist: list to sort
- @type pkglist: Packages[]
+ @type pkglist: Packages[] or cpv[]
+ @param only_cpv: flags whether the passed list consists of Packages or of CPVs
+ @type: bool
"""
raise NotImplementedError