diff options
Diffstat (limited to 'tatt')
-rw-r--r-- | tatt/packageFinder.py | 17 |
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: |