[Popcon-commits] cvs commit to popularity-contest by ballombe
popcon-commits@lists.alioth.debian.org
popcon-commits@lists.alioth.debian.org
Mon, 15 Mar 2004 08:16:56 -0700
Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv21192
Modified Files:
popcon-stat.pl popularity-contest
Log Message:
Use uuidgen in postinst to get a random HOSTID. (Closes: #237874)
Add MY_HOSTID sanity chech to popularity-contest.
Only label sundays in the graphs.
Index: popcon-stat.pl
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-stat.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- popcon-stat.pl 18 Feb 2004 11:51:39 -0000 1.3
+++ popcon-stat.pl 15 Mar 2004 15:16:53 -0000 1.4
@@ -29,7 +29,12 @@
@days = sort grep { defined($sub{$_}->{'i386'}) } @ARGV;
@date = map {m/popcon-([0-9-]+)\.gz/ and $1} @days;
-@data = (\@date);
+@dates=();
+for(my $i=0; $i<=$#date; $i++)
+{
+ $dates[$i]=($i%7)?"":$date[$i];
+}
+@data = (\@dates);
@arch = sort keys %arch;
$maxv = -10;
for $arch (@arch)
@@ -76,7 +81,7 @@
push @res,defined($sub{$_}->{$arch})?$sub{$_}->{$arch}:0;
push @tot,defined($subt{$_})?$subt{$_}:0;
}
- @data=(\@date,\@res,\@tot);
+ @data=(\@dates,\@res,\@tot);
@labels=($arch, 'all submisions');
$obj=Chart::Composite->new (600,400);
$obj->set ('title' => "Number of submissions for $arch");
Index: popularity-contest
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popularity-contest,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- popularity-contest 8 Feb 2004 10:51:55 -0000 1.5
+++ popularity-contest 15 Mar 2004 15:16:53 -0000 1.6
@@ -41,6 +41,19 @@
exit 1;
}
+if ( $HOSTID eq "d41d8cd98f00b204e9800998ecf8427e")
+{
+ print STDERR "Warning: MY_HOSTID is the md5sum of the empty file!\n";
+ print STDERR "Please change it to the md5sum of a random file in $popcon_conf!\n";
+}
+
+if ( $HOSTID !~ /^([a-f0-9]{32})$/)
+{
+ print STDERR "MY_HOSTID does not match ^([a-f0-9]{32})\$\n";
+ print STDERR "Please edit $popcon_conf to use a valid md5sum value\n";
+ exit 1;
+}
+
# Architecture.
my $debarch = `dpkg --print-installation-architecture`;
chomp $debarch;