mirror of
https://github.com/openSUSE/osc.git
synced 2025-03-03 06:32:12 +01:00
add PRJ PKG also as args of buildinfo and buildconfig
This commit is contained in:
parent
9a8579cc35
commit
3226fb0f9b
2
NEWS
2
NEWS
@ -17,6 +17,8 @@
|
||||
- partial fix for checkout problems (bnc#551147)
|
||||
- fixed #477690 ("osc fetching binaries really slow")
|
||||
- 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
|
||||
#
|
||||
|
@ -2531,24 +2531,40 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
of the 'osc repos' output.
|
||||
|
||||
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}
|
||||
"""
|
||||
|
||||
wd = os.curdir
|
||||
package = store_read_package(wd)
|
||||
project = store_read_project(wd)
|
||||
apiurl = store_read_apiurl(wd)
|
||||
args = slash_split(args)
|
||||
|
||||
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')
|
||||
raise oscerr.WrongArgs('Missing argument.')
|
||||
|
||||
repository = args[0]
|
||||
arch = args[1]
|
||||
if len(args) > 5:
|
||||
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)?
|
||||
try:
|
||||
@ -2565,7 +2581,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
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
|
||||
|
||||
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
|
||||
of the 'osc repos' output.
|
||||
|
||||
${cmd_usage}
|
||||
usage:
|
||||
osc buildconfig REPOSITORY ARCH (in pkg dir)
|
||||
osc buildconfig PROJECT PACKAGE REPOSITORY ARCH
|
||||
${cmd_option_list}
|
||||
"""
|
||||
|
||||
wd = os.curdir
|
||||
package = store_read_package(wd)
|
||||
project = store_read_project(wd)
|
||||
apiurl = store_read_apiurl(wd)
|
||||
args = slash_split(args)
|
||||
|
||||
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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user