mirror of
https://github.com/openSUSE/osc.git
synced 2025-06-01 17:10:04 +02:00
add a buildlogurl support to osc remotebuildlog command
This commit is contained in:
parent
293d03536f
commit
1d44150c7f
1
NEWS
1
NEWS
@ -3,6 +3,7 @@
|
|||||||
- fix "osc patchinfo" command (crashed before)
|
- fix "osc patchinfo" command (crashed before)
|
||||||
- fixed SSL proxy support
|
- fixed SSL proxy support
|
||||||
- fixed meta attribute create and set calls
|
- fixed meta attribute create and set calls
|
||||||
|
- osc remotebuildlog supports a buildlogurl
|
||||||
|
|
||||||
0.125
|
0.125
|
||||||
- add "osc pull" command to fetch and merge changes in the link target
|
- add "osc pull" command to fetch and merge changes in the link target
|
||||||
|
@ -2789,6 +2789,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
@cmdln.alias('rbl')
|
@cmdln.alias('rbl')
|
||||||
@cmdln.alias('rbuildlog')
|
@cmdln.alias('rbuildlog')
|
||||||
|
@cmdln.option('-s', '--start', metavar='START',
|
||||||
|
help='get log starting from the offset')
|
||||||
def do_remotebuildlog(self, subcmd, opts, *args):
|
def do_remotebuildlog(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Shows the build log of a package
|
"""${cmd_name}: Shows the build log of a package
|
||||||
|
|
||||||
@ -2801,13 +2803,23 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
osc remotebuildlog project/package/repository/arch
|
osc remotebuildlog project/package/repository/arch
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
args = slash_split(args)
|
if len(args) == 1:
|
||||||
if len(args) < 4:
|
apiurl, project, package, repository, arch = parse_buildlogurl(args[0])
|
||||||
raise oscerr.WrongArgs('Too few arguments.')
|
else:
|
||||||
elif len(args) > 4:
|
args = slash_split(args)
|
||||||
raise oscerr.WrongArgs('Too many arguments.')
|
apiurl = conf.config['apiurl']
|
||||||
|
if len(args) < 4:
|
||||||
|
raise oscerr.WrongArgs('Too few arguments.')
|
||||||
|
elif len(args) > 4:
|
||||||
|
raise oscerr.WrongArgs('Too many arguments.')
|
||||||
|
else:
|
||||||
|
project, package, repository, arch = args
|
||||||
|
|
||||||
|
offset=0
|
||||||
|
if opts.start:
|
||||||
|
offset = int(opts.start)
|
||||||
|
|
||||||
print_buildlog(conf.config['apiurl'], *args)
|
print_buildlog(apiurl, project, package, repository, arch, offset)
|
||||||
|
|
||||||
|
|
||||||
@cmdln.alias('tr')
|
@cmdln.alias('tr')
|
||||||
|
12
osc/core.py
12
osc/core.py
@ -33,6 +33,7 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
DISTURL_RE = re.compile(r"^(?P<bs>.*)://(?P<apiurl>.*?)/(?P<project>.*?)/(?P<repository>.*?)/(?P<revision>.*)-(?P<source>.*)$")
|
DISTURL_RE = re.compile(r"^(?P<bs>.*)://(?P<apiurl>.*?)/(?P<project>.*?)/(?P<repository>.*?)/(?P<revision>.*)-(?P<source>.*)$")
|
||||||
|
BUILDLOGURL_RE = re.compile(r"^(?P<apiurl>https://.*?)/build/(?P<project>.*?)/(?P<repository>.*?)/(?P<arch>.*?)/(?P<package>.*?)/_log$")
|
||||||
BUFSIZE = 1024*1024
|
BUFSIZE = 1024*1024
|
||||||
store = '.osc'
|
store = '.osc'
|
||||||
|
|
||||||
@ -1705,6 +1706,17 @@ def parse_disturl(disturl):
|
|||||||
apiurl = 'https://api.' + ".".join(apiurl.split('.')[1:])
|
apiurl = 'https://api.' + ".".join(apiurl.split('.')[1:])
|
||||||
return (apiurl, m.group('project'), m.group('source'), m.group('repository'), m.group('revision'))
|
return (apiurl, m.group('project'), m.group('source'), m.group('repository'), m.group('revision'))
|
||||||
|
|
||||||
|
def parse_buildlogurl(buildlogurl):
|
||||||
|
"""Parse a build log url, returns a tuple (apiurl, project, package,
|
||||||
|
repository, arch), else raises oscerr.WrongArgs exception"""
|
||||||
|
|
||||||
|
global BUILDLOGURL_RE
|
||||||
|
|
||||||
|
m = BUILDLOGURL_RE.match(buildlogurl)
|
||||||
|
if not m:
|
||||||
|
raise oscerr.WrongArgs("`%s' does not look like url with a build log" % buildlogurl)
|
||||||
|
|
||||||
|
return (m.group('apiurl'), m.group('project'), m.group('package'), m.group('repository'), m.group('arch'))
|
||||||
|
|
||||||
def slash_split(l):
|
def slash_split(l):
|
||||||
"""Split command line arguments like 'foo/bar' into 'foo' 'bar'.
|
"""Split command line arguments like 'foo/bar' into 'foo' 'bar'.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user