aboutsummaryrefslogtreecommitdiff
path: root/tatt
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2020-05-02 05:25:35 +0000
committerSam James <sam@gentoo.org>2020-09-10 19:07:29 +0000
commitf36367445c64e28200a3fbb8ef7be4295cabeba9 (patch)
tree4b93c7ee8992919b8cdca7be1da793ff056e8611 /tatt
parentremove unmaskfile config option, use unmaskdir instead (diff)
downloadtatt-f36367445c64e28200a3fbb8ef7be4295cabeba9.tar.gz
tatt-f36367445c64e28200a3fbb8ef7be4295cabeba9.tar.bz2
tatt-f36367445c64e28200a3fbb8ef7be4295cabeba9.zip
package lists: Use nattka to parse keywording bugs
NATTkA is now used for most of the package lists on Bugzilla. Use it to parse the lists because currently we cannot handle package atoms with no version in keywording bugs. Closes: https://github.com/gentoo/tatt/issues/66 Closes: https://github.com/gentoo/tatt/issues/65 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'tatt')
-rw-r--r--tatt/packageFinder.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index a404d39..24c69ac 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -1,17 +1,28 @@
"""module for extracting packages from a package/architecture list """
-
+import subprocess
from .gentooPackage import gentooPackage as gP
-def findPackages (s, arch):
+def findPackages (s, arch, repo, bugnum):
""" Given a string s,
and a string arch
return all gentooPackages from that string that need actioning on that arch """
packages = []
- for line in s.splitlines():
+ if bugnum:
+ print("Using Nattka to process the bug")
+ output = subprocess.check_output(['nattka', '--repo', repo, 'apply', '-a', arch, '-n', bugnum, '--ignore-sanity-check', '--ignore-dependencies'])
+ output = output.decode("utf8").split("\n")
+ output = [line for line in output if not line.startswith("#")]
+ output = [line.split(" ")[0] for line in output]
+ else:
+ print("Manually processing")
+ output = s.splitlines()
+
+ for line in output:
if not line:
continue
+
atom, _, arches = line.replace('\t', ' ').partition(' ')
archlist = arches.split(' ')
if not arches or arch in archlist or ('~' + arch) in archlist: