Builds taking longer than a day to run
Joe Marcus Clarke
marcus at marcuscom.com
Wed Jul 30 20:30:10 EDT 2008
On Wed, 2008-07-30 at 15:11 -0700, Ade Lovett wrote:
> This is a long-outstanding bug in tinderbuild:
>
> echo "phase ${num} took $(env LANG=C date -u -j -r $((${end} - $
> {start})) |
> awk '{print $4}')"
>
> if a build takes longer than a day, let's say, for the sake of
> argument, 32 hours, 2 minutes, 3 seconds, this will print:
>
> phase <x> took 08:02:03
>
> a possible solution would be to add a new internal command as follows:
>
> tc epochTime [-s <start> -e <end>]
>
> if both -s/-e are presented, then it'll kick back a string of the form:
>
> [<x> 'day'['s']] hh:mm:ss
>
> if none are presented, it returns the time since the epoch (simple
> call to gmtime())
>
> all other uses kick out an error.
>
> Thoughts?
What about doing this with expr:
timediff=$((${end} - ${start}))
days=0
if [ ${timediff} -ge 86400 ]; then
days=$((${timediff} / 86400))
fi
echo "phase ${num} took ${days} days $(env LANG=C date -u -j -r
${timediff}) | awk '{print $4}'
Joe
--
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://marcuscom.com/pipermail/tinderbox-list/attachments/20080730/d2a2e348/attachment.bin>
More information about the tinderbox-list
mailing list