Browse Source

examples/bin: sync with currently used version

tags/popcon-1.66
Bill Allombert 3 years ago
parent
commit
d4e7b0f3b9
5 changed files with 15 additions and 4 deletions
  1. +4
    -1
      debian/changelog
  2. +7
    -1
      examples/bin/popcon-process.sh
  3. +1
    -1
      examples/bin/popcon-stat.pl
  4. +1
    -0
      examples/bin/popcon.pl
  5. +2
    -1
      examples/bin/prepop.pl

+ 4
- 1
debian/changelog View File

@@ -12,12 +12,15 @@ popularity-contest (1.66) unstable; urgency=medium
* debian-popcon.gpg: use new submission key
* examples/bin/popanal.py:
- reject lines with malformed timestamp. Closes: #833695.
* examples/bin/popcon-process.sh:
- add support for gpg2
* Update example server-side scripts to popcon.d.o version.
[Paul Wise]
* Change the Linux Counter URL to the new domain.
* Use https instead of http in URLs where possible.
Closes: #865718

-- Bill Allombert <ballombe@debian.org> Tue, 13 Feb 2018 18:38:11 +0100
-- Bill Allombert <ballombe@debian.org> Wed, 14 Feb 2018 20:00:33 +0100

popularity-contest (1.65) unstable; urgency=low



+ 7
- 1
examples/bin/popcon-process.sh View File

@@ -5,6 +5,7 @@ MAILDIR=../Mail
WEBDIR=../www
LOGDIR=$BASEDIR/../logs
BINDIR=$BASEDIR/../bin
INCOMINGDIR=$BASEDIR/../incoming
DATADIR=$BASEDIR/popcon-entries
SUMMARYDIR=$BASEDIR/all-popcon-results
SUMMARYDIRSTABLE=$BASEDIR/all-popcon-results.stable
@@ -26,6 +27,11 @@ if [ true = "$READMAIL" ] ; then
chmod go-rwx $MAILDIR/survey

# process entries, splitting them into individual reports
rm -fr $INCOMINGDIR/old
mkdir -m 700 $INCOMINGDIR/old
(cd $INCOMINGDIR/new; find . -type f -exec mv -t ../old "{}" +)
(cd $INCOMINGDIR/old; find . -type f -name '*.gz' -execdir gunzip "{}" \; ) 2> $LOGDIR/incoming.log
find $INCOMINGDIR/old -type f -readable ! -empty | xargs cat >> new-popcon-entries
rm -fr popcon-gpg
mkdir -m 770 popcon-gpg
$BINDIR/prepop.pl <new-popcon-entries >$LOGDIR/prepop.out 2>&1
@@ -34,7 +40,7 @@ if [ true = "$READMAIL" ] ; then
find popcon-gpg -type f -name '*.gpg' -execdir gpg --multifile --decrypt {} \; >>$LOGDIR/gpg.log 2>&1
date >>$LOGDIR/gpg.log
#process decrypted reports
find popcon-gpg -type f -name '*.txt'| xargs cat | $BINDIR/prepop.pl
find popcon-gpg -type f -name '*.txt'| xargs cat | $BINDIR/prepop.pl >> $LOGDIR/prepop.out 2>&1
fi

# delete outdated entries


+ 1
- 1
examples/bin/popcon-stat.pl View File

@@ -31,7 +31,7 @@ while (<>)
{
if (defined($line[2]))
{
if ($line[1] =~ m/^([0-9]+(?:\.[0-9]+)*)$/)
if ($line[1] =~ m/^([0-9]+(?:\.[0-9]+)?)$/)
{
$rel{$f}->{"$1"}+=$line[2];
} else {


+ 1
- 0
examples/bin/popcon.pl View File

@@ -301,6 +301,7 @@ sub print_pkg
my ($pkg)=@_;
return unless (defined($pkg));
my $size=length $pkg;
$size = 20 if ($size > 20);
my $pkgt=substr($pkg,0,20);
print HTML "<a href=\"https://packages.debian.org/$pkg\">$pkgt</a> ",
' 'x(20-$size);


+ 2
- 1
examples/bin/prepop.pl View File

@@ -25,7 +25,7 @@ sub get_report
$id=$field{'ID'};
if (!defined($id) || $id !~ /^([a-f0-9]{32})$/)
{
print STDERR "Bad hostid: $id\n";
print STDERR "Bad hostid: $line\n";
return 'reject';
}
$id=$1; #untaint $id
@@ -55,6 +55,7 @@ sub get_report
}
$file="$dirname/$dir/$id";
open REPORT, ">",$file or return 'reject';
print STDERR "Accepted $id\n";
print REPORT $_;
while(<>)
{


Loading…
Cancel
Save