Move the core functionality of check_duplicate_binaries_command to be reusable from installcheck.
17 lines
532 B
Python
17 lines
532 B
Python
from __future__ import print_function
|
|
from osclib.core import duplicated_binaries_in_repo
|
|
import yaml
|
|
|
|
class CheckDuplicateBinariesCommand(object):
|
|
def __init__(self, api):
|
|
self.api = api
|
|
|
|
def perform(self, save=False):
|
|
duplicates = duplicated_binaries_in_repo(self.api.apiurl, self.api.project, 'standard')
|
|
|
|
current = yaml.dump(duplicates, default_flow_style=False)
|
|
if save:
|
|
self.api.pseudometa_file_ensure('duplicate_binaries', current)
|
|
else:
|
|
print(current)
|