Browse Source

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.
suites/ascii
Bill Allombert 18 years ago
parent
commit
0ffb597208
  1. 2
      debian/changelog
  2. 6
      debian/postinst
  3. 9
      popcon-stat.pl
  4. 13
      popularity-contest

2
debian/changelog

@ -2,6 +2,8 @@ popularity-contest (1.15) UNRELEASED; urgency=low
* Bill Allombert
- Invalidate the submissions after 20 days instead of 10.
- Use uuidgen in postinst to get a random HOSTID. (Closes: #237874)
- Add MY_HOSTID sanity chech to popularity-contest.
* Petter Reinholdtsen
- Updated Norwegian Bokmål and Nynorsk debconf translation,
patch from Håvard Korsvoll. (Closes: #238037)

6
debian/postinst

@ -24,7 +24,11 @@ else
fi
generate_conffile() {
MY_HOSTID=`dd if=/dev/urandom bs=1k count=1 2>/dev/null | md5sum | sed 's/ -//'''`
if [ -x /usr/bin/uuidgen ] ; then
MY_HOSTID=`uuidgen | tr -d -`
else
MY_HOSTID=`dd if=/dev/urandom bs=1k count=1 2>/dev/null | md5sum | sed 's/ -//'''`
fi
cat <<-EOF >$conffile
# Config file for Debian's popularity-contest package.

9
popcon-stat.pl

@ -29,7 +29,12 @@ for $f (sort @ARGV)
@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 @@ for $arch (@arch)
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");

13
popularity-contest

@ -41,6 +41,19 @@ if ( $HOSTID eq "")
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;

Loading…
Cancel
Save