Skip to content

Commit 933069e

Browse files
committed
appstream: Check for .desktop suffixed ids also.
The starts-with() function was originally used because some flatpak appstream ids ended in .desktop for historical reasons. This fact was forgotten in 7a4d6e0 due to lack of commenting. Fixes #linuxmint/mint22.1-beta#81.
1 parent 25f207b commit 933069e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

usr/lib/python3/dist-packages/mintcommon/installer/appstream_pool.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,14 @@ def lookup_appstream_package(self, pkginfo):
430430

431431
try:
432432
if kind == KIND_APP:
433-
base_node = self.xmlb_silo.query_first(
434-
f"components/component/id[text()='{pkginfo.name}']/.."
435-
)
433+
try:
434+
base_node = self.xmlb_silo.query_first(
435+
f"components/component/id[text()='{pkginfo.name}']/.."
436+
)
437+
except GLib.Error as e:
438+
base_node = self.xmlb_silo.query_first(
439+
f"components/component/id[text()='{pkginfo.name}.desktop']/.."
440+
)
436441
else:
437442
base_nodes = self.xmlb_silo.query(
438443
f"components/component/id[starts-with(text(),'{pkginfo.name}')]/..",

0 commit comments

Comments
 (0)