self.verbose = False
self.force = False
self.reinstall = False
+ self.dir = ''
class Database:
XmlElement(fpd, "/PlatformHeader/PlatformName")
for farfile in XmlList(self.dom, "/FrameworkDatabase/FarList/Filename"):
- farGuid = farfile.getAttribute("FarGuid")
+ farGuid = Guid(farfile.getAttribute("FarGuid"))
self.installedFars[farGuid] = XmlElementData(farfile)
self.packageList = XmlNode(self.dom, "/FrameworkDatabase/PackageList")
gpath = ["PlatformSurfaceArea", "PlatformHeader", "GuidValue"]
vpath = ["PlatformSurfaceArea", "PlatformHeader", "Version"]
- return string.lower(XmlElement(Dom, "/".join(gpath[strip:]))), \
- XmlElement(Dom, "/".join(vpath[strip:]))
+ return Guid(XmlElement(Dom, "/".join(gpath[strip:]))), \
+ XmlElement(Dom, "/".join(vpath[strip:]))
def GetSpdGuidVersion(Dom, strip=0):
gpath = ["PackageSurfaceArea", "SpdHeader", "GuidValue"]
vpath = ["PackageSurfaceArea", "SpdHeader", "Version"]
- return string.lower(XmlElement(Dom, "/".join(gpath[strip:]))), \
- XmlElement(Dom, "/".join(vpath[strip:]))
+ return Guid(XmlElement(Dom, "/".join(gpath[strip:]))), \
+ XmlElement(Dom, "/".join(vpath[strip:]))
def InstallFar(farfile, workspaceLocation=""):
msa = XmlParseString(far.read(msafilePath))
for package in XmlList(msa, "/ModuleSurfaceArea/PackageDependencies/Package"):
- guid = package.getAttribute("PackageGuid")
+ guid = Guid(package.getAttribute("PackageGuid"))
version = package.getAttribute("PackageVersion")
# Does anyone provide this package?
# Go through the dependencies
for dependency in XmlList(fpd, "/PlatformSurfaceArea/FrameworkModules/ModuleSA") + \
XmlList(fpd, "/PlatformSurfaceArea/FrameworkModules/ModuleSA/Libraries/Instance"):
- packagesNeeded.add((string.lower(dependency.getAttribute("PackageGuid")),
- dependency.getAttribute("PackageVersion")))
+ packagesNeeded.add((Guid(dependency.getAttribute("PackageGuid")),
+ dependency.getAttribute("PackageVersion")))
# Let's see if all the packages are in the workspace
for guid, version in packagesNeeded:
installError = True
# Check the fars
- thisFarGuid = string.lower(XmlElement(manifest, "/FrameworkArchiveManifest/FarHeader/GuidValue"))
+ thisFarGuid = Guid(XmlElement(manifest, "/FrameworkArchiveManifest/FarHeader/GuidValue"))
if fdb.HasFar(thisFarGuid):
if not flags.reinstall:
print "Error: There is a far with this guid already installed."
flags = Flags()
# Process the command line args.
- optlist, args = getopt.getopt(sys.argv[1:], '?hvf', ['help', 'verbose', 'force', 'reinstall'])
+ optlist, args = getopt.getopt(sys.argv[1:], '?hvfd:', ['directory=', 'help', 'verbose', 'force', 'reinstall'])
# First pass through the options list.
for o, a in optlist:
optlist.remove((o,a))
if o in ["-v", "--verbose"]:
flags.verbose = True
+ if o in ["-d", "--directory"]:
+ flags.dir = a
if o in ["-f", "--force"]:
flags.force = True
if o in ["--reinstall"]: