[cig-commits] r18433 - cs/buildbot/trunk/buildbot/scripts

knepley at geodynamics.org knepley at geodynamics.org
Mon May 23 07:37:38 PDT 2011


Author: knepley
Date: 2011-05-23 07:37:38 -0700 (Mon, 23 May 2011)
New Revision: 18433

Modified:
   cs/buildbot/trunk/buildbot/scripts/packager.py
Log:
Added filterList


Modified: cs/buildbot/trunk/buildbot/scripts/packager.py
===================================================================
--- cs/buildbot/trunk/buildbot/scripts/packager.py	2011-05-23 12:44:38 UTC (rev 18432)
+++ cs/buildbot/trunk/buildbot/scripts/packager.py	2011-05-23 14:37:38 UTC (rev 18433)
@@ -16,7 +16,12 @@
             fullNames.append(os.path.join(dirpath, f))
     return fullNames
 
+def filterList(l, excludes):
+    import re, functools, operator
 
+    pats = [re.compile(ex) for ex in excludes]
+    return [i for i in l if not functools.reduce(operator.or_, [bool(pat.match(i)) for pat in pats])]
+
 class PackingList(object):
     def __init__(self, config, opSys, python):
         
@@ -43,7 +48,7 @@
             self.misc = []
         for d in miscDirs:
             self.misc.extend(walkDirTree(d))
-            
+
         # Scripts are application specific.
         self.scripts = []
         for s in config.packaging.scripts:



More information about the CIG-COMMITS mailing list