From ce9f4821e2238ca2961002ad3f872e8432267ee2 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 5 Oct 2009 15:25:22 +0200 Subject: Enhanced system.sort_package_list to also sort CPVs --- portato/backend/system_interface.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'portato/backend/system_interface.py') 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 -- cgit v1.2.3-54-g00ecf