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


Python PackageUtils.ensureLMDBForRPMDB方法代码示例

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


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

示例1: installToolChainRPMS

# 需要导入模块: from PackageUtils import PackageUtils [as 别名]
# 或者: from PackageUtils.PackageUtils import ensureLMDBForRPMDB [as 别名]
    def installToolChainRPMS(self, chrootID, packageName, logPath=None):
        if logPath is None:
            logPath = self.logPath
        cmdUtils = CommandUtils()
        self.prepareBuildRoot(chrootID)
        self.logger.info("Installing Tool Chain RPMS.......")
        rpmFiles = ""
        packages = ""
        for package in constants.listToolChainRPMsToInstall:
            pkgUtils = PackageUtils(self.logName, self.logPath)
            rpmFile = None
            if constants.rpmCheck:
                rpmFile = pkgUtils.findRPMFileForGivenPackage(package)
            else:
                if (packageName not in constants.listToolChainRPMsToInstall or
                        constants.listToolChainRPMsToInstall.index(packageName) >
                        constants.listToolChainRPMsToInstall.index(package)):
                    rpmFile = pkgUtils.findRPMFileForGivenPackage(package)
            if rpmFile is None:
                # sqlite-autoconf package was renamed, but it still published as sqlite-autoconf
                if (package == "sqlite") and (platform.machine() == "x86_64"):
                    package = "sqlite-autoconf"
                rpmFile = self.findRPMFileInGivenLocation(package, constants.prevPublishRPMRepo)
                if rpmFile is None:
                    if package in constants.listOfRPMsProvidedAfterBuild:
                        self.logger.info("No old version of " + package +
                                         " exists, skip until the new version is built")
                        continue
                    self.logger.error("Unable to find rpm " + package +
                                      " in current and previous versions")
                    raise Exception("Input Error")
            rpmFiles += " " + rpmFile
            packages += " " + package

        self.logger.debug("Installing toolchain rpms:" + packages)
        cmd = (self.rpmCommand + " -i -v --nodeps --noorder --force --root " +
               chrootID +" --define \'_dbpath /var/lib/rpm\' "+ rpmFiles)
        retVal = cmdUtils.runCommandInShell(cmd, logPath + "/install_toolchain_rpms.log")
        if not retVal:
            self.logger.debug("Command Executed:" + cmd)
            self.logger.error("Installing tool chain  failed")
            raise Exception("RPM installation failed")
        self.logger.info("Successfully installed default Tool Chain RPMS in Chroot:" + chrootID)
        print("Building Package: ".format(packageName))
        print(constants.perPackageToolChain)
        if packageName in constants.perPackageToolChain:
            print(constants.perPackageToolChain[packageName])
            self.installCustomToolChainRPMS(chrootID, constants.perPackageToolChain[packageName],
                                            packageName)
        #convert rpm db to lmdb (if required)
        convertLogFile = self.logPath+"/rpmdbconvert.log"
        pkgUtilsConvert=PackageUtils(self.logName,self.logPath)
        pkgUtilsConvert.ensureLMDBForRPMDB(chrootID, convertLogFile)
开发者ID:vinaykul,项目名称:photon,代码行数:55,代码来源:ToolChainUtils.py


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