Skip to content

Commit ff924c6

Browse files
committed
bugs: when selecting matching package, prefer those that have keywords
Resolves: #205 Signed-off-by: Arthur Zamarin <[email protected]>
1 parent 611a1c7 commit ff924c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pkgdev/scripts/pkgdev_bugs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,15 @@ def find_best_match(self, restrict, pkgset: list[package], prefer_semi_stable=Tr
385385
if intersect := tuple(filter(restrict.match, all_pkgs)):
386386
return max(intersect)
387387
matches = sorted(filter(restrict.match, pkgset), reverse=True)
388+
# prefer package with any stable keyword
388389
if prefer_semi_stable:
389390
for match in matches:
390391
if not all(keyword.startswith("~") for keyword in match.keywords):
391392
return match
393+
# prefer package with any keyword
394+
for match in matches:
395+
if match.keywords:
396+
return match
392397
return matches[0]
393398

394399
def extend_targets_stable_groups(self, groups):

0 commit comments

Comments
 (0)