summaryrefslogtreecommitdiff
path: root/gbp/pkg
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2022-10-28 12:42:00 +0900
committerbiao716.wang <biao716.wang@samsung.com>2022-10-28 22:27:21 +0900
commit1e5da010ab8cb514b495eb7c1d3afce6baec7f4d (patch)
tree5b76563463d1b46ff399bf99907c54e5ce03e561 /gbp/pkg
parentb0bfbb2cab1b0ebdc9657c89de6bc21ab0de173b (diff)
downloadgit-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.tar.gz
git-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.tar.bz2
git-buildpackage-1e5da010ab8cb514b495eb7c1d3afce6baec7f4d.zip
port code from python2.x to python3.x
Change-Id: I798c72d07e44839cc5d1e25ec75fca0bd8068567 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'gbp/pkg')
-rw-r--r--gbp/pkg/__init__.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/gbp/pkg/__init__.py b/gbp/pkg/__init__.py
index 8162286b..320973d2 100644
--- a/gbp/pkg/__init__.py
+++ b/gbp/pkg/__init__.py
@@ -86,7 +86,7 @@ def parse_archive_filename(filename):
base_name = ".".join(split[:-1])
(archive_fmt, compression) = (split[-1], None)
else:
- for (c, o) in compressor_opts.iteritems():
+ for (c, o) in compressor_opts.items():
if o[1] == split[-1]:
base_name = ".".join(split[:-1])
compression = c
@@ -187,14 +187,13 @@ class PkgPolicy(object):
version_chars = r'[a-zA-Z\d\.\~\-\:\+]'
basename = parse_archive_filename(os.path.basename(filename))[0]
- version_filters = map ( lambda x: x % version_chars,
- ( # Debian upstream tarball: package_'<version>.orig.tar.gz'
+ version_filters = [x % version_chars for x in ( # Debian upstream tarball: package_'<version>.orig.tar.gz'
r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)\.orig',
# Debian native: 'package_<version>.tar.gz'
r'^(?P<package>[a-z\d\.\+\-]+)_(?P<version>%s+)',
# Upstream 'package-<version>.tar.gz'
# or directory 'package-<version>':
- r'^(?P<package>[a-zA-Z\d\.\+\-]+)(-)(?P<version>[0-9]%s*)'))
+ r'^(?P<package>[a-zA-Z\d\.\+\-]+)(-)(?P<version>[0-9]%s*)')]
if extra_regex:
version_filters = extra_regex + version_filters
@@ -509,7 +508,7 @@ class UpstreamSource(object):
@staticmethod
def known_compressions():
- return [ args[1][-1] for args in compressor_opts.items() ]
+ return [ args[1][-1] for args in list(compressor_opts.items()) ]
def guess_version(self, extra_regex=r''):
return self._pkg_policy.guess_upstream_src_version(self.path,