commit:     d3ca0833690ec26f5ddcb0d3157fc85c69dc8d5e
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 19:34:51 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 19:34:51 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgdev.git/commit/?id=d3ca0833

tatt: fix required_use for packages from bug

When invoked on bug's package list, we use nattka to find matches in the
repo. Nattka requires configured repo, which we were passing beforehand.
But this results in a case where we have a configured packages, without
source ebuild's "required_use" (it was "configured" by the domain).

While somewhat ugly, fix it by performing a second iteration, this time
over the source repo, and get the expected package object we can use.

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgdev/scripts/pkgdev_tatt.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pkgdev/scripts/pkgdev_tatt.py 
b/src/pkgdev/scripts/pkgdev_tatt.py
index 79624cd..ff88d25 100644
--- a/src/pkgdev/scripts/pkgdev_tatt.py
+++ b/src/pkgdev/scripts/pkgdev_tatt.py
@@ -234,9 +234,9 @@ def _get_bugzilla_packages(namespace):
     bug = next(iter(nattka_bugzilla.find_bugs(bugs=[namespace.bug]).values()))
     namespace.keywording = bug.category == BugCategory.KEYWORDREQ
     repo = namespace.domain.repos["gentoo"].raw_repo
-    return dict(
-        match_package_list(repo, bug, only_new=True, 
filter_arch=[namespace.domain.arch])
-    ).keys()
+    src_repo = namespace.domain.source_repos_raw
+    for pkg, _ in match_package_list(repo, bug, only_new=True, 
filter_arch=[namespace.domain.arch]):
+        yield src_repo.match(pkg.versioned_atom)[0]
 
 
 def _get_cmd_packages(namespace):

Reply via email to