]> Pileus Git - ~andy/fetchmail/blobdiff - dist-tools/getstats.py
Add new gai.c debug source.
[~andy/fetchmail] / dist-tools / getstats.py
index f957c7d3d924458a9327f1a732a69e734e5a2f4a..f48c153a671208ae0dd21c698c4fc9b21de386e2 100755 (executable)
@@ -2,17 +2,22 @@
 #
 # 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")
-print "fetchmail-" + vers + " (" + date + "), " + string.strip(ln) + " lines:"
+date = commands.getoutput("LC_TIME=C date +'%Y-%m-%d'")
+pid = os.getpid()
+os.mkdir("/tmp/getstats.%d" % pid)
 
-# Use local listsize command to grab list statistics
-friends = commands.getoutput("listsize friends").strip()
-announce = commands.getoutput("listsize announce").strip()
-print "There are %s people on fetchmail-friends and %s on fetchmail-announce."% (friends, announce)
+cmd = "git archive --format=tar HEAD | ( cd /tmp/getstats.%d && tar -xf -)" % pid
 
-# getstats.py
+if os.system(cmd):
+    print "git-archive FAILED"
+    os.exit(1)
+
+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 + " (released " + date + ", " + string.strip(ln) + " LoC):"
+
+# end of getstats.py