summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2023-09-07 11:50:53 +0900
committerbiao716.wang <biao716.wang@samsung.com>2023-09-07 12:19:09 +0900
commit13b33ec25fdb8f96f81db6d600a18455f92070e3 (patch)
treeccf07a4e7e0435d9e07475a827df8ea1c501020a
parentba67c11e6054062a5a5258bc628265fa394e12c6 (diff)
downloadgit-buildpackage-13b33ec25fdb8f96f81db6d600a18455f92070e3.tar.gz
git-buildpackage-13b33ec25fdb8f96f81db6d600a18455f92070e3.tar.bz2
git-buildpackage-13b33ec25fdb8f96f81db6d600a18455f92070e3.zip
now librpm-tizen return string not bytes on 4.14 version
Change-Id: Ie8b2e8fee66f4acc16476ccd4779e1602666817d Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rw-r--r--gbp/rpm/__init__.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index 54e9e6a9..d4b74dde 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)