aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/getstats.py
diff options
context:
space:
mode:
Diffstat (limited to 'dist-tools/getstats.py')
-rwxr-xr-xdist-tools/getstats.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/dist-tools/getstats.py b/dist-tools/getstats.py
index f957c7d3..33ddfd7e 100755
--- a/dist-tools/getstats.py
+++ b/dist-tools/getstats.py
@@ -2,12 +2,19 @@
#
# Collect statistics on current release.
-import commands, string, ftplib
+import commands, os, string, ftplib
# Get version and date
date = commands.getoutput("date")
-ln = commands.getoutput("co -p RCS/*.[chly],v 2>/dev/null | wc -l")
-vers = commands.getoutput("sed -n -e '/VERSION/s/VERSION *= *\\(.*\\)/\\1/p' <Makefile")
+pid = os.getpid()
+# this is a fast variant using the base of the current working directory
+# (ignores uncommitted modifications)
+os.system("svn export -rBASE . /tmp/getstats.%d" % pid)
+# this is a slower variant that may export the whole tree across the net
+#os.system("svn export -rCOMMITTED . /tmp/getstats.%d" % pid)
+ln = commands.getoutput("cat /tmp/getstats.%d/*.[chly] 2>/dev/null | wc -l" % pid)
+os.system("rm -rf /tmp/getstats.%d" % pid)
+vers = commands.getoutput("sed -n -e '/AC_INIT/s/AC_INIT(\[.*\],\[\\(.*\\)\])/\\1/p' <configure.ac")
print "fetchmail-" + vers + " (" + date + "), " + string.strip(ln) + " lines:"
# Use local listsize command to grab list statistics