Skip to content

Commit

Permalink
consider arch when checking the disabled repos
Browse files Browse the repository at this point in the history
At the moment just repo.name is considered. So if
the repo is disabled for s390 all other repo / arch
combination are not shown in the repo list.

To be able to change this r is now a list of dicts
containing the name and arch of the disabled repo.

None for repo if a complete arch gets disabled
None for arch if a complete repo gets disabled
  • Loading branch information
lethliel committed Nov 8, 2017
1 parent 3c1bb1c commit 12b17cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 7 additions & 3 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5846,13 +5846,17 @@ def do_repositories(self, subcmd, opts, *args):

if subcmd == 'repos_only':
for repo in get_repositories_of_project(apiurl, project):
if (disabled is None) or ((disabled is not None) and (repo not in disabled)):
if (disabled is None) or ((disabled is not None) and (repo not in [d['repo'] for d in disabled])):
print(repo)
else:
data = []
for repo in get_repos_of_project(apiurl, project):
if (disabled is None) or ((disabled is not None) and (repo.name not in disabled)):
data += [repo.name, repo.arch]
if disabled is not None:
if ({'repo': repo.name, 'arch': repo.arch} in disabled
or repo.name in [d['repo'] for d in disabled if d['arch'] is None]
or repo.arch in [d['arch'] for d in disabled if d['repo'] is None]):
continue
data += [repo.name, repo.arch]

for row in build_table(2, data, width=2):
print(row)
Expand Down
9 changes: 7 additions & 2 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,12 @@ def show_package_disabled_repos(apiurl, prj, pac):
try:
root = ET.fromstring(''.join(m))
elm = root.find('build')
r = [ node.get('repository') for node in elm.findall('disable')]
r = []
for node in elm.findall('disable'):
repo = node.get('repository')
arch = node.get('arch')
dis_r = {'repo': repo, 'arch': arch}
r.append(dis_r)
return r
except:
return None
Expand Down Expand Up @@ -7182,7 +7187,7 @@ def safe_get_rpmlint_log(src_actions):
print('Type %s:' % action.type)
disabled = show_package_disabled_repos(apiurl, action.src_project, action.src_package)
for repo in get_repos_of_project(apiurl, action.src_project):
if disabled is None or repo.name not in disabled:
if (disabled is None) or (repo.name not in [d['repo'] for d in disabled]):
lintlog_entry = {
'proj': action.src_project,
'pkg': action.src_package,
Expand Down

0 comments on commit 12b17cf

Please sign in to comment.