Merge pull request #1503 from jberry-suse/unmaintained-debug-ignore

unmaintained: utilize package_binary_list(exclude_src_debug).
This commit is contained in:
Jimmy Berry 2018-04-24 11:31:28 -05:00 committed by GitHub
commit 855f660bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -121,7 +121,7 @@ def binary_list(apiurl, project, repository, arch, package=None):
return parsed
@memoize(session=True)
def package_binary_list(apiurl, project, repository, arch, package=None):
def package_binary_list(apiurl, project, repository, arch, package=None, exclude_src_debug=False):
path = ['build', project, repository, arch]
if package:
path.append(package)
@ -140,12 +140,23 @@ def package_binary_list(apiurl, project, repository, arch, package=None):
if not result:
continue
package_binaries.append(BinaryParsed(package, result.group('filename'),
result.group('name'), result.group('arch')))
binary = BinaryParsed(package, result.group('filename'),
result.group('name'), result.group('arch'))
if exclude_src_debug and binary_src_debug(binary):
continue
package_binaries.append(binary)
binary_map[result.group('filename')] = package
return package_binaries, binary_map
def binary_src_debug(binary):
return (
binary.arch == 'src' or
binary.name.endswith('-debuginfo') or
binary.name.endswith('-debugsource')
)
@memoize(session=True)
def devel_project_get(apiurl, target_project, target_package):
try:

View File

@ -29,9 +29,9 @@ def unmaintained(apiurl, project_target):
lookup = {k: v for k, v in lookup.iteritems() if v.startswith('SUSE:SLE')}
package_binaries, _ = package_binary_list(
apiurl, project_target, 'standard', 'x86_64')
apiurl, project_target, 'standard', 'x86_64', exclude_src_debug=True)
package_binaries_total = len(package_binaries)
package_binaries = [pb for pb in package_binaries if pb.arch != 'src' and pb.package in lookup]
package_binaries = [pb for pb in package_binaries if pb.package in lookup]
# Determine max length possible for each column.
maxes = [