summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-16 08:28:47 +0000
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-16 08:28:47 +0000
commitd32aaa956e98417dbdd117301c472627cf7d94e5 (patch)
treea157e058bc4adf3e62798fdacc4ad5f6f342df55 /Tools
parent69932b41f06498e5266d0102a164041bb8f660ab (diff)
downloadedk2-d32aaa956e98417dbdd117301c472627cf7d94e5.zip
edk2-d32aaa956e98417dbdd117301c472627cf7d94e5.tar.gz
edk2-d32aaa956e98417dbdd117301c472627cf7d94e5.tar.bz2
Corrections to the far manifest.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2105 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/Python/MkFar.py63
1 files changed, 36 insertions, 27 deletions
diff --git a/Tools/Python/MkFar.py b/Tools/Python/MkFar.py
index b5284b4..f6355db 100755
--- a/Tools/Python/MkFar.py
+++ b/Tools/Python/MkFar.py
@@ -39,59 +39,68 @@ def parseSpd(spdFile):
for f in XmlList(spd, xmlPath):
filelist.append(str(os.path.join(spdDir, XmlElementData(f))))
- for xmlPath in ["/PackageSurfaceArea/MsaFiles/Filename"]:
- for f in XmlList(spd, xmlPath):
- msaFile = str(os.path.join(spdDir, XmlElementData(f)))
- filelist += parseMsa(msaFile, spdDir)
+ for f in XmlList(spd, "/PackageSurfaceArea/MsaFiles/Filename"):
+ msaFile = str(os.path.join(spdDir, XmlElementData(f)))
+ filelist += parseMsa(msaFile, spdDir)
return filelist
def makeFar(filelist, farname):
- man = \
-"""<?xml version="1.0" encoding="UTF-8"?>
-<FrameworkArchiveManifest>
-</FrameworkArchiveManifest>
-"""
-
domImpl = xml.dom.minidom.getDOMImplementation()
man = domImpl.createDocument(None, "FrameworkArchiveManifest", None)
top_element = man.documentElement
header = man.createElement("FarHeader")
top_element.appendChild(header)
-
+
packList = man.createElement("FarPackageList")
top_element.appendChild(packList)
-
+
platList = man.createElement("FarPlatformList")
top_element.appendChild(platList)
-
+
contents = man.createElement("Contents")
top_element.appendChild(contents)
-
+
zip = zipfile.ZipFile(farname, "w")
- for file in args:
- if not os.path.exists(inWorkspace(file)):
- print "Skipping non-existent file '%s'." % file
- (_, extension) = os.path.splitext(file)
+ for infile in filelist:
+ if not os.path.exists(inWorkspace(infile)):
+ print "Skipping non-existent file '%s'." % infile
+ (_, extension) = os.path.splitext(infile)
if extension == ".spd":
- filelist = parseSpd(file)
+ filelist = parseSpd(infile)
- for file in filelist:
-
- package = man.createElement("FarPackage")
- packList.appendChild(package)
+ package = man.createElement("FarPackage")
+ packList.appendChild(package)
- spdfilename = man.createElement("FarFileName")
- package.appendChild(spdfilename)
+ spdfilename = man.createElement("FarFilename")
+ package.appendChild(spdfilename)
- spdfilename.appendChild( man.createTextNode(file) )
+ spdfilename.appendChild( man.createTextNode(infile) )
+
+ for spdfile in filelist:
+ content = man.createElement("FarFilename")
+ content.appendChild( man.createTextNode(spdfile))
+ contents.appendChild(content)
elif extension == ".fpd":
- filelist = [file]
+ filelist = [infile]
+
+ platform = man.createElement("FarPlatform")
+ platList.appendChild(platform)
+
+ fpdfilename = man.createElement("FarFilename")
+ platform.appendChild(fpdfilename)
+
+ fpdfilename.appendChild( man.createTextNode(infile) )
+
else:
filelist = []
+ content = man.createElement("FarFilename")
+ content.appendChild( man.createTextNode(infile))
+ contents.appendChild(content)
+
for f in set(filelist):
zip.write(inWorkspace(f), f)
zip.writestr("FrameworkArchiveManifest.xml", man.toprettyxml(" "))