1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-11 16:36:14 +01:00

- fix enable channel logic for given channel package

This commit is contained in:
Adrian Schröter 2015-09-04 11:09:40 +02:00
parent c902d174d8
commit 0b34cb4567

View File

@ -478,19 +478,20 @@ class Osc(cmdln.Cmdln):
channel = args[1]
query = {'cmd': 'addchannels'}
if subcmd in ('enablechannels', 'enablechannel'):
query['cmd'] = 'enablechannel'
if opts.enable_all or subcmd in ('enablechannels', 'enablechannel'):
query['enable_all'] = '1'
if channel is None:
query['cmd'] = 'modifychannels'
query['enable_all'] = '1'
else:
if opts.enable_all and opts.skip_disabled:
raise oscerr.WrongOptions('--enable-all and --skip-disabled options are mutually exclusive')
elif opts.enable_all:
query['enable_all'] = '1'
elif opts.skip_disabled:
query['skip_disabled'] = '1'
if channel:
query['cmd'] = 'enablechannel'
if opts.enable_all and opts.skip_disabled:
raise oscerr.WrongOptions('--enable-all and --skip-disabled options are mutually exclusive')
elif opts.enable_all:
query['enable_all'] = '1'
elif opts.skip_disabled:
query['skip_disabled'] = '1'
print("Looking for channels...")
url = makeurl(apiurl, ['source', project], query=query)
if channel: