[Popcon-commits] cvs commit to popularity-contest by ballombe

popcon-commits@lists.alioth.debian.org popcon-commits@lists.alioth.debian.org
Fri, 14 May 2004 04:07:37 -0600


Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv13554

Modified Files:
	popularity-contest popanal.py 
Log Message:
Change popularity-contest to report the popularity-contest version
instead of the Debian release which is not reliable.


Index: popularity-contest
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popularity-contest,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- popularity-contest	21 Mar 2004 09:18:45 -0000	1.7
+++ popularity-contest	14 May 2004 10:07:35 -0000	1.8
@@ -58,14 +58,8 @@
 my $debarch = `dpkg --print-installation-architecture`;
 chomp $debarch;
 
-# Fetch debian version number.  Example values are "3.0" and
-# "testing/unstable"
-my $debver;
-if ( -e "/etc/debian_version" && open(RELEASEFILE, "</etc/debian_version")) {
-    $debver = <RELEASEFILE>;
-    chomp $debver;
-    close(RELEASEFILE);
-}
+# Popcon release
+my $popconver=`dpkg-query --showformat='\${version}' --show popularity-contest`;
 
 # Initialise time computations
 
@@ -123,7 +117,7 @@
 # add a header/footer.
 	
 print "POPULARITY-CONTEST-0 TIME:",time," ID:$HOSTID ".
-    "ARCH:$debarch DEBVER:$debver\n";
+    "ARCH:$debarch POPCONVER:$popconver\n";
 
 for (sort { $popcon{$b}[0] <=> $popcon{$a}[0] } keys %popcon)
 {

Index: popanal.py
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popanal.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- popanal.py	18 Feb 2004 11:51:39 -0000	1.8
+++ popanal.py	14 May 2004 10:07:35 -0000	1.9
@@ -199,8 +199,8 @@
 	    ewrite('#%s' % subcount)
 	    e = Submission(0, header['ID'], header['TIME'])
 
-            if header.has_key('DEBVER'):
-	        e.release = header['DEBVER']
+            if header.has_key('POPCONVER'):
+	        e.release = header['POPCONVER']
 	
             if header.has_key('ARCH'):
 	    	if header['ARCH']=='x86_64':