diff options
author | wangbiao <biao716.wang@samsung.com> | 2023-11-16 16:47:23 +0900 |
---|---|---|
committer | wangbiao <biao716.wang@samsung.com> | 2023-11-16 16:47:49 +0900 |
commit | 4e00c63267f2c6bd7d46a206d75ebff372e7a7c1 (patch) | |
tree | 0a116b4685a14b0af2381ff1fec6690939083ee9 | |
parent | 7c410722041b91df52ed95ea4fb3401ccfdb0514 (diff) | |
parent | 13b33ec25fdb8f96f81db6d600a18455f92070e3 (diff) | |
download | git-buildpackage-4e00c63267f2c6bd7d46a206d75ebff372e7a7c1.tar.gz git-buildpackage-4e00c63267f2c6bd7d46a206d75ebff372e7a7c1.tar.bz2 git-buildpackage-4e00c63267f2c6bd7d46a206d75ebff372e7a7c1.zip |
Merge remote-tracking branch 'origin/sandbox/wangbiao/py3_version' into develdebian/0.9.28
Change-Id: I490a052925258158e7be621cca78ee1eb31753d2
Signed-off-by: wangbiao <biao716.wang@samsung.com>
-rw-r--r-- | gbp/rpm/__init__.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py index 926f66e4..a4e6b791 100644 --- a/gbp/rpm/__init__.py +++ b/gbp/rpm/__init__.py @@ -65,10 +65,10 @@ class SrcRpmFile(object): """Keeps all needed data read from a source rpm""" def __init__(self, srpmfile): # Do not required signed packages to be able to import - ts_vsflags = (librpm.RPMVSF_NOMD5HEADER | librpm.RPMVSF_NORSAHEADER | + ts_vsflags = (librpm.RPMVSF_NOSHA256HEADER | librpm.RPMVSF_NORSAHEADER | librpm.RPMVSF_NOSHA1HEADER | librpm.RPMVSF_NODSAHEADER | librpm.RPMVSF_NOMD5 | librpm.RPMVSF_NORSA | - librpm.RPMVSF_NOSHA1 | librpm.RPMVSF_NODSA) + librpm.RPMVSF_NOPAYLOAD | librpm.RPMVSF_NODSA) srpmfp = open(srpmfile) self.rpmhdr = librpm.ts(vsflags=ts_vsflags).hdrFromFdno(srpmfp.fileno()) srpmfp.close() @@ -77,8 +77,8 @@ class SrcRpmFile(object): @property def version(self): """Get the (downstream) version of the RPM package""" - version = dict(upstreamversion=self.rpmhdr[librpm.RPMTAG_VERSION].decode(), - release=self.rpmhdr[librpm.RPMTAG_RELEASE].decode()) + version = dict(upstreamversion=self.rpmhdr[librpm.RPMTAG_VERSION], + release=self.rpmhdr[librpm.RPMTAG_RELEASE]) if self.rpmhdr[librpm.RPMTAG_EPOCH] is not None: version['epoch'] = str(self.rpmhdr[librpm.RPMTAG_EPOCH]) return version @@ -86,17 +86,17 @@ class SrcRpmFile(object): @property def name(self): """Get the name of the RPM package""" - return self.rpmhdr[librpm.RPMTAG_NAME].decode() + return self.rpmhdr[librpm.RPMTAG_NAME] @property def upstreamversion(self): """Get the upstream version of the RPM package""" - return self.rpmhdr[librpm.RPMTAG_VERSION].decode() + return self.rpmhdr[librpm.RPMTAG_VERSION] @property def packager(self): """Get the packager of the RPM package""" - return _decode(self.rpmhdr[librpm.RPMTAG_PACKAGER]) + return self.rpmhdr[librpm.RPMTAG_PACKAGER] def unpack(self, dest_dir): """ @@ -164,13 +164,13 @@ class SpecFile(object): # Other initializations source_header = self._specinfo.packages[0].header - self.name = source_header[librpm.RPMTAG_NAME].decode() - self.upstreamversion = source_header[librpm.RPMTAG_VERSION].decode() - self.release = source_header[librpm.RPMTAG_RELEASE].decode() + self.name = source_header[librpm.RPMTAG_NAME] + self.upstreamversion = source_header[librpm.RPMTAG_VERSION] + self.release = source_header[librpm.RPMTAG_RELEASE] # rpm-python returns epoch as 'long', convert that to string self.epoch = str(source_header[librpm.RPMTAG_EPOCH]) \ if source_header[librpm.RPMTAG_EPOCH] is not None else None - self.packager = _decode(source_header[librpm.RPMTAG_PACKAGER]) + self.packager = source_header[librpm.RPMTAG_PACKAGER] self._tags = {} self._special_directives = defaultdict(list) self._gbp_tags = defaultdict(list) |