aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2004-08-04 15:17:07 +0000
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2004-08-04 15:17:07 +0000
commit3c05929dbe404cefc93838996d5390a8893eb6e5 (patch)
treec34cfef8c70f34bc3d5136ce466b215afde0465b /bin
parentda8273d8164626e48755f26a487fd075388a24d4 (diff)
downloadbitbake-3c05929dbe404cefc93838996d5390a8893eb6e5.tar.gz
improve performance by compiling the OEMASK regexp out of the loop
catch faulty OEMASKs and emit a user friendly error message
Diffstat (limited to 'bin')
-rw-r--r--bin/oe/make.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/oe/make.py b/bin/oe/make.py
index 82684688a..92098dd9e 100644
--- a/bin/oe/make.py
+++ b/bin/oe/make.py
@@ -10,7 +10,7 @@ This file is part of the OpenEmbedded (http://openembedded.org) build infrastruc
"""
from oe import debug, digraph, data, fetch, fatal, error, note, event, parse
-import copy, oe, re, sys, os, glob
+import copy, oe, re, sys, os, glob, sre_constants
try:
import cPickle as pickle
except ImportError:
@@ -152,14 +152,17 @@ def collect_oefiles( progressCallback ):
continue
newfiles += glob.glob(f) or [ f ]
+ oemask = oe.data.getVar('OEMASK', cfg, 1)
+ try:
+ oemask_compiled = re.compile(oemask)
+ except sre_constants.error:
+ oe.fatal("OEMASK is not a valid regular expression.")
+
for i in xrange( len( newfiles ) ):
f = newfiles[i]
- oemask = oe.data.getVar('OEMASK', cfg, 1)
- if oemask:
- if re.search(oemask, f):
- oe.debug(1, "oemake: skipping %s" % f)
- continue
-
+ if oemask and re.search(oemask_compiled, f):
+ oe.debug(1, "oemake: skipping %s" % f)
+ continue
progressCallback( i + 1, len( newfiles ), f )
debug(1, "oemake: parsing %s" % f)