]> Pileus Git - ~andy/fetchmail/blob - dist-tools/getstats.py
Clean up dist-tools, remove or update.
[~andy/fetchmail] / dist-tools / getstats.py
1 #!/usr/bin/env python
2 #
3 # Collect statistics on current release.
4
5 import commands, os, string, ftplib
6
7 # Get version and date
8 date = commands.getoutput("LC_TIME=C date -u")
9 pid = os.getpid()
10 if True:
11     # this is a fast variant using the base of the current working directory
12     # (ignores uncommitted modifications)
13     cmd = "svn export -q -rBASE . /tmp/getstats.%d" % pid
14 else:
15     #  this is a slower variant that may export the whole tree across
16     #  the net
17     cmd = "svn export -rCOMMITTED . /tmp/getstats.%d" % pid
18
19 if os.system(cmd):
20     print "SVN FAILED"
21     os.exit(1)
22
23 ln = commands.getoutput("cat /tmp/getstats.%d/*.[chly] 2>/dev/null | wc -l" % pid)
24 os.system("rm -rf /tmp/getstats.%d" % pid)
25 vers = commands.getoutput("sed -n -e '/AC_INIT/s/AC_INIT(\\[.\\+\\],\\[\\(.*\\)\\],.*)/\\1/p' <configure.ac")
26 print "fetchmail-" + vers + " (" + date + "), " + string.strip(ln) + " lines:"
27
28 # end of getstats.py