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


Python rpm._RPMVSF_NOSIGNATURES属性代码示例

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


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

示例1: __init__

# 需要导入模块: import rpm [as 别名]
# 或者: from rpm import _RPMVSF_NOSIGNATURES [as 别名]
def __init__(self, *args, **kwargs):
        ReviewBot.ReviewBot.__init__(self, *args, **kwargs)

        self.no_review = False
        self.force = False

        self.ts = rpm.TransactionSet()
        self.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)

        # reports of source submission
        self.reports = []
        # textual report summary for use in accept/decline message
        # or comments
        self.text_summary = ''

        self.session = DB.db_session()

        self.dblogger = LogToDB(self.session)

        self.logger.addFilter(self.dblogger)

        self.commentapi = CommentAPI(self.apiurl)

        self.current_request = None 
开发者ID:openSUSE,项目名称:openSUSE-release-tools,代码行数:26,代码来源:abichecker.py

示例2: get_rpm_info

# 需要导入模块: import rpm [as 别名]
# 或者: from rpm import _RPMVSF_NOSIGNATURES [as 别名]
def get_rpm_info(path):
    ts = rpm.TransactionSet()

    # disable signature checks, we might not have the key or the file might be unsigned
    # pre 4.15 RPM needs to use the old name of the bitmask
    try:
        vsflags = rpm.RPMVSF_MASK_NOSIGNATURES
    except AttributeError:
        vsflags = rpm._RPMVSF_NOSIGNATURES
    ts.setVSFlags(vsflags)

    with open(path) as rpmfile:
        rpmhdr = ts.hdrFromFdno(rpmfile)

    name = rpmhdr[rpm.RPMTAG_NAME].decode('ascii')
    epoch = rpmhdr[rpm.RPMTAG_EPOCHNUM]
    version = rpmhdr[rpm.RPMTAG_VERSION].decode('ascii')
    release = rpmhdr[rpm.RPMTAG_RELEASE].decode('ascii')
    arch = rpmhdr[rpm.RPMTAG_ARCH].decode('ascii')

    return (name, epoch, version, release, arch) 
开发者ID:theforeman,项目名称:foreman-ansible-modules,代码行数:23,代码来源:content_upload.py

示例3: _get_rpms

# 需要导入模块: import rpm [as 别名]
# 或者: from rpm import _RPMVSF_NOSIGNATURES [as 别名]
def _get_rpms(self):
        # TODO: External dep!
        import rpm

        chroot_os = os.path.join(self.dest, "rootfs")
        ts = rpm.TransactionSet(chroot_os)
        ts.setVSFlags((rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS))
        image_rpms = []
        for hdr in ts.dbMatch():  # No sorting
            if hdr['name'] == 'gpg-pubkey':
                continue
            else:
                foo = "{0}-{1}-{2}-{3}-{4}".format(hdr['name'],
                                                   hdr['epochnum'],
                                                   hdr['version'],
                                                   hdr['release'],
                                                   hdr['arch'])
                image_rpms.append(foo)
        return image_rpms 
开发者ID:OpenSCAP,项目名称:openscap-daemon,代码行数:21,代码来源:scan.py

示例4: __init__

# 需要导入模块: import rpm [as 别名]
# 或者: from rpm import _RPMVSF_NOSIGNATURES [as 别名]
def __init__(self, *args, **kwargs):
        cmdln.Cmdln.__init__(self, args, kwargs)
        self.ts = rpm.TransactionSet()
        self.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) 
开发者ID:openSUSE,项目名称:openSUSE-release-tools,代码行数:6,代码来源:factory-package-news.py

示例5: yieldSrpmHeaders

# 需要导入模块: import rpm [as 别名]
# 或者: from rpm import _RPMVSF_NOSIGNATURES [as 别名]
def yieldSrpmHeaders(srpms, plainRpmOk=0):
    import rpm
    ts = rpm.TransactionSet('/')
    # When RPM > 4.14.90 is common we can use RPMVSF_MASK_NOSIGNATURES, RPMVSF_MASK_NODIGESTS
    # pylint: disable=protected-access
    flags = (rpm._RPMVSF_NOSIGNATURES | rpm._RPMVSF_NODIGESTS)
    ts.setVSFlags(flags)
    for srpm in srpms:
        srpm = host_file(srpm)
        try:
            fd = os.open(srpm, os.O_RDONLY)
        except OSError as e:
            raise exception.Error("Cannot find/open srpm: %s. Error: %s"
                                  % (srpm, e))
        try:
            hdr = ts.hdrFromFdno(fd)
        except rpm.error as e:
            raise exception.Error(
                "Cannot find/open srpm: %s. Error: %s" % (srpm, e))
        finally:
            os.close(fd)

        if not plainRpmOk and hdr[rpm.RPMTAG_SOURCEPACKAGE] != 1:
            raise exception.Error("File is not an srpm: %s." % srpm)

        yield hdr 
开发者ID:rpm-software-management,项目名称:mock,代码行数:28,代码来源:util.py


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