2017-06-14 23:51:14 -05:00
|
|
|
from __future__ import print_function
|
2019-05-29 13:56:46 +02:00
|
|
|
from osclib.core import duplicated_binaries_in_repo
|
2017-06-14 23:51:14 -05:00
|
|
|
import yaml
|
|
|
|
|
|
|
|
class CheckDuplicateBinariesCommand(object):
|
|
|
|
def __init__(self, api):
|
|
|
|
self.api = api
|
|
|
|
|
|
|
|
def perform(self, save=False):
|
2019-05-29 13:56:46 +02:00
|
|
|
duplicates = duplicated_binaries_in_repo(self.api.apiurl, self.api.project, 'standard')
|
2017-12-22 13:36:46 +01:00
|
|
|
|
|
|
|
current = yaml.dump(duplicates, default_flow_style=False)
|
2017-06-14 23:51:14 -05:00
|
|
|
if save:
|
2018-08-17 23:19:24 -05:00
|
|
|
self.api.pseudometa_file_ensure('duplicate_binaries', current)
|
2017-07-07 16:05:23 +02:00
|
|
|
else:
|
2017-12-22 13:36:46 +01:00
|
|
|
print(current)
|