Delete unmaintained.py
This commit is contained in:
parent
c10ef71528
commit
afd1fb6c67
@ -98,15 +98,6 @@ Releases distribution snapshots to openQA and publishes if the result is positiv
|
|||||||
* Package: openSUSE-release-tools
|
* Package: openSUSE-release-tools
|
||||||
* Usage: [gocd](https://github.com/openSUSE/openSUSE-release-tools/search?q=path%3A%2Fgocd+totest-manager)
|
* Usage: [gocd](https://github.com/openSUSE/openSUSE-release-tools/search?q=path%3A%2Fgocd+totest-manager)
|
||||||
|
|
||||||
#### unmaintained
|
|
||||||
|
|
||||||
Finds unmaintained binaries sourced from SLE.
|
|
||||||
|
|
||||||
* Sources: [unmaintained.py](unmaintained.py)
|
|
||||||
* Documentation: --
|
|
||||||
* Package: openSUSE-release-tools
|
|
||||||
* Usage: obsolete
|
|
||||||
|
|
||||||
#### bugowner
|
#### bugowner
|
||||||
|
|
||||||
Manages bugowner information
|
Manages bugowner information
|
||||||
|
1
dist/package/openSUSE-release-tools.spec
vendored
1
dist/package/openSUSE-release-tools.spec
vendored
@ -397,7 +397,6 @@ exit 0
|
|||||||
%{_bindir}/osrt-openqa-maintenance
|
%{_bindir}/osrt-openqa-maintenance
|
||||||
%{_bindir}/osrt-requestfinder
|
%{_bindir}/osrt-requestfinder
|
||||||
%{_bindir}/osrt-scan_baselibs
|
%{_bindir}/osrt-scan_baselibs
|
||||||
%{_bindir}/osrt-unmaintained
|
|
||||||
%{_bindir}/osrt-totest-manager
|
%{_bindir}/osrt-totest-manager
|
||||||
%{_datadir}/%{source_dir}
|
%{_datadir}/%{source_dir}
|
||||||
%exclude %{_datadir}/%{source_dir}/abichecker
|
%exclude %{_datadir}/%{source_dir}/abichecker
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
from lxml import etree as ET
|
|
||||||
from osc import conf
|
|
||||||
from osc.core import meta_get_filelist
|
|
||||||
from osclib.core import package_binary_list
|
|
||||||
from osclib.core import source_file_load
|
|
||||||
import sys
|
|
||||||
import yaml
|
|
||||||
|
|
||||||
def kiwi_binaries(apiurl, project):
|
|
||||||
binaries = set()
|
|
||||||
for filename in meta_get_filelist(apiurl, project, '000product'):
|
|
||||||
if not filename.endswith('.kiwi'):
|
|
||||||
continue
|
|
||||||
|
|
||||||
kiwi = ET.fromstring(source_file_load(
|
|
||||||
apiurl, project, '000product', filename))
|
|
||||||
|
|
||||||
binaries.update(kiwi.xpath('//instsource/repopackages/repopackage/@name'))
|
|
||||||
|
|
||||||
return binaries
|
|
||||||
|
|
||||||
def unmaintained(apiurl, project_target):
|
|
||||||
lookup = yaml.safe_load(source_file_load(
|
|
||||||
apiurl, project_target, '00Meta', 'lookup.yml'))
|
|
||||||
lookup_total = len(lookup)
|
|
||||||
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', exclude_src_debug=True)
|
|
||||||
package_binaries_total = len(package_binaries)
|
|
||||||
package_binaries = [pb for pb in package_binaries if pb.package in lookup]
|
|
||||||
|
|
||||||
# Determine max length possible for each column.
|
|
||||||
maxes = [
|
|
||||||
len(max([b.name for b in package_binaries], key=len)),
|
|
||||||
len(max(lookup.keys(), key=len)),
|
|
||||||
len(max(lookup.values(), key=len)),
|
|
||||||
]
|
|
||||||
line_format = ' '.join(['{:<' + str(m) + '}' for m in maxes])
|
|
||||||
|
|
||||||
print(line_format.format('binary', 'package', 'source project'))
|
|
||||||
|
|
||||||
project_sources = {}
|
|
||||||
binaries_unmaintained = 0
|
|
||||||
packages_unmaintained = set()
|
|
||||||
for package_binary in sorted(package_binaries, key=lambda pb: pb.name):
|
|
||||||
project_source = lookup[package_binary.package]
|
|
||||||
if project_source not in project_sources:
|
|
||||||
# Load binaries referenced in kiwi the first time source encountered.
|
|
||||||
project_sources[project_source] = kiwi_binaries(apiurl, project_source)
|
|
||||||
|
|
||||||
if package_binary.name not in project_sources[project_source]:
|
|
||||||
print(line_format.format(
|
|
||||||
package_binary.name, package_binary.package, project_source))
|
|
||||||
|
|
||||||
binaries_unmaintained += 1
|
|
||||||
packages_unmaintained.add(package_binary.package)
|
|
||||||
|
|
||||||
print('{:,} of {:,} binaries ({:,} packages) unmaintained from SLE of {:,} total binaries ({:,} packages) in project'.format(
|
|
||||||
binaries_unmaintained, len(package_binaries), len(packages_unmaintained), package_binaries_total, lookup_total))
|
|
||||||
|
|
||||||
def main(args):
|
|
||||||
conf.get_config(override_apiurl=args.apiurl)
|
|
||||||
conf.config['debug'] = args.debug
|
|
||||||
apiurl = conf.config['apiurl']
|
|
||||||
|
|
||||||
return not unmaintained(apiurl, args.project_target)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
description = 'Review each binary in target project sourced from SLE to see if utilized in kiwi files.'
|
|
||||||
parser = argparse.ArgumentParser(description=description)
|
|
||||||
parser.add_argument('-A', '--apiurl', help='OBS instance API URL')
|
|
||||||
parser.add_argument('-d', '--debug', action='store_true', help='print useful debugging info')
|
|
||||||
parser.add_argument('project_target', help='target project to search')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
sys.exit(main(args))
|
|
Loading…
x
Reference in New Issue
Block a user