summaryrefslogtreecommitdiffstats
path: root/main/utils.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-11-11 23:28:34 +0100
committerDan McGee <dan@archlinux.org>2013-11-11 23:28:34 +0100
commit833798f4fb7f629fdb8d7e57b5f25b31d395fa5e (patch)
treef6fe8b58ba6c8478a8dba3fadd45f5c3c90f5853 /main/utils.py
parent7ac017e1e7884320bd00f67134dd1ae7e06ceaaf (diff)
downloadarchweb-833798f4fb7f629fdb8d7e57b5f25b31d395fa5e.tar.gz
archweb-833798f4fb7f629fdb8d7e57b5f25b31d395fa5e.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'main/utils.py')
-rw-r--r--main/utils.py14
1 files changed, 14 insertions, 0 deletions
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: