当前位置: 首页>>代码示例>>Python>>正文


Python PackageUtils.findPackageInfoFromRPMFile方法代码示例

本文整理汇总了Python中PackageUtils.PackageUtils.findPackageInfoFromRPMFile方法的典型用法代码示例。如果您正苦于以下问题:Python PackageUtils.findPackageInfoFromRPMFile方法的具体用法?Python PackageUtils.findPackageInfoFromRPMFile怎么用?Python PackageUtils.findPackageInfoFromRPMFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PackageUtils.PackageUtils的用法示例。


在下文中一共展示了PackageUtils.findPackageInfoFromRPMFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: readAlreadyAvailablePackages

# 需要导入模块: from PackageUtils import PackageUtils [as 别名]
# 或者: from PackageUtils.PackageUtils import findPackageInfoFromRPMFile [as 别名]
 def readAlreadyAvailablePackages(self):
     listAvailablePackages=[]
     listRPMFiles=[]
     listDirectorys=[]
     listDirectorys.append(constants.rpmPath)
     if constants.inputRPMSPath is not None:
         listDirectorys.append(constants.inputRPMSPath)
     
     while len(listDirectorys) > 0:
         dirPath=listDirectorys.pop()
         for dirEntry in os.listdir(dirPath):
             dirEntryPath = os.path.join(dirPath, dirEntry)
             if os.path.isfile(dirEntryPath) and dirEntryPath.endswith(".rpm"):
                 listRPMFiles.append(dirEntryPath)
             elif os.path.isdir(dirEntryPath):
                 listDirectorys.append(dirEntryPath)
     pkgUtils = PackageUtils(self.logName,self.logPath)
     for rpmfile in listRPMFiles:
         package,version,release = pkgUtils.findPackageInfoFromRPMFile(rpmfile)
         if constants.specData.isRPMPackage(package):
             specVersion=constants.specData.getVersion(package)
             specRelease=constants.specData.getRelease(package)
             if version == specVersion and release == specRelease:
                 listAvailablePackages.append(package)
     self.logger.info("List of Already built packages")
     self.logger.info(listAvailablePackages)
     return listAvailablePackages
开发者ID:DheerajSShetty,项目名称:photon,代码行数:29,代码来源:PackageManager.py

示例2: readAlreadyAvailablePackages

# 需要导入模块: from PackageUtils import PackageUtils [as 别名]
# 或者: from PackageUtils.PackageUtils import findPackageInfoFromRPMFile [as 别名]
    def readAlreadyAvailablePackages(self):
        listAvailablePackages=[]
        listFoundRPMPackages=[]
        listRPMFiles=[]
        listDirectorys=[]
        listDirectorys.append(constants.rpmPath)
        if constants.inputRPMSPath is not None:
            listDirectorys.append(constants.inputRPMSPath)

        while len(listDirectorys) > 0:
            dirPath=listDirectorys.pop()
            for dirEntry in os.listdir(dirPath):
                dirEntryPath = os.path.join(dirPath, dirEntry)
                if os.path.isfile(dirEntryPath) and dirEntryPath.endswith(".rpm"):
                    listRPMFiles.append(dirEntryPath)
                elif os.path.isdir(dirEntryPath):
                    listDirectorys.append(dirEntryPath)
        pkgUtils = PackageUtils(self.logName,self.logPath)
        for rpmfile in listRPMFiles:
            package,version,release = pkgUtils.findPackageInfoFromRPMFile(rpmfile)
            if constants.specData.isRPMPackage(package):
                specVersion=constants.specData.getVersion(package)
                specRelease=constants.specData.getRelease(package)
                if version == specVersion and release == specRelease:
                    listFoundRPMPackages.append(package)
        #Mark package available only if all sub packages are available
        for package in listFoundRPMPackages:
            basePkg = constants.specData.getSpecName(package)
            if basePkg in listAvailablePackages:
                continue;
            listRPMPackages = constants.specData.getRPMPackages(basePkg)
            packageIsAlreadyBuilt = True
            for rpmpkg in listRPMPackages:
                if rpmpkg not in listFoundRPMPackages:
                    packageIsAlreadyBuilt = False
            if packageIsAlreadyBuilt:
                listAvailablePackages.append(package)
        self.logger.info("List of Already built packages")
        self.logger.info(listAvailablePackages)
        return listAvailablePackages
开发者ID:megacoder,项目名称:photon,代码行数:42,代码来源:PackageManager.py


注:本文中的PackageUtils.PackageUtils.findPackageInfoFromRPMFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。