}) print( "Processor:\t%(processorSpeed)s %(processorType)s" % { "processorSpeed": plistData[0]["_items"][0]["current_processor_speed"], "processorType": plistData[0]["_items"][0]["cpu_type"] }) print("Memory:\t\t%(memorySize)s" % {"memorySize": plistData[0]["_items"][0]["physical_memory"]}) # ToDo: print out the information about the disk the restore volume is on # create a tempfile location for asr to write onto # create the tempMountPoint to mount the image to tempMountPoint = tempFolderManager.getNewTempFolder( prefix="sourceMountPoint.") # create a tempfile for hdiutil to write onto hdiutilOutfilePath = tempFolderManager.getNewTempFile(prefix="outputFile.", suffix=".dmg") # process things for thisDMG in sourceFiles: thisDMGWithShadow = thisDMG.getVersionWithShadowFile( thisDMG.getStoragePath(), shadowFile=True) # the source options to use sourceOptions = [{ "message": "Creating image from volume",
# grab the relevent data from system_profiler systemProfilerCommand = ["/usr/sbin/system_profiler", "-xml", "SPHardwareDataType"] process = managedSubprocess(systemProfilerCommand, processAsPlist=True) plistData = process.getPlistObject() print("Computer Type:\t%(machineName)s (%(machineModel)s)" % {"machineName":plistData[0]["_items"][0]["machine_name"], "machineModel":plistData[0]["_items"][0]["machine_model"]}) print("Processor:\t%(processorSpeed)s %(processorType)s" % {"processorSpeed":plistData[0]["_items"][0]["current_processor_speed"], "processorType":plistData[0]["_items"][0]["cpu_type"]}) print("Memory:\t\t%(memorySize)s" % {"memorySize":plistData[0]["_items"][0]["physical_memory"]}) # ToDo: print out the information about the disk the restore volume is on # create a tempfile location for asr to write onto # create the tempMountPoint to mount the image to tempMountPoint = tempFolderManager.getNewTempFolder(prefix="sourceMountPoint.") # create a tempfile for hdiutil to write onto hdiutilOutfilePath = tempFolderManager.getNewTempFile(prefix="outputFile.", suffix=".dmg") # process things for thisDMG in sourceFiles: thisDMGWithShadow = thisDMG.getVersionWithShadowFile(thisDMG.getStoragePath(), shadowFile=True) # the source options to use sourceOptions = [ {"message":"Creating image from volume", "command":["/usr/bin/hdiutil", "create", "-nocrossdev", "-ov", "-srcfolder", tempMountPoint, hdiutilOutfilePath], "mountImage":True}, {"message":"Converting dmg image directly", "command":["/usr/bin/hdiutil", "convert", thisDMG.getStoragePath(), "-o", hdiutilOutfilePath, "-ov"]} ]
optionsParser.error(error) try: cacheController.addSourceFolders(options.searchFolders) except ValueError, error: optionsParser.error(error) # ----- run process ----- controllers = [] # create the InstaUp2Date controllers for catalogFilePath in baseCatalogFiles: sectionFolders = None if options.processWithInstaDMG is True: tempFolder = tempFolderManager.getNewTempFolder(prefix='items-') sectionFolders = [{ "folderPath": tempFolder, "sections": [ "OS Updates", "System Settings", "Apple Updates", "Third Party Software", "Third Party Settings", "Software Settings" ] }] else: sectionFolders = [{ "folderPath": os.path.join(commonConfiguration.pathToInstaDMGFolder, "InstallerFiles", "BaseUpdates"),
optionsParser.error(error) try: cacheController.addSourceFolders(options.searchFolders) except ValueError, error: optionsParser.error(error) # ----- run process ----- controllers = [] # create the InstaUp2Date controllers for catalogFilePath in baseCatalogFiles: sectionFolders = None if options.processWithInstaDMG is True: tempFolder = tempFolderManager.getNewTempFolder(prefix='items-') sectionFolders = [ {"folderPath":tempFolder, "sections":["OS Updates", "System Settings", "Apple Updates", "Third Party Software", "Third Party Settings", "Software Settings"]} ] else: sectionFolders = [ {"folderPath":os.path.join(commonConfiguration.pathToInstaDMGFolder, "InstallerFiles", "BaseUpdates"), "sections":["OS Updates", "System Settings"]}, {"folderPath":os.path.join(commonConfiguration.pathToInstaDMGFolder, "InstallerFiles", "CustomPKG"), "sections":["Apple Updates", "Third Party Software", "Third Party Settings", "Software Settings"]} ] controllers.append(instaUpToDate(catalogFilePath, sectionFolders, options.catalogFolders)) # note: we have already sanitized catalogFilePath # process the catalog files for thisController in controllers: print('\nParsing the catalog files for ' + thisController.getMainCatalogName())