summaryrefslogtreecommitdiff
path: root/Tools/Python
diff options
context:
space:
mode:
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-16 07:50:00 +0000
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-12-16 07:50:00 +0000
commit69932b41f06498e5266d0102a164041bb8f660ab (patch)
tree21914f57fe9bf752ee305fac58ba795804a61979 /Tools/Python
parente853a9d4831ae95363ce5fdcce71cbb23aff2269 (diff)
downloadedk2-platforms-69932b41f06498e5266d0102a164041bb8f660ab.tar.xz
Start to build the manifest.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2104 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools/Python')
-rwxr-xr-xTools/Python/MkFar.py34
1 files changed, 30 insertions, 4 deletions
diff --git a/Tools/Python/MkFar.py b/Tools/Python/MkFar.py
index 1dba1fc4aa..b5284b4781 100755
--- a/Tools/Python/MkFar.py
+++ b/Tools/Python/MkFar.py
@@ -6,7 +6,7 @@ from WorkspaceRoutines import *
def parseMsa(msaFile, spdDir):
- filelist = []
+ filelist = [msaFile]
msaDir = os.path.dirname(msaFile)
@@ -42,8 +42,6 @@ def parseSpd(spdFile):
for xmlPath in ["/PackageSurfaceArea/MsaFiles/Filename"]:
for f in XmlList(spd, xmlPath):
msaFile = str(os.path.join(spdDir, XmlElementData(f)))
- filelist.append(msaFile)
-
filelist += parseMsa(msaFile, spdDir)
return filelist
@@ -55,6 +53,23 @@ def makeFar(filelist, farname):
<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)):
@@ -62,13 +77,24 @@ def makeFar(filelist, farname):
(_, extension) = os.path.splitext(file)
if extension == ".spd":
filelist = parseSpd(file)
+
+ for file in filelist:
+
+ package = man.createElement("FarPackage")
+ packList.appendChild(package)
+
+ spdfilename = man.createElement("FarFileName")
+ package.appendChild(spdfilename)
+
+ spdfilename.appendChild( man.createTextNode(file) )
+
elif extension == ".fpd":
filelist = [file]
else:
filelist = []
for f in set(filelist):
zip.write(inWorkspace(f), f)
- zip.writestr("FrameworkArchiveManifest.xml", man)
+ zip.writestr("FrameworkArchiveManifest.xml", man.toprettyxml(" "))
zip.close()
return