diff options
author | Ben Hutchings <benh@debian.org> | 2016-02-29 19:10:55 +0000 |
---|---|---|
committer | Ben Hutchings <benh@debian.org> | 2016-02-29 19:10:55 +0000 |
commit | 36284dea9d632483bc3c61a5734252acd8c86534 (patch) | |
tree | 5250c3ca1cc4c37863c6e718ec6ed97d4ddaccdd /scripts | |
parent | dbf377e19cae7256f582d2a2cf50646d00527fd7 (diff) |
Implement the -s option to filter-active.py
It's existed since day 1. Never had any effect.
git-svn-id: svn+ssh://svn.debian.org/svn/kernel-sec@4209 e094ebfe-e918-0410-adfb-c712417f3574
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/filter-active.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/filter-active.py b/scripts/filter-active.py index ca2b166b..de7ca541 100755 --- a/scripts/filter-active.py +++ b/scripts/filter-active.py @@ -72,17 +72,15 @@ def parse_status(s): else: return m -def filter_out_states(issues, releases, states): +def filter_out_states(issues, releases, states, notstates): filteredissues = [] for i in issues: for release in releases or i.get_releases(): + # Current state must be within 'states' (if specified), and + # must not be within 'notstates' (if specified). m = parse_status(i.status(release)) - drop = False - for s in states: - if s == m.group('state'): - drop = True - break - if drop == False: + if ((m.group('state') in states if states else True) and + (m.group('state') not in notstates if notstates else True)): filteredissues.append(i) break @@ -128,8 +126,9 @@ if __name__ == '__main__': for d in options.dirs: issues = issues + get_issues(d) - if options.notstates: - issues = filter_out_states(issues, options.release, options.notstates) + if options.states or options.notstates: + issues = filter_out_states(issues, options.release, + options.states, options.notstates) if not options.release: all_releases = set() |