Browse Source

Update example server-side scripts to popcon.d.o version:

- popcon.pl: Fix typos in index.html header text.
           + Output timings to stdout.
- popanal.py: Catch broken date field in reports.
- popcon-process.sh: redirect popcon.pl output to popcon.log
suites/ascii popcon-1.28
Bill Allombert 18 years ago
parent
commit
1655a50916
  1. 13
      debian/changelog
  2. 13
      popanal.py
  3. 2
      popcon-process.sh
  4. 25
      popcon.pl

13
debian/changelog

@ -1,13 +1,18 @@
popularity-contest (1.28) UNRELEASED; urgency=low
* Translations
popularity-contest (1.28) unstable; urgency=low
* Update example server-side scripts to popcon.d.o version:
- popcon.pl: Fix typos in index.html header text.
+ Output timings to stdout.
- popanal.py: Catch broken date field in reports.
- popcon-process.sh: redirect popcon.pl output to popcon.log
* Translations (Done by Christian Perrier)
- Added Galician by Jacobo Tarrio. Closes: #296307
- Added Albanian by Elian Myftiu. Closes: #302398
- Added Tagalog by Eric Pareja. Closes: #296409
- Updated Basque from Inaki Larranaga Murgoitio. Closes: #306049
- Added Vietnamese by Phan Vinh Thinh. Closes: #307015
-- Christian Perrier <bubulle@debian.org> Sat, 30 Apr 2005 08:28:31 +0200
-- Bill Allombert <ballombe@debian.org> Tue, 3 May 2005 17:27:33 +0200
popularity-contest (1.27) unstable; urgency=low

13
popanal.py

@ -137,7 +137,7 @@ class Submission:
# we found the last line of the survey: finish it
def done(self, date):
ewrite('\t STOP: after %d seconds, %d packages'
% (long(date) - self.start_date, len(self.entries)))
% (date - self.start_date, len(self.entries)))
for package in self.entries.keys():
e = self.entries[package]
if deplist.has_key(package):
@ -202,7 +202,9 @@ def read_submissions(stream):
if header.has_key('POPCONVER'):
if header['POPCONVER']=='':
e.release = 'unknown'
else:
elif header['POPCONVER']=='1.27.bill.1':
e.release = '1.27'
else:
e.release = header['POPCONVER']
if header.has_key('ARCH'):
@ -218,7 +220,12 @@ def read_submissions(stream):
elif split[0]=='END-POPULARITY-CONTEST-0' and e != None:
header = headersplit(split[1:])
if header.has_key('TIME'):
e.done(header['TIME'])
try:
date = long(header['TIME'])
except:
ewrite('Invalid date: ' + header['TIME'])
continue
e.done(date)
e = None
elif e != None:

2
popcon-process.sh

@ -23,4 +23,4 @@ cd ../popcon-stat
find ../popcon-mail/all-popcon-results -type f -print | sort |./popcon-stat.pl
cd ../popcon-web
./popcon.pl
./popcon.pl >popcon.log

25
popcon.pl

@ -51,7 +51,12 @@ sub popconintro
{
print HTML <<"EOH";
<p> <em> The popularity contest project is an attempt to map the usage of
Debian packages. This site publishes the statistics gathered from report send by users of the <a href="http://packages.debian.org/popularity-contest">popularity-contest</a> package. This package sends every week the list of packages installed and the access time of relevant files to the server via email. Every day the server anonymizes the result and publishes this survey.
Debian packages. This site publishes the statistics gathered from report
sent by users of the <a
href="http://packages.debian.org/popularity-contest">popularity-contest</a>
package. This package sends every week the list of packages installed and the
access time of relevant files to the server via email. Every day the server
anonymizes the result and publishes this survey.
For more information, read the <a href="README">README</a> and the
<a href="FAQ">FAQ</a>.
</em> <p>
@ -171,7 +176,10 @@ sub print_pkg
print HTML "<a href=\"http://packages.debian.org/$pkg\">$pkgt</a> ",
' 'x(20-$size);
}
sub mark
{
print join(" ",$_[0],times),"\n";
}
%pkg=();
%section=();
@ -197,7 +205,7 @@ for $file ("slink","slink-nonUS","potato","potato-nonUS","woody","woody-nonUS")
}
close AVAIL;
}
mark "Reading legacy packages...";
for $file (glob("/org/ftp.root/debian/dists/testing/*/binary-*/Packages"),glob("/org/ftp.root/debian/dists/sid/*/binary-*/Packages"))
{
@ -214,6 +222,8 @@ for $file (glob("/org/ftp.root/debian/dists/testing/*/binary-*/Packages"),glob("
}
close AVAIL;
}
mark "Reading current packages...";
$ENV{PATH}="/bin:/usr/bin";
#Format
@ -261,6 +271,7 @@ while(<PKG>)
$release{$a}=$nb;
}
}
mark "Reading stats...";
@pkgs=sort keys %pkg;
%sections = map {$section{$_} => 1} keys %section;
@ -275,6 +286,8 @@ for $sec (@sections)
make_by ($sec, $_, \%pkg, @list) for (@fields);
}
mark "Building by sections pages";
@dists=("main","contrib","non-free","non-US");
#There is a hack: '.' is both the current directory and
#the catchall regexp.
@ -311,6 +324,7 @@ for $sec (@dists)
closedir SEC;
close HTML;
}
mark "Building by sub-sections pages";
for $sec (@dists)
{
open HTML , "> $popcon/$sec/first.html";
@ -346,6 +360,9 @@ for $sec (@dists)
closedir SEC;
close HTML;
}
mark "Building winner pages";
{
open HTML , "> $popcon/index.html";
&htmlheader;
@ -420,4 +437,4 @@ EOF
&htmlfooter;
close HTML;
}
mark "Building index.html";

Loading…
Cancel
Save