mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 18:26:15 +01:00
fixed 'osc buildconfig'
Fixed 'osc buildconfig'. Don't ask for package and arch since the API don't allow to filter for a package or a architecture. Remove related and useless parameter from get_buildconfig() in core.py
This commit is contained in:
parent
b3c5204b59
commit
35536475e7
@ -555,7 +555,7 @@ def main(apiurl, opts, argv):
|
|||||||
print 'Getting buildconfig from server and store to %s' % bc_filename
|
print 'Getting buildconfig from server and store to %s' % bc_filename
|
||||||
if not bc_file:
|
if not bc_file:
|
||||||
bc_file = open(bc_filename, 'w')
|
bc_file = open(bc_filename, 'w')
|
||||||
bc_file.write(get_buildconfig(apiurl, prj, pac, repo, arch))
|
bc_file.write(get_buildconfig(apiurl, prj, repo))
|
||||||
bc_file.flush()
|
bc_file.flush()
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 404:
|
if e.code == 404:
|
||||||
|
@ -3696,46 +3696,41 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
Shows the build configuration which is used in building a package.
|
Shows the build configuration which is used in building a package.
|
||||||
This command is mostly used internally by the 'build' command.
|
This command is mostly used internally by the 'build' command.
|
||||||
It needs to be called from inside a package directory.
|
|
||||||
|
|
||||||
The returned data is the project-wide build configuration in a format
|
The returned data is the project-wide build configuration in a format
|
||||||
which is directly readable by the build script. It contains RPM macros
|
which is directly readable by the build script. It contains RPM macros
|
||||||
and BuildRequires expansions, for example.
|
and BuildRequires expansions, for example.
|
||||||
|
|
||||||
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
The argument REPOSITORY an be taken from the first column of the
|
||||||
of the 'osc repos' output.
|
'osc repos' output.
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc buildconfig REPOSITORY ARCH (in pkg dir)
|
osc buildconfig REPOSITORY (in pkg or prj dir)
|
||||||
osc buildconfig PROJECT PACKAGE REPOSITORY ARCH
|
osc buildconfig PROJECT REPOSITORY
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
|
|
||||||
if len(args) < 2 and is_package_dir('.'):
|
if len(args) < 1 and (is_package_dir('.') or is_project_dir('.')):
|
||||||
self.print_repos()
|
self.print_repos()
|
||||||
|
|
||||||
if len(args) > 4:
|
if len(args) > 2:
|
||||||
raise oscerr.WrongArgs('Too many arguments.')
|
raise oscerr.WrongArgs('Too many arguments.')
|
||||||
|
|
||||||
apiurl = self.get_api_url()
|
apiurl = self.get_api_url()
|
||||||
|
|
||||||
if len(args) == 2:
|
if len(args) == 1:
|
||||||
package = store_read_package(wd)
|
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
repository = args[0]
|
repository = args[0]
|
||||||
arch = args[1]
|
elif len(args) == 2:
|
||||||
elif len(args) == 4:
|
|
||||||
project = args[0]
|
project = args[0]
|
||||||
package = args[1]
|
repository = args[1]
|
||||||
repository = args[2]
|
|
||||||
arch = args[3]
|
|
||||||
else:
|
else:
|
||||||
raise oscerr.WrongArgs('Wrong number of arguments.')
|
raise oscerr.WrongArgs('Wrong number of arguments.')
|
||||||
|
|
||||||
print ''.join(get_buildconfig(apiurl, project, package, repository, arch))
|
print ''.join(get_buildconfig(apiurl, project, repository))
|
||||||
|
|
||||||
|
|
||||||
def do_repos(self, subcmd, opts, *args):
|
def do_repos(self, subcmd, opts, *args):
|
||||||
|
@ -4012,7 +4012,7 @@ def get_buildinfo(apiurl, prj, package, repository, arch, specfile=None, addlist
|
|||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def get_buildconfig(apiurl, prj, package, repository, arch):
|
def get_buildconfig(apiurl, prj, repository):
|
||||||
u = makeurl(apiurl, ['build', prj, repository, '_buildconfig'])
|
u = makeurl(apiurl, ['build', prj, repository, '_buildconfig'])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
return f.read()
|
return f.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user