mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-24 00:56:15 +01:00
- fix description of rdelete commands and make a difference to enforce it on server side or to ignore the content. Famous rm -rf command exists now :)
This commit is contained in:
parent
19a9765065
commit
0a7492cdf8
@ -2795,8 +2795,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
undelete_project(apiurl, prj)
|
||||
|
||||
|
||||
@cmdln.option('-r', '--recursive', action='store_true',
|
||||
help='deletes a project with packages inside')
|
||||
@cmdln.option('-f', '--force', action='store_true',
|
||||
help='deletes a package or an empty project')
|
||||
help='deletes a project where other depends on')
|
||||
def do_rdelete(self, subcmd, opts, *args):
|
||||
"""${cmd_name}: Delete a project or packages on the server.
|
||||
|
||||
@ -2804,10 +2806,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
packages first). Also, packages must have no requests pending (i.e., you need
|
||||
to accept/revoke such requests first).
|
||||
If you are sure that you want to remove this project and all
|
||||
its packages use \'--force\' switch.
|
||||
its packages use \'--recursive\' switch.
|
||||
It may still not work because other depends on it. If you want to ignore this as
|
||||
well use \'--force\' switch.
|
||||
|
||||
usage:
|
||||
osc rdelete [-f] PROJECT [PACKAGE]
|
||||
osc rdelete [-r] [-f] PROJECT [PACKAGE]
|
||||
|
||||
${cmd_option_list}
|
||||
"""
|
||||
@ -2838,15 +2842,15 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
'Or just use \'--force\'.'
|
||||
sys.exit(1)
|
||||
|
||||
delete_package(apiurl, prj, pkg)
|
||||
delete_package(apiurl, prj, pkg, opts.force)
|
||||
|
||||
elif len(meta_get_packagelist(apiurl, prj)) >= 1 and not opts.force:
|
||||
elif (not opts.recursive) and len(meta_get_packagelist(apiurl, prj)) >= 1:
|
||||
print >>sys.stderr, 'Project contains packages. It must be empty before deleting it. ' \
|
||||
'If you are sure that you want to remove this project and all its ' \
|
||||
'packages use the \'--force\' switch.'
|
||||
'packages use the \'--with-packages\' switch.'
|
||||
sys.exit(1)
|
||||
else:
|
||||
delete_project(apiurl, prj)
|
||||
delete_project(apiurl, prj, opts.force)
|
||||
|
||||
@cmdln.hide(1)
|
||||
def do_deletepac(self, subcmd, opts, *args):
|
||||
|
14
osc/core.py
14
osc/core.py
@ -4527,12 +4527,18 @@ def undelete_project(apiurl, prj):
|
||||
http_POST(u)
|
||||
|
||||
|
||||
def delete_package(apiurl, prj, pac):
|
||||
u = makeurl(apiurl, ['source', prj, pac])
|
||||
def delete_package(apiurl, prj, pac, force=False):
|
||||
query = {}
|
||||
if force:
|
||||
query['force'] = "1"
|
||||
u = makeurl(apiurl, ['source', prj, pac], query)
|
||||
http_DELETE(u)
|
||||
|
||||
def delete_project(apiurl, prj):
|
||||
u = makeurl(apiurl, ['source', prj])
|
||||
def delete_project(apiurl, prj, force=False):
|
||||
query = {}
|
||||
if force:
|
||||
query['force'] = "1"
|
||||
u = makeurl(apiurl, ['source', prj], query)
|
||||
http_DELETE(u)
|
||||
|
||||
def delete_files(apiurl, prj, pac, files):
|
||||
|
Loading…
Reference in New Issue
Block a user