From 833798f4fb7f629fdb8d7e57b5f25b31d395fa5e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 11 Nov 2013 16:28:34 -0600 Subject: Filtered requiredby list for non-primary depends For something like gambas3 which has a makedepend on postgresql, we end up getting every single split package listed in the required by list for postgresql. This is a bit crazy and unnecessary, so slim it down a bit when possible by using a slightly crazy groupby function and some smarts in our get_requiredby function. Signed-off-by: Dan McGee --- main/utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'main/utils.py') diff --git a/main/utils.py b/main/utils.py index 9ee8db5..97cc540 100644 --- a/main/utils.py +++ b/main/utils.py @@ -187,4 +187,18 @@ class PackageStandin(object): return '/packages/%s/%s/%s/' % ( self.repo.name.lower(), self.arch.name, self.pkgbase) + +class DependStandin(object): + '''Resembles a Depend object, and has a few of the same fields, but is + really a link to a base package rather than a single package.''' + def __init__(self, depends): + self._depends = depends + first = depends[0] + self.name = first.name + self.version = first.version + self.comparison = first.comparison + self.description = first.description + self.deptype = first.deptype + self.pkg = first.pkg.base_package() or PackageStandin(first.pkg) + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b