mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-22 21:16:16 +01:00
add support to remove repositories recursively (mostly only usefull for admins)
This commit is contained in:
parent
fc7e26fef1
commit
bfa108810a
2
NEWS
2
NEWS
@ -1,5 +1,5 @@
|
|||||||
0.138
|
0.138
|
||||||
-
|
- add support to remove repositories recursively (mostly only usefull for admins)
|
||||||
|
|
||||||
0.137
|
0.137
|
||||||
- support single binary download via getbinaries command
|
- support single binary download via getbinaries command
|
||||||
|
@ -548,6 +548,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
help='edit metadata')
|
help='edit metadata')
|
||||||
@cmdln.option('-c', '--create', action='store_true',
|
@cmdln.option('-c', '--create', action='store_true',
|
||||||
help='create attribute without values')
|
help='create attribute without values')
|
||||||
|
@cmdln.option('-R', '--remove-linking-repositories', action='store_true',
|
||||||
|
help='Try to remove also all repositories building against remove ones.')
|
||||||
@cmdln.option('-s', '--set', metavar='ATTRIBUTE_VALUES',
|
@cmdln.option('-s', '--set', metavar='ATTRIBUTE_VALUES',
|
||||||
help='set attribute values')
|
help='set attribute values')
|
||||||
@cmdln.option('--delete', action='store_true',
|
@cmdln.option('--delete', action='store_true',
|
||||||
@ -697,6 +699,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
edit_meta(metatype='prj',
|
edit_meta(metatype='prj',
|
||||||
edit=True,
|
edit=True,
|
||||||
force=opts.force,
|
force=opts.force,
|
||||||
|
remove_linking_repositories=opts.remove_linking_repositories,
|
||||||
path_args=quote_plus(project),
|
path_args=quote_plus(project),
|
||||||
apiurl=apiurl,
|
apiurl=apiurl,
|
||||||
template_args=({
|
template_args=({
|
||||||
@ -762,6 +765,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
data=f,
|
data=f,
|
||||||
edit=opts.edit,
|
edit=opts.edit,
|
||||||
force=opts.force,
|
force=opts.force,
|
||||||
|
remove_linking_repositories=opts.remove_linking_repositories,
|
||||||
apiurl=apiurl,
|
apiurl=apiurl,
|
||||||
path_args=quote_plus(project))
|
path_args=quote_plus(project))
|
||||||
elif cmd == 'pkg':
|
elif cmd == 'pkg':
|
||||||
|
@ -3160,7 +3160,7 @@ def meta_exists(metatype,
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def make_meta_url(metatype, path_args=None, apiurl=None, force=False):
|
def make_meta_url(metatype, path_args=None, apiurl=None, force=False, remove_linking_repositories=False):
|
||||||
global metatypes
|
global metatypes
|
||||||
|
|
||||||
if not apiurl:
|
if not apiurl:
|
||||||
@ -3175,6 +3175,8 @@ def make_meta_url(metatype, path_args=None, apiurl=None, force=False):
|
|||||||
query = {}
|
query = {}
|
||||||
if force:
|
if force:
|
||||||
query = { 'force': '1' }
|
query = { 'force': '1' }
|
||||||
|
if remove_linking_repositories:
|
||||||
|
query['remove_linking_repositories'] = '1'
|
||||||
|
|
||||||
return makeurl(apiurl, [path], query)
|
return makeurl(apiurl, [path], query)
|
||||||
|
|
||||||
@ -3185,6 +3187,7 @@ def edit_meta(metatype,
|
|||||||
template_args=None,
|
template_args=None,
|
||||||
edit=False,
|
edit=False,
|
||||||
force=False,
|
force=False,
|
||||||
|
remove_linking_repositories=False,
|
||||||
change_is_required=False,
|
change_is_required=False,
|
||||||
apiurl=None):
|
apiurl=None):
|
||||||
|
|
||||||
@ -3202,7 +3205,7 @@ def edit_meta(metatype,
|
|||||||
if edit:
|
if edit:
|
||||||
change_is_required = True
|
change_is_required = True
|
||||||
|
|
||||||
url = make_meta_url(metatype, path_args, apiurl, force)
|
url = make_meta_url(metatype, path_args, apiurl, force, remove_linking_repositories)
|
||||||
f=metafile(url, data, change_is_required, metatypes[metatype]['file_ext'])
|
f=metafile(url, data, change_is_required, metatypes[metatype]['file_ext'])
|
||||||
|
|
||||||
if edit:
|
if edit:
|
||||||
|
Loading…
Reference in New Issue
Block a user