1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +01:00

"osc buildhistory": show build duration

This commit is contained in:
Adrian Schröter 2017-05-22 12:42:51 +02:00
parent e809cc8ef1
commit 67d1b50461
2 changed files with 8 additions and 4 deletions

3
NEWS
View File

@ -1,5 +1,6 @@
0.159 0.159
- - "osc buildhistory": show build duration
- native docker build support
0.158 0.158
- cat/less/blame command: default to expand to stay in sync with checkout - cat/less/blame command: default to expand to stay in sync with checkout

View File

@ -6009,17 +6009,20 @@ def get_buildhistory(apiurl, prj, package, repository, arch, format = 'text', li
srcmd5 = node.get('srcmd5') srcmd5 = node.get('srcmd5')
versrel = node.get('versrel') versrel = node.get('versrel')
bcnt = int(node.get('bcnt')) bcnt = int(node.get('bcnt'))
duration = node.get('duration')
t = time.gmtime(int(node.get('time'))) t = time.gmtime(int(node.get('time')))
t = time.strftime('%Y-%m-%d %H:%M:%S', t) t = time.strftime('%Y-%m-%d %H:%M:%S', t)
if duration == None:
duration = ""
if format == 'csv': if format == 'csv':
r.append('%s|%s|%s|%s.%d' % (t, srcmd5, rev, versrel, bcnt)) r.append('%s|%s|%s|%s.%d|%s' % (t, srcmd5, rev, versrel, bcnt, duration))
else: else:
bversrel='%s.%d' % (versrel, bcnt) bversrel='%s.%d' % (versrel, bcnt)
r.append('%s %s %s %s' % (t, srcmd5, bversrel.ljust(16)[:16], rev)) r.append('%s %s %s %s %s' % (t, srcmd5, bversrel.ljust(16)[:16], rev, duration.rjust(10)))
if format == 'text': if format == 'text':
r.insert(0, 'time srcmd5 vers-rel.bcnt rev') r.insert(0, 'time srcmd5 vers-rel.bcnt rev duration')
return r return r