X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FEot%2Fc.py;h=c70f62f393a9751b839c637c94c16df13a6c8e9d;hp=8b11ed378f0e74cd1e4fa8fed5877b04c1e1c9ae;hb=72443dd25014a8b6209895640af36dec33da51e0;hpb=79714906ae765f161969dfddc34adee857be97d6 diff --git a/BaseTools/Source/Python/Eot/c.py b/BaseTools/Source/Python/Eot/c.py index 8b11ed378f..c70f62f393 100644 --- a/BaseTools/Source/Python/Eot/c.py +++ b/BaseTools/Source/Python/Eot/c.py @@ -1,9 +1,9 @@ ## @file # preprocess source file # -# Copyright (c) 2007 - 2010, Intel Corporation +# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# -# All rights reserved. This program and the accompanying materials +# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php @@ -15,8 +15,9 @@ ## # Import Modules # +from __future__ import print_function import sys -import os +import Common.LongFilePathOs as os import re import CodeFragmentCollector import FileProfile @@ -31,16 +32,6 @@ IncludePathListDict = {} ComplexTypeDict = {} SUDict = {} -## GetIgnoredDirListPattern() method -# -# Get the pattern of ignored direction list -# -# @return p: the pattern of ignored direction list -# -def GetIgnoredDirListPattern(): - p = re.compile(r'.*[\\/](?:BUILD|INTELRESTRICTEDTOOLS|INTELRESTRICTEDPKG|PCCTS)[\\/].*') - return p - ## GetFuncDeclPattern() method # # Get the pattern of function declaration @@ -353,9 +344,12 @@ def GetFunctionList(): def CreateCCodeDB(FileNameList): FileObjList = [] ParseErrorFileList = [] - + ParsedFiles = {} for FullName in FileNameList: if os.path.splitext(FullName)[1] in ('.h', '.c'): + if FullName.lower() in ParsedFiles: + continue + ParsedFiles[FullName.lower()] = 1 EdkLogger.info("Parsing " + FullName) model = FullName.endswith('c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H collector = CodeFragmentCollector.CodeFragmentCollector(FullName) @@ -391,4 +385,4 @@ if __name__ == '__main__': EdkLogger.SetLevel(EdkLogger.QUIET) CollectSourceCodeDataIntoDB(sys.argv[1]) - print 'Done!' + print('Done!')