1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-24 19:22:13 +01:00

implement 'deletepac' subcommand

This commit is contained in:
Dr. Peter Poeml 2006-08-11 10:37:29 +00:00
parent b6dd183168
commit 768dcb9b4a
2 changed files with 27 additions and 0 deletions

View File

@ -141,6 +141,24 @@ See the examples in the _link file.
link_pac(src_project, src_package, dst_project, dst_package)
def deletepac(args):
"""deletepac: Delete a package on the server.
usage: osc deletepac <prj> <pac>
"""
if not args or len(args) < 2:
print 'missing argument'
print
print deletepac.func_doc
sys.exit(1)
project = args[0]
package = args[1]
delete_package(project, package)
def updatepacmetafromspec(args):
"""Update package meta information from a specfile
@ -772,6 +790,7 @@ cmd_dict = {
commit: ['commit', 'ci', 'checkin'],
checkout: ['checkout', 'co'],
updatepacmetafromspec: ['updatepacmetafromspec'],
deletepac: ['deletepac'],
diff: ['diff'],
editmeta: ['editmeta'],
help: ['help'],

View File

@ -1050,6 +1050,13 @@ def link_pac(src_project, src_package, dst_project, dst_package):
print 'Done.'
def delete_package(prj, pac):
import othermethods
u = makeurl(['source', prj, pac])
othermethods.delfile(u, pac, username, password)
def get_platforms():
f = urlopen(makeurl(['platform']))
tree = ET.parse(f)
@ -1169,6 +1176,7 @@ def store_read_package(dir):
p = open(os.path.join(dir, store, '_package')).readlines()[0].strip()
return p
def get_osc_version():
return __version__