Mailinglist Archive: opensuse-buildservice (239 mails)

< Previous Next >
[opensuse-buildservice] [PATCH] osc submitreq create DESTPRJ [DESTPKG]
  • From: Michal Vyskocil <mvyskocil@xxxxxxx>
  • Date: Mon, 4 May 2009 10:08:32 +0200
  • Message-id: <200905041008.32862.mvyskocil@xxxxxxx>
Hi all,

following patch makes importing of new packages to OBS easier. If you want
add a new package to Factory, you don't have a sourcelink yet and no metadata
exists, so you must type

osc sr create SOURCEPRJ SOURCEPKG openSUSE:Factory [DESTPKG] -m "message"

even if SOURCEPRJ and SOURCEPKG should be read from working dir instead. With
this you can type only

osc sr create openSUSE:Factory [DESTPKG] -m "message"

Any objections against it?

Regards
Michal Vyskocil
Index: osc/commandline.py
===================================================================
--- osc/commandline.py (revision 7236)
+++ osc/commandline.py (working copy)
@@ -498,6 +498,7 @@

usage:
osc submitreq create [-m TEXT]
+ osc submitreq create [-m TEXT] DESTPRJ [DESTPKG]
osc submitreq create [-m TEXT] SOURCEPRJ SOURCEPKG DESTPRJ
[DESTPKG]
osc submitreq list [PRJ [PKG]]
osc submitreq log ID
@@ -534,18 +535,25 @@

# collect specific arguments
if cmd == 'create':
- if len(args) == 0:
+ if len(args) <= 2:
# try using the working copy at hand
p = findpacs(os.curdir)[0]
src_project = p.prjname
src_package = p.name
- if p.islink():
+ if len(args) == 0 and p.islink():
dst_project = p.linkinfo.project
dst_package = p.linkinfo.package
apiurl = p.apiurl
+ elif len(args) > 0:
+ dst_project = args[0]
+ if len(args) == 2:
+ dst_package = args[1]
+ else:
+ dst_package = src_package
else:
sys.exit('Package \'%s\' is not a source link, so I cannot
guess the submit target.\n'
- 'Please provide it the target via commandline
arguments.' % p.name)
+ 'Please provide it the target via commandline
arguments.' % p.name)
+
modified = [i for i in p.filenamelist if p.status(i) != ' '
and p.status(i) != '?']
if len(modified) > 0:
print 'Your working copy has local modifications.'
< Previous Next >
Follow Ups