aboutsummaryrefslogtreecommitdiff
path: root/tatt
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2016-12-22 06:07:45 +1100
committerMichael Palimaka <kensington@gentoo.org>2016-12-22 06:54:48 +1100
commitfaea11639892c8175f34b62c8315713395e75d16 (patch)
tree2794d87a61bfcf27574b23881c29dbc2073f231e /tatt
parentReplace hard-coded bug update script with brand new template. (diff)
downloadtatt-faea11639892c8175f34b62c8315713395e75d16.tar.gz
tatt-faea11639892c8175f34b62c8315713395e75d16.tar.bz2
tatt-faea11639892c8175f34b62c8315713395e75d16.zip
When using -b, fetch atoms from the new atom field or flagged attachment.
Diffstat (limited to 'tatt')
-rw-r--r--tatt/packageFinder.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/tatt/packageFinder.py b/tatt/packageFinder.py
index f0fb467..c1d7bd0 100644
--- a/tatt/packageFinder.py
+++ b/tatt/packageFinder.py
@@ -1,13 +1,17 @@
-"""module for identifying package names in files and strings"""
+"""module for extracting packages from a package/architecture list """
-import re
from .gentooPackage import gentooPackage as gP
-def findPackages (s, regexp):
+def findPackages (s, arch):
""" Given a string s,
- and a compiled regexp regexp
- return all gentooPacakges that can be identified in the string"""
+ and a string arch
+ return all gentooPackages from that string that need actioning on that arch """
- # Should it be this simple?
- return [gP(ps) for ps in regexp.findall(s)]
- # Yes, it is...
+ packages = []
+
+ for line in s.splitlines():
+ atom, _, arches = line.partition(' ')
+ if not arches or arch in arches.split(' '):
+ packages.append(gP(atom))
+
+ return(packages)