From d717c4b2dd63ef4e9da09a5f31a6d278ac7921a0 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sat, 28 Mar 2015 13:36:47 +0100 Subject: [PATCH] Fix to have gen_db.py also include files that accidentally have uppercase file extensions, affecting ~200 files previously skipped. --- test/regression/gen_db.py | 2 +- test/regression/utils.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/regression/gen_db.py b/test/regression/gen_db.py index 2a9d55a5f..4005fe161 100644 --- a/test/regression/gen_db.py +++ b/test/regression/gen_db.py @@ -164,7 +164,7 @@ def gen_db(ext_list,outfile): num = 0 for tp in settings.model_directories: num += process_dir(tp, outfile, - lambda x: os.path.splitext(x)[1] in ext_list and not x in settings.files_to_ignore) + lambda x: os.path.splitext(x)[1].lower() in ext_list and not x in settings.files_to_ignore) print("="*60) print("Updated {0} entries".format(num)) diff --git a/test/regression/utils.py b/test/regression/utils.py index 8e358e9b0..7c759b795 100644 --- a/test/regression/utils.py +++ b/test/regression/utils.py @@ -50,15 +50,13 @@ def hashing(file,pp): needs to be persistent across different python implementations and platforms, so we implement the hashing manually. """ - + file = file.lower() file = file.replace('\\','/')+":"+pp # SDBM hash res = 0 for t in file: res = (ord(t) + (res<<6) + (res<<16) - res) % 2**32 - - # Python 2.7 normalization: strip 'L' suffix. - return hex(res).rstrip('L') + return '{:x}'.format(res) # vim: ai ts=4 sts=4 et sw=4