PLDWWW: mmazur

mmazur mmazur at pld-linux.org
Fri May 11 20:00:14 CEST 2007


Author: mmazur   Date: Fri May 11 18:00:14 2007 GMT
Module: PLDWWW   URL: http://www.pld-linux.org/mmazur?action=diff&rev2=23&rev1=22
---- Log message:
builder stats generation

---- Page affected: mmazur

---- Diffs:

================================================================
The comment on the change is:
builder stats generation

- #language pl
+ #language en
  
- test
+ = Builder stats generation =
  
+ (So I don't loose it)
+ 
+ 
+  {{{
+ egrep '^To:|^Date:|^Build-Time:|X-PLD-Builder:' archive |uniq>~/th
+ egrep '^To:|^Date:|^Build-Time:|X-PLD-Builder:' -r . |uniq|cut -d: -f 2-10>>~/th
+ 
+ sed -e 's/^2,S://' -i th
+ 
+ 
+ echo 'builders={}'>th.py;
+ cat th|grep '^X-PLD-Builder:'|sort|uniq|sed -e 's,^X-PLD-Builder: \(.*\)$,builders["\1"]=[],' >>th.py;
+ cat th| sed -e 's,^To: \(.*\)$,)]\nsender="\1",' | sed -e 's,^X-PLD-Builder: \(.*\)$,builders["\1"]+=[ ( sender\, \\,'| sed -e 's,^Date: \(.*\) .....$,"\1"\, 0.0 \\,'| sed -e 's,^Build-Time:.*real:\([^s]*\)s.*$,+\1 \\,' >>th.py;
+ echo ')]'>>th.py;
+ 
+ 
+ 
+ 
+ import time
+ for bname in builders:
+         builds=builders[bname]
+         for build in builds:
+                 t=time.strptime(build[1], "%a, %d %b %Y %H:%M:%S")
+                 t=time.strftime("%Y-%m-%d %H:%M:%S", t)
+                 print "INSERT INTO builds VALUES ('%s', '%s', '%s', %f);" % (bname, build[0], t, build[2])
+ 
+ 
+ 
+ 
+ echo 'CREATE TABLE builds (builder varchar(16), sender varchar(64), start datetime, duration float);'>th.sql;
+ python th.py |sort|uniq >> th.sql
+ 
+ 
+ }}}
+ 


More information about the pld-cvs-commit mailing list