performance: Handle install for trixie

In trixie, cockpit-pcp is replaced by cockpit-bridge. However, our
packages module does not properly handle virtual packages.

- Specify cockpit-bridge and pcp as dependencies. In bookworm, they were
  dependencies of cockpit-pcp.

- Allow cockpit-bridge as a substitute for cockpit-pcp.

Tests:

- In stable container, install Performance app. Install succeeds and app
  is available.

- In testing container, install Performance app. Install succeeds and
  app is available.

- Build stable-backports package with new version. Install in stable VM.
  Install Performance app. Check that dist-upgrade succeeds. After
  dist-upgrade, Performance app is still working. Uninstalling
  Performance app works. Installing Performance app works. Diagnostics
  are all passed.

Note: There is one minor issue with the Diagnostics. Package
cockpit-bridge line is shown twice (both are passed).

Fixes: #2475

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2025-06-18 20:25:05 -04:00
parent 1b5a45560f
commit d7d4958e8b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -9,7 +9,7 @@ from plinth import app as app_module
from plinth import menu
from plinth.daemon import Daemon
from plinth.modules.backups.components import BackupRestore
from plinth.package import Packages
from plinth.package import Package, Packages
from . import manifest
@ -49,7 +49,15 @@ class PerformanceApp(app_module.App):
order=40)
self.add(menu_item)
packages = Packages('packages-performance', ['cockpit-pcp'])
packages = Packages('packages-performance', [
# For bookworm, we need cockpit-pcp (which depends on
# cockpit-bridge and pcp). For trixie, cockpit-pcp is
# replaced by cockpit-bridge, and we need to specify a
# dependency on pcp. There is some issue with having a
# virtual package specified, see #2475.
Package('cockpit-pcp') | Package('cockpit-bridge'),
'cockpit-bridge', 'pcp'
])
self.add(packages)
backup_restore = BackupRestore('backup-restore-performance',