aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-08-19 15:10:38 +0000
committerlloyd <[email protected]>2011-08-19 15:10:38 +0000
commite35f7f60454b98fb578f7c51332ae44fff9fb405 (patch)
tree18137fc80428e40772784f3abb3f5f4c76da6547 /configure.py
parentff69cb87512464e135e2207f62c0052ed58c176a (diff)
Search for an exact match in both arch and submodel before trying
regex matching. Increases the odds we'll get the correct/intended target. Debian bug 638347.
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/configure.py b/configure.py
index 9e26ba3b0..8ad910cb6 100755
--- a/configure.py
+++ b/configure.py
@@ -910,13 +910,24 @@ def fixup_proc_name(proc):
def canon_processor(archinfo, proc):
proc = fixup_proc_name(proc)
+ # First, try to search for an exact match
for ainfo in archinfo.values():
if ainfo.basename == proc or proc in ainfo.aliases:
return (ainfo.basename, ainfo.basename)
- else:
- for (match,submodel) in ainfo.all_submodels():
- if re.search(match, proc) != None:
- return (ainfo.basename, submodel)
+
+ for (match,submodel) in ainfo.all_submodels():
+ if proc == submodel or proc == match:
+ return (ainfo.basename, submodel)
+
+ logging.debug('Could not find an exact match for CPU "%s"' % (proc))
+
+ # Now, try searching via regex match
+ for ainfo in archinfo.values():
+ for (match,submodel) in ainfo.all_submodels():
+ if re.search(match, proc) != None:
+ logging.debug('Possible match "%s" with "%s" (%s)' % (
+ proc, match, submodel))
+ return (ainfo.basename, submodel)
logging.debug('Known CPU names: ' + ' '.join(
sorted(sum([[ainfo.basename] + \