]> Pileus Git - ~andy/fetchmail/blobdiff - dist-tools/getstats.py
Remove LSM-related stuff from the distribution.
[~andy/fetchmail] / dist-tools / getstats.py
index 9a396fa8eaff129792c25709bfc04d9afa9c88a2..f48c153a671208ae0dd21c698c4fc9b21de386e2 100755 (executable)
@@ -5,23 +5,19 @@
 import commands, os, string, ftplib
 
 # Get version and date
-date = commands.getoutput("LC_TIME=C date -u")
+date = commands.getoutput("LC_TIME=C date +'%Y-%m-%d'")
 pid = os.getpid()
-# this is a fast variant using the base of the current working directory
-# (ignores uncommitted modifications)
-if os.system("svn export -q -rBASE . /tmp/getstats.%d" % pid):
-    print "SVN FAILED"
+os.mkdir("/tmp/getstats.%d" % pid)
+
+cmd = "git archive --format=tar HEAD | ( cd /tmp/getstats.%d && tar -xf -)" % pid
+
+if os.system(cmd):
+    print "git-archive FAILED"
     os.exit(1)
-# 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
-#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)
+vers = commands.getoutput("sed -n -e '/AC_INIT/s/AC_INIT(\\[.\\+\\],\\[\\(.*\\)\\],.*)/\\1/p' <configure.ac")
+print "fetchmail-" + vers + " (released " + date + ", " + string.strip(ln) + " LoC):"
 
-# getstats.py
+# end of getstats.py