Browse Source

Add scripts to clean out non-debian packages from the entries, to

make it possible to publish anonymous raw data.  Based on code from
Alain Schroeder.
tags/popcon-1.31
Petter Reinholdtsen 16 years ago
parent
commit
45efff8cef
3 changed files with 64 additions and 0 deletions
  1. +39
    -0
      clean-filter
  2. +21
    -0
      clean-genpkglist
  3. +4
    -0
      debian/changelog

+ 39
- 0
clean-filter View File

@@ -0,0 +1,39 @@
#!/usr/bin/perl
#
# Author: Alain Schroeder
# Date: 2005-07-09
# Modified by Petter Reinholdtsen 2005-07-15


use strict;

my %table;
my $foundentry = 0;
my $ignorecount = 0;
my $debug = 0;

open (PACKAGES, '< packages') or
die ("packages not found. please run get-packages.sh first\n");

while (<PACKAGES>) {
chomp;
$table{$_} = "1";
}
close PACKAGES;

while (my $line = <STDIN>) {
if ($line =~ m/^POPULARITY-CONTEST-0/i) {
$foundentry = 1;
$ignorecount = 0;
}
if ($line =~ m/^END-POPULARITY-CONTEST-0/i) {
$foundentry = 0;
print "# Ignored $ignorecount entries\n";
} if ($line =~ m/^\d* \d* (\S*).*/i && !exists $table{$1}) {
print STDERR "Ignoring package $1\n" if $debug;
$ignorecount++;
next;
}
print $line;
}

+ 21
- 0
clean-genpkglist View File

@@ -0,0 +1,21 @@
#!/bin/sh
#
# Author: Alain Schroeder
# Date: 2005-07-09
# Modified by Petter Reinholdtsen 2005-07-15

tempname=`tempfile`
temp2=`tempfile`
resultfile=packages

archs="alpha arm hppa i386 ia64 m68k mips mipsel powerpc s390 sparc"
mirror="http://ftp.fi.debian.org/debian"

for i in $archs; do
wget "$mirror/dists/Debian3.1r0/main/binary-${i}/Packages.gz" -O "$tempname"
zcat $tempname | grep "^Package: " | sed -e 's/^Package: //' >> $temp2
done

sort -u $temp2 > $resultfile

rm $tempname $temp2;

+ 4
- 0
debian/changelog View File

@@ -1,5 +1,9 @@
popularity-contest (1.31) UNRELEASED; urgency=low

* Petter Reinholdtsen
- Add scripts to clean out non-debian packages from the entries,
to make it possible to publish anonymous raw data. Based on
code from Alain Schroeder.
* Translations
- Updated Japanese from Kenshi Muto. (Closes: #317402)
- Updated Russian from Yuri Kozlov. (Closes: #317449)


Loading…
Cancel
Save