+ spd = XmlParseStringSection(far.read(spdfile), "SpdHeader")
+ packageGV = GetSpdGuidVersion(spd, 1)
+ if fdb.HasPackage(packageGV):
+ if not flags.reinstall:
+ print "Error: This package is already installed: ", spdfile
+ installError = True
+
+ # Build up a list of the package guid versions that this far is bringing in.
+ # This is needed to satisfy dependencies of msas that are in the other packages of
+ # this far.
+ farSpds.append(packageGV)
+
+ spdDoms.append((spd, spdfile))
+
+ for spd, spdfile in spdDoms:
+ # Now we need to get a list of every msa in this spd and check the package dependencies.
+ for msafile in XmlList(spd, "/PackageSurfaceArea/MsaFiles/Filename"):
+ msafilePath = str(os.path.join(os.path.dirname(spdfile), XmlElementData(msafile)))
+
+ msa = XmlParseString(far.read(msafilePath))
+
+ for package in XmlList(msa, "/ModuleSurfaceArea/PackageDependencies/Package"):
+ guid = Guid(package.getAttribute("PackageGuid"))
+ version = package.getAttribute("PackageVersion")
+
+ # Does anyone provide this package?
+ if not fdb.HasPackage((guid, version)) and not (guid, version) in farSpds:
+ print ("Error: The module %s depends on the package guid %s version %s, which " + \
+ "is not installed in the workspace, nor is it provided by this far.") \
+ % (msafilePath, guid, version)
+ installError = True