1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-03-03 14:42:11 +01:00

add PRJ PKG also as args of buildinfo and buildconfig

This commit is contained in:
Jan-Simon Möller 2009-11-06 19:52:28 +00:00
parent 9a8579cc35
commit 3226fb0f9b
2 changed files with 57 additions and 14 deletions

2
NEWS
View File

@ -17,6 +17,8 @@
- partial fix for checkout problems (bnc#551147) - partial fix for checkout problems (bnc#551147)
- fixed #477690 ("osc fetching binaries really slow") - fixed #477690 ("osc fetching binaries really slow")
- osc jobhistory accepts also "prj [pkg] repo arch" now - osc jobhistory accepts also "prj [pkg] repo arch" now
- osc buildinfo accepts now also "prj pkg repo arch [spec/dsc]"
- osc buildconfig accepts now also "prj pkg repo arch"
# #
# Features which require OBS 1.7 # Features which require OBS 1.7
# #

View File

@ -2531,24 +2531,40 @@ Please submit there instead, or use --nodevelproject to force direct submission.
of the 'osc repos' output. of the 'osc repos' output.
usage: usage:
osc buildinfo REPOSITORY ARCH [BUILD_DESCR] osc buildinfo REPOSITORY ARCH [BUILD_DESCR] (in pkg dir)
osc buildinfo PROJECT PACKAGE REPOSITORY ARCH [BUILD_DESCR]
${cmd_option_list} ${cmd_option_list}
""" """
wd = os.curdir wd = os.curdir
package = store_read_package(wd) args = slash_split(args)
project = store_read_project(wd)
apiurl = store_read_apiurl(wd)
if args is None or len(args) < 2: if args is None or len(args) < 2:
print 'Valid arguments for this package are:' print 'Valid arguments for this package are:'
print print
self.do_repos(None, None) self.do_repos(None, None)
print print
raise oscerr.WrongArgs('Missing argument') raise oscerr.WrongArgs('Missing argument.')
repository = args[0] if len(args) > 5:
arch = args[1] raise oscerr.WrongArgs('Too many arguments.')
if len(args) < 4: # 2 or 3
package = store_read_package(wd)
project = store_read_project(wd)
apiurl = store_read_apiurl(wd)
repository = args[0]
arch = args[1]
if len(args) > 3 and len(args) < 6: # 4 or 5
apiurl = conf.config['apiurl']
project = args[0]
package = args[1]
repository = args[2]
arch = args[3]
# for following specfile detection ...
del args[0]
del args[0]
# were we given a specfile (third argument)? # were we given a specfile (third argument)?
try: try:
@ -2565,7 +2581,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
addlist=opts.extra_pkgs)) addlist=opts.extra_pkgs))
def do_buildconfig(self, subcmd, opts, repository, arch): def do_buildconfig(self, subcmd, opts, *args):
"""${cmd_name}: Shows the build config """${cmd_name}: Shows the build config
Shows the build configuration which is used in building a package. Shows the build configuration which is used in building a package.
@ -2579,14 +2595,39 @@ Please submit there instead, or use --nodevelproject to force direct submission.
The arguments REPOSITORY and ARCH can be taken from the first two columns The arguments REPOSITORY and ARCH can be taken from the first two columns
of the 'osc repos' output. of the 'osc repos' output.
${cmd_usage} usage:
osc buildconfig REPOSITORY ARCH (in pkg dir)
osc buildconfig PROJECT PACKAGE REPOSITORY ARCH
${cmd_option_list} ${cmd_option_list}
""" """
wd = os.curdir wd = os.curdir
package = store_read_package(wd) args = slash_split(args)
project = store_read_project(wd)
apiurl = store_read_apiurl(wd) if args is None or len(args) < 2:
print 'Valid arguments for this package are:'
print
self.do_repos(None, None)
print
raise oscerr.WrongArgs('Missing argument.')
if len(args) > 4:
raise oscerr.WrongArgs('Too many arguments.')
if len(args) == 2:
package = store_read_package(wd)
project = store_read_project(wd)
apiurl = store_read_apiurl(wd)
repository = args[0]
arch = args[1]
elif len(args) == 4:
apiurl = conf.config['apiurl']
project = args[0]
package = args[1]
repository = args[2]
arch = args[3]
else:
raise oscerr.WrongArgs('Wrong number of arguments.')
print ''.join(get_buildconfig(apiurl, project, package, repository, arch)) print ''.join(get_buildconfig(apiurl, project, package, repository, arch))