archweb
archweb copied to clipboard
Flag lib32 out of date when non lib32 marked out of date
Took a stab at trying to fix issue #110, marking lib32 package as out of date when non lib32 package is flagged. I also added the reverse case, when a lib32 package is flagged the non lib32 package (and others based on the same pkgbase) also get flagged. Hope I got everything right as this is my first time working with django.
Thanks for the PR, just started testing, the second message after entering an out of date text only lists the original flagged out of date package. while two packages where flagged out of date. It would be nice to also list that
This message is what I am talking about.
Package Flagged - gconf
Thank you, the maintainers have been notified the following 1 package are out-of-date:
gconf 3.2.6+11+g07808097-4 [extra] (x86_64)
I'm also wondering if this case is always valid hmm since lib32-foo can be updated before foo, so maybe it should try and compare the pkgver.
Already found such a case here:
cairo 1.16.0-2 [extra] (x86_64)
lib32-cairo 1.17.2+17+g52a7c79fd-1 [multilib] (x86_64)
Oops, didn't actually test more than the first step. I will see what I can do about it.
This should take care of the issues you mentioned.
Found one issue when flagging lib32-libssh2 out of date while libssh2 was already flagged:
Internal Server Error: /packages/multilib/x86_64/lib32-libssh2/flag/
Traceback (most recent call last):
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/jelle/projects/archweb/packages/views/flag.py", line 87, in flag
pkgs = find_same_pkgbase(pkg).filter(
File "/home/jelle/projects/archweb/packages/views/flag.py", line 59, in find_same_pkgbase
pkgname=pkg.pkgname.replace('lib32-',''))
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/shortcuts.py", line 93, in get_object_or_404
return queryset.get(*args, **kwargs)
File "/home/jelle/projects/archweb/env/lib/python3.7/site-packages/django/db/models/query.py", line 412, in get
(self.model._meta.object_name, num)
main.models.Package.MultipleObjectsReturned: get() returned more than one Package -- it returned 2!
Since libssh is in [testing] and [core] in my test setup.
@lrustand ping, can you take a look to fix @jelly finding? Would be cool to have this feature
I'm sorry it has taken so long for me to respond to this. Currently I don't have the time to look at this for a while, but feel free to finish the work on this if you want.