[Popcon-developers] Fixing DEBVER report

Bill Allombert allomber@math.u-bordeaux.fr
Mon, 10 May 2004 17:31:20 +0200


--yH1ZJFh+qWm+VodA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, May 07, 2004 at 09:48:30PM +0200, Bill Allombert wrote:
> > So I propose to change the value of DEBVER to be the version of 
> > popcon installed on the machine. That should give us more information
> > with a not really higher error margin.
> 
> Hello Petter,
> did you get the above email ?
> I plan to implement the above change soon.

So accordingly I am going to commit the attached patch.

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 

--yH1ZJFh+qWm+VodA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

Index: FAQ
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/FAQ,v
retrieving revision 1.2
diff -u -r1.2 FAQ
--- FAQ	14 Apr 2004 22:01:13 -0000	1.2
+++ FAQ	10 May 2004 15:12:19 -0000
@@ -2,10 +2,10 @@
 
 Q) What informations are reported by popularity-contest ?
 
-A) popularity-contest report the Debian architecture you use,
-   the Debian release and the list of packages installed on the
-   system with the most recent atime of important files in them
-   (mainly executable files).
+A) popularity-contest report the Debian architecture you use, the version of
+   popularity-contest you use and the list of packages installed on the system
+   with the most recent atime of important files in them (mainly executable
+   files).
 
 Q) What are the privacy consideration for popularity-contest ?
 
Index: popanal.py
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popanal.py,v
retrieving revision 1.8
diff -u -r1.8 popanal.py
--- popanal.py	18 Feb 2004 11:51:39 -0000	1.8
+++ popanal.py	10 May 2004 15:12:21 -0000
@@ -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':
Index: popularity-contest
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popularity-contest,v
retrieving revision 1.7
diff -u -r1.7 popularity-contest
--- popularity-contest	21 Mar 2004 09:18:45 -0000	1.7
+++ popularity-contest	10 May 2004 15:12:21 -0000
@@ -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)
 {

--yH1ZJFh+qWm+VodA--