]> Pileus Git - ~andy/fetchmail/commitdiff
Change: use SVN rather than RCS to check out code
authorMatthias Andree <matthias.andree@gmx.de>
Wed, 27 Apr 2005 09:50:26 +0000 (09:50 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Wed, 27 Apr 2005 09:50:26 +0000 (09:50 -0000)
Change: extract version from configure.ac rather than Makefile

svn path=/trunk/; revision=4042

dist-tools/getstats.py

index f957c7d3d924458a9327f1a732a69e734e5a2f4a..33ddfd7ea9c08fec38b3b500ce5599199f291b82 100755 (executable)
@@ -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