Permalink
Browse files

add support to remove repositories recursively (mostly only usefull f…

…or admins)
  • Loading branch information...
adrianschroeter committed Dec 6, 2012
1 parent fc7e26f commit bfa108810acbafaa9d81e8d1c0b075cc829d17dc
Showing with 10 additions and 3 deletions.
  1. +1 −1 NEWS
  2. +4 −0 osc/commandline.py
  3. +5 −2 osc/core.py
View
2 NEWS
@@ -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
@@ -548,6 +548,8 @@ def do_develproject(self, subcmd, opts, *args):
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 @@ def do_meta(self, subcmd, opts, *args):
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 @@ def do_meta(self, subcmd, opts, *args):
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
@@ -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:

0 comments on commit bfa1088

Please sign in to comment.