1
0
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:
Adrian Schröter 2012-12-06 14:07:02 +01:00
parent fc7e26fef1
commit bfa108810a
3 changed files with 10 additions and 3 deletions

2
NEWS
View File

@ -1,5 +1,5 @@
0.138
-
- add support to remove repositories recursively (mostly only usefull for admins)
0.137
- support single binary download via getbinaries command

View File

@ -548,6 +548,8 @@ class Osc(cmdln.Cmdln):
help='edit metadata')
@cmdln.option('-c', '--create', action='store_true',
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',
help='set attribute values')
@cmdln.option('--delete', action='store_true',
@ -697,6 +699,7 @@ class Osc(cmdln.Cmdln):
edit_meta(metatype='prj',
edit=True,
force=opts.force,
remove_linking_repositories=opts.remove_linking_repositories,
path_args=quote_plus(project),
apiurl=apiurl,
template_args=({
@ -762,6 +765,7 @@ class Osc(cmdln.Cmdln):
data=f,
edit=opts.edit,
force=opts.force,
remove_linking_repositories=opts.remove_linking_repositories,
apiurl=apiurl,
path_args=quote_plus(project))
elif cmd == 'pkg':

View File

@ -3160,7 +3160,7 @@ def meta_exists(metatype,
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
if not apiurl:
@ -3175,6 +3175,8 @@ def make_meta_url(metatype, path_args=None, apiurl=None, force=False):
query = {}
if force:
query = { 'force': '1' }
if remove_linking_repositories:
query['remove_linking_repositories'] = '1'
return makeurl(apiurl, [path], query)
@ -3185,6 +3187,7 @@ def edit_meta(metatype,
template_args=None,
edit=False,
force=False,
remove_linking_repositories=False,
change_is_required=False,
apiurl=None):
@ -3202,7 +3205,7 @@ def edit_meta(metatype,
if edit:
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'])
if edit: