X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FPython%2FMkFar.py;h=327c81a94a28e3033128fbb91ab7f5ed5ce64f43;hp=105f1f49dee16e1a152319d477bf2a7c8727be2a;hb=6e73f334d9fb98a532e602feee487f7310899060;hpb=d0f7ef3eb2c5dad621356b768d0ab4959decb6d3 diff --git a/Tools/Python/MkFar.py b/Tools/Python/MkFar.py index 105f1f49de..327c81a94a 100755 --- a/Tools/Python/MkFar.py +++ b/Tools/Python/MkFar.py @@ -1,20 +1,38 @@ #!/usr/bin/env python -import os, sys, re, getopt, string, glob, xml.dom.minidom, pprint, zipfile, tempfile +import os, sys, getopt, string, xml.dom.minidom, zipfile, md5 from XmlRoutines import * from WorkspaceRoutines import * +class Far: + """This class is used to collect arbitrarty data from the template file.""" + def __init__(far): + """Assign the default values for the far fields.""" + far.FileName = "output.far" + far.FarName="" + far.Version="" + far.License="" + far.Abstract="" + far.Description="" + far.Copyright="" + far.SpdFiles=[] + far.FpdFiles=[] + far.ExtraFiles=[] + +far = Far() + def parseMsa(msaFile, spdDir): filelist = [msaFile] msaDir = os.path.dirname(msaFile) - msa = xml.dom.minidom.parse(inWorkspace(msaFile)) + msa = xml.dom.minidom.parse(inWorkspace(os.path.join(spdDir, msaFile))) xmlPaths = [ - "/ModuleSurfaceArea/SourceFiles/Filename" ] - + "/ModuleSurfaceArea/SourceFiles/Filename", + "/ModuleSurfaceArea/NonProcessedFiles/Filename" ] + for xmlPath in xmlPaths: for f in XmlList(msa, xmlPath): filelist.append(str(os.path.join(msaDir, XmlElementData(f)))) @@ -23,8 +41,7 @@ def parseMsa(msaFile, spdDir): def parseSpd(spdFile): - filelist = [spdFile] - msaFileList = [] + files = [] spdDir = os.path.dirname(spdFile) @@ -33,26 +50,73 @@ def parseSpd(spdFile): xmlPaths = [ "/PackageSurfaceArea/LibraryClassDeclarations/LibraryClass/IncludeHeader", "/PackageSurfaceArea/IndustryStdIncludes/IndustryStdHeader/IncludeHeader", - "/PackageSurfaceArea/