# HG changeset patch # User Bernhard Urban # Date 1398257945 -7200 # Node ID 25633b639fd7f81364b0704cfcd6e7476efe29ab # Parent 6e1d5f3e461561ff5bd03b51fbb02ae15aa190a2 mx: support simple filename globbing in whitelist diff -r 6e1d5f3e4615 -r 25633b639fd7 mx/mx_graal.py --- a/mx/mx_graal.py Wed Apr 23 14:44:24 2014 +0200 +++ b/mx/mx_graal.py Wed Apr 23 14:59:05 2014 +0200 @@ -35,6 +35,7 @@ import sanitycheck import itertools import json, textwrap +import fnmatch, re # This works because when mx loads this file, it makes sure __file__ gets an absolute path _graal_home = dirname(dirname(__file__)) @@ -861,7 +862,7 @@ projectscp = mx.classpath(projs) if whitelist: - classes = list(set(classes) & set(whitelist)) + classes = [c for c in classes if any([glob.match(c) for glob in whitelist])] if len(classes) != 0: f_testfile = open(testfile, 'w') @@ -966,7 +967,7 @@ if parsed_args.whitelist: try: with open(join(_graal_home, parsed_args.whitelist)) as fp: - whitelist = [l.rstrip() for l in fp.readlines() if not l.startswith('#')] + whitelist = [re.compile(fnmatch.translate(l.rstrip())) for l in fp.readlines() if not l.startswith('#')] except IOError: mx.log('warning: could not read whitelist: ' + parsed_args.whitelist)