Bug 56598 - Adjust appcenter for changed package manager section/candidate handling
Summary: Adjust appcenter for changed package manager section/candidate handling
Status: CLOSED FIXED
Alias: None
Product: UCS
Classification: Unclassified
Component: App Center
Version: UCS 5.1
Hardware: Other Linux
: P5 normal
Target Milestone: UCS 5.1
Assignee: Dirk Wiesenthal
QA Contact: Florian Best
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-15 10:31 CEST by Florian Best
Modified: 2025-02-05 15:08 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2023-09-15 10:31:22 CEST
commit c5ad0b4bafd579fdc2fa5bd1b190d99b22722982
Author: Dirk Wiesenthal <wiesenthal@univention.de>
Date:   Wed Apr 5 16:01:44 2023 +0200

    Fix section error in the UMC software packages module

diff --git management/univention-appcenter/umc/python/appcenter/__init__.py management/univention-appcenter/umc/python/appcenter/__init__.py
index 5aa50934e4..ea5d3b1991 100644
--- management/univention-appcenter/umc/python/appcenter/__init__.py
+++ management/univention-appcenter/umc/python/appcenter/__init__.py
@@ -599,7 +599,8 @@ class Instance(umcm.Base, ProgressMixin):
         sections = set()
         cache = apt.Cache()
         for package in cache:
-            sections.add(package.section)
+            if package.candidate:
+                sections.add(package.candidate.section)
 
         return sorted(sections)
 
@@ -609,7 +610,7 @@ class Instance(umcm.Base, ProgressMixin):
         """Query to fill the grid. Structure is fixed here."""
         result = []
         for package in self.package_manager.packages(reopen=True):
-            if section == 'all' or package.section == section:
+            if section == 'all' or package.candidate and package.candidate.section == section:
                 toshow = False
                 if pattern.pattern == '^.*$':
                     toshow = True
@@ -753,7 +754,7 @@ class Instance(umcm.Base, ProgressMixin):
         if full:
             # Some fields differ depending on whether the package is installed or not:
             if package.is_installed:
-                result['section'] = installed.section
+                result['section'] = candidate.section
                 result['priority'] = installed.priority or ''
                 result['summary'] = installed.summary   # take the current one
                 result['description'] = installed.description
Comment 2 Florian Best univentionstaff 2023-09-26 09:42:14 CEST
Already happens in UCS 5.1:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 360, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 260, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 478, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 602, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 444, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/appcenter/__init__.py", line 602, in packages_sections
    sections.add(package.section)
AttributeError: 'Package' object has no attribute 'section'
Comment 3 Dirk Wiesenthal univentionstaff 2023-10-10 21:36:55 CEST
Package: univention-appcenter
Version: 9.100.0-1A~5.2.0.202310102121
Branch: ucs_5.2-0
Comment 4 Florian Best univentionstaff 2023-10-11 12:14:55 CEST
OK: changes already in UCS 5.1
OK: no error anymore
OK: changelog entry
Comment 5 Florian Best univentionstaff 2024-03-08 11:04:02 CET
univention-appcenter (10.0.7)
05cfd131e383 | fix(appcenter): adjust section error in the UMC software packages module