[kernel-sec-discuss] r4209 - scripts

Ben Hutchings benh at moszumanska.debian.org
Mon Feb 29 19:10:55 UTC 2016


Author: benh
Date: 2016-02-29 19:10:55 +0000 (Mon, 29 Feb 2016)
New Revision: 4209

Modified:
   scripts/filter-active.py
Log:
Implement the -s option to filter-active.py

It's existed since day 1.  Never had any effect.


Modified: scripts/filter-active.py
===================================================================
--- scripts/filter-active.py	2016-02-29 18:48:33 UTC (rev 4208)
+++ scripts/filter-active.py	2016-02-29 19:10:55 UTC (rev 4209)
@@ -72,17 +72,15 @@
     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 @@
     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()




More information about the kernel-sec-discuss mailing list