From 7a8c7664da5c787985a1d756abfc1baa27bda736 Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Fri, 15 Sep 2006 10:53:44 +0000 Subject: [PATCH] add subcommands createpac/editpac and createprj/editprj, which wrap around editmeta but are more logical to find; fix help message of editmeta subcommand --- TODO | 11 +++++++++-- osc/commandline.py | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 08ef1e1d..8ee8b965 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,6 @@ - implement 'info' command - implement 'mv' command -- creation of new project (workaround: editmeta ) -- creation of new package (workaround: editmeta prj ) - editing of user data @@ -14,6 +12,7 @@ In which form would this be integrated best? - clean up the way how a .oscrc template is being added: at the moment, there are two places doing this +- implement a 'copypac' command, which copies a package into another project checkin: @@ -110,6 +109,14 @@ osc repos server:search:ui : 16:59 < kesselborn> for var in ['OSC_SU_WRAPPER', 'OSC_BUILD_ROOT', 'OSC_PACKAGECACHEDIR', 'BUILD_ROOT'] 16:59 < kesselborn> Du hast OSC_SU_WRAPPER', 'OSC_BUILD_ROOT', vergessen + + # osc build SUSE_Factory i586 xorg-x11-libX11.spec +> ['/usr/bin/osc', 'build', 'i38', 'i386', 'SUSE_Factory', 'i586', 'xorg-x11-libX11.spec'] +> Error: specfile 'SUSE_Factory' does not exist. +BUILD_DIST must *not* be set! Could you add this information to the +'osc help build' text? + + curl -d " " -n "http://api.opensuse.org/source/server:php/php5_hardened?cmd=rebuild&arch=i586&repo=SUSE_Linux_10.0" diff --git a/osc/commandline.py b/osc/commandline.py index dbd58255..bcb2fbf9 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -79,6 +79,37 @@ usage: osc meta Apache # show meta of project 'Apache' print ''.join(show_project_meta(project)) +def editpac(args): + """editpac (createpac): Edit package meta information +If the named package does not exist, it will be created. + +usage: osc createpac + osc editpac + """ + + if not args or len(args) != 2: + sys.exit('missing argument\n\n%s\n' % editpac.func_doc) + + project = args[0] + package = args[1] + edit_meta(project, package) + + +def editprj(args): + """editprj (createprj): Edit project meta information +If the named project does not exist, it will be created. + +usage: osc createprj + osc editprj + """ + + if not args or len(args) != 1: + sys.exit('missing argument\n\n%s\n' % editprj.func_doc) + + project = args[0] + edit_meta(project, None) + + def editmeta(args): """Edit project/package meta information If the named project or package does not exist, it will be created. @@ -90,7 +121,7 @@ usage: osc editmeta FooPrj # edit meta of project 'FooPrj' if not args: print 'missing argument' print - print meta.func_doc + print editmeta.func_doc sys.exit(1) if len(args) == 2: @@ -793,6 +824,8 @@ cmd_dict = { deletepac: ['deletepac'], diff: ['diff'], editmeta: ['editmeta'], + editpac: ['editpac', 'createpac'], + editprj: ['editprj', 'createprj'], help: ['help'], buildhistory: ['buildhistory', 'buildhist'], linkpac: ['linkpac'],