コード例 #1
0
 def readSpecsAndConvertToSerializableObjects(self, specFilesPath):
     listSpecFiles = []
     self.getListSpecFiles(listSpecFiles, specFilesPath)
     for specFile in listSpecFiles:
         spec = Specutils(specFile)
         specName = spec.getBasePackageName()
         specObj = SpecObject()
         specObj.name = specName
         specObj.buildRequiresAllPackages = spec.getBuildRequiresAllPackages(
         )
         specObj.extraBuildRequires = spec.getExtraBuildRequires()
         specObj.installRequiresAllPackages = spec.getRequiresAllPackages()
         specObj.checkBuildRequirePackages = spec.getCheckBuildRequiresAllPackages(
         )
         specObj.listPackages = spec.getPackageNames()
         specObj.specFile = specFile
         specObj.version = spec.getVersion()
         specObj.release = spec.getRelease()
         specObj.listSources = spec.getSourceNames()
         specObj.checksums = spec.getChecksums()
         specObj.specDefs = spec.getDefinitions()
         specObj.listPatches = spec.getPatchNames()
         specObj.securityHardening = spec.getSecurityHardeningOption()
         specObj.isCheckAvailable = spec.isCheckAvailable()
         specObj.license = spec.getLicense()
         specObj.url = spec.getURL()
         specObj.sourceurl = spec.getSourceURL()
         for specPkg in specObj.listPackages:
             specObj.installRequiresPackages[specPkg] = spec.getRequires(
                 specPkg)
             specObj.buildarch[specPkg] = spec.getBuildArch(specPkg)
             # TODO add multiversioning support
             self.mapPackageToSpec[specPkg] = specName
             if spec.getIsRPMPackage(specPkg):
                 specObj.listRPMPackages.append(specPkg)
         if specName in self.mapSpecObjects:
             self.mapSpecObjects[specName].append(specObj)
         else:
             self.mapSpecObjects[specName] = [specObj]
         self.mapSpecFileNameToSpecObj[os.path.basename(specFile)] = specObj
     for key, value in self.mapSpecObjects.items():
         if len(value) > 1:
             self.mapSpecObjects[key] = sorted(
                 value, key=lambda x: self.compareVersions(x), reverse=True)
コード例 #2
0
 def readSpecsAndConvertToSerializableObjects(self, specFilesPath):
     listSpecFiles = []
     self.getListSpecFiles(listSpecFiles, specFilesPath)
     for specFile in listSpecFiles:
         skipUpdating = False
         spec = Specutils(specFile)
         specName = spec.getBasePackageName()
         specObj = SerializableSpecObject()
         specObj.name = specName
         specObj.buildRequirePackages = spec.getBuildRequiresAllPackages()
         specObj.installRequiresAllPackages = spec.getRequiresAllPackages()
         specObj.checkBuildRequirePackages = spec.getCheckBuildRequiresAllPackages(
         )
         specObj.listPackages = spec.getPackageNames()
         specObj.specFile = specFile
         specObj.version = spec.getVersion()
         specObj.release = spec.getRelease()
         specObj.listSources = spec.getSourceNames()
         specObj.checksums = spec.getChecksums()
         specObj.specDefs = spec.getDefinitions()
         specObj.listPatches = spec.getPatchNames()
         specObj.securityHardening = spec.getSecurityHardeningOption()
         specObj.isCheckAvailable = spec.isCheckAvailable()
         specObj.license = spec.getLicense()
         specObj.url = spec.getURL()
         specObj.sourceurl = spec.getSourceURL()
         for specPkg in specObj.listPackages:
             if specPkg in self.mapPackageToSpec:
                 existingObj = self.mapSerializableSpecObjects[
                     self.mapPackageToSpec[specPkg]]
                 if self.compareVersions(existingObj, specObj) == 1:
                     skipUpdating = True
                     break
             specObj.installRequiresPackages[specPkg] = spec.getRequires(
                 specPkg)
             self.mapPackageToSpec[specPkg] = specName
             if spec.getIsRPMPackage(specPkg):
                 specObj.listRPMPackages.append(specPkg)
         if not skipUpdating:
             self.mapSerializableSpecObjects[specName] = specObj
コード例 #3
0
ファイル: SpecData.py プロジェクト: vinaykul/photon
 def readSpecsAndConvertToSerializableObjects(self, specFilesPath):
     listSpecFiles = []
     self.getListSpecFiles(listSpecFiles, specFilesPath)
     for specFile in listSpecFiles:
         skipUpdating = False
         spec = Specutils(specFile)
         specName = spec.getBasePackageName()
         specObj = SerializableSpecObject()
         specObj.name = specName
         specObj.buildRequirePackages = spec.getBuildRequiresAllPackages()
         specObj.installRequiresAllPackages = spec.getRequiresAllPackages()
         specObj.checkBuildRequirePackages = spec.getCheckBuildRequiresAllPackages()
         specObj.listPackages = spec.getPackageNames()
         specObj.specFile = specFile
         specObj.version = spec.getVersion()
         specObj.release = spec.getRelease()
         specObj.listSources = spec.getSourceNames()
         specObj.checksums = spec.getChecksums()
         specObj.specDefs = spec.getDefinitions()
         specObj.listPatches = spec.getPatchNames()
         specObj.securityHardening = spec.getSecurityHardeningOption()
         specObj.isCheckAvailable = spec.isCheckAvailable()
         specObj.license = spec.getLicense()
         specObj.url = spec.getURL()
         specObj.sourceurl = spec.getSourceURL()
         for specPkg in specObj.listPackages:
             if specPkg in self.mapPackageToSpec:
                 existingObj = self.mapSerializableSpecObjects[self.mapPackageToSpec[specPkg]]
                 if self.compareVersions(existingObj, specObj) == 1:
                     skipUpdating = True
                     break
             specObj.installRequiresPackages[specPkg] = spec.getRequires(specPkg)
             self.mapPackageToSpec[specPkg] = specName
             if spec.getIsRPMPackage(specPkg):
                 specObj.listRPMPackages.append(specPkg)
         if not skipUpdating:
             self.mapSerializableSpecObjects[specName] = specObj
コード例 #4
0
ファイル: SpecData.py プロジェクト: TiejunChina/photon
 def readSpecsAndConvertToSerializableObjects(self, specFilesPath):
     listSpecFiles = []
     self.getListSpecFiles(listSpecFiles, specFilesPath)
     for specFile in listSpecFiles:
         spec = Specutils(specFile)
         specName = spec.getBasePackageName()
         specObj = SpecObject()
         specObj.name = specName
         specObj.buildRequirePackages,specObj.specParseObjBuildRequirePackages = spec.getBuildRequiresAllPackages()
         specObj.installRequiresAllPackages,specObj.specParseObjInstallRequiresPackages = spec.getRequiresAllPackages()
         specObj.checkBuildRequirePackages,specObj.specParseObjCheckBuildRequirePackages = spec.getCheckBuildRequiresAllPackages()
         specObj.listPackages = spec.getPackageNames()
         specObj.specFile = specFile
         specObj.version = spec.getVersion()
         specObj.release = spec.getRelease()
         specObj.listSources = spec.getSourceNames()
         specObj.checksums = spec.getChecksums()
         specObj.specDefs = spec.getDefinitions()
         specObj.listPatches = spec.getPatchNames()
         specObj.securityHardening = spec.getSecurityHardeningOption()
         specObj.isCheckAvailable = spec.isCheckAvailable()
         specObj.license = spec.getLicense()
         specObj.url = spec.getURL()
         specObj.sourceurl = spec.getSourceURL()
         for specPkg in specObj.listPackages:
             specObj.installRequiresPackages[specPkg] = spec.getRequires(specPkg)
             self.mapPackageToSpec[specPkg] = specName
             if spec.getIsRPMPackage(specPkg):
                 specObj.listRPMPackages.append(specPkg)
         if specName in self.mapSpecObjects:
             self.mapSpecObjects[specName].append(specObj)
         else:
             self.mapSpecObjects[specName]=[specObj]
     for key, value in self.mapSpecObjects.items():
         if len(value) > 1:
             self.mapSpecObjects[key] = sorted(value,
                                               key=lambda x : self.compareVersions(x),
                                               reverse=True)