diff options
author | Chris Lamb <lamby@debian.org> | 2017-01-06 20:26:15 +0000 |
---|---|---|
committer | Chris Lamb <lamby@debian.org> | 2017-01-06 20:26:15 +0000 |
commit | cb93dbfab59b8cac92dc87d2271e242baefadc79 (patch) | |
tree | 2344a449b6282277cb7777d1cf00097bbc2664cc /bin/tracker_data.py | |
parent | 0d79b9dbf09fa2927b8df39a9f2b887416a4a391 (diff) |
Always strip whitespace from EOL
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@47794 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/tracker_data.py')
-rw-r--r-- | bin/tracker_data.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/tracker_data.py b/bin/tracker_data.py index f25aff44c9..9f61d66abf 100644 --- a/bin/tracker_data.py +++ b/bin/tracker_data.py @@ -107,12 +107,14 @@ class TrackerData(object): @classmethod def parse_needed_file(self, inputfile): - PKG_RE = '^(\S+)(?:\s+\((.*)\)\s*)?$' - SEP_RE = '^--\s*$' + PKG_RE = '^(\S+)(?:\s+\((.*)\))?$' + SEP_RE = '^--$' state = 'LOOK_FOR_SEP' result = {} package = '' for line in inputfile: + # Always strip whitespace from end of line + line = line.rstrip() if state == 'LOOK_FOR_SEP': res = re.match(SEP_RE, line) if not res: |