]> git.donarmstrong.com Git - debbugs.git/blob - examples/debian/versions/test-versions.pl
the versions database is rebuilt each time
[debbugs.git] / examples / debian / versions / test-versions.pl
1 #! /usr/bin/perl -w
2 use strict;
3 use Benchmark qw(:all);
4 use Data::Dumper;
5 use lib '/home/cjwatson';
6 use Debbugs::Versions;
7 use Debbugs::Versions::Dpkg;
8
9 my $tree;
10 timethis(1, sub {
11     $tree = Debbugs::Versions->new(\&Debbugs::Versions::Dpkg::vercmp);
12 });
13 timethis(1, sub {
14     #$tree->load(*STDIN);
15     open GLIBC, '<', '/org/bugs.debian.org/versions/pkg/g/glibc';
16     $tree->load(*GLIBC);
17     close GLIBC;
18 });
19 timethis(1, sub {
20     $tree->save(*STDOUT);
21 });
22 print $tree->buggy('glibc/2.3.5-3', [qw(glibc/2.1.1-1 glibc/2.1.1-5)], [qw(glibc/2.1.1-3 glibc/2.3.2.ds1-11)]);
23 timethis(0, sub {
24     $tree->buggy('glibc/2.3.5-3', [qw(glibc/2.1.1-1 glibc/2.1.1-5)], [qw(glibc/2.1.1-3 glibc/2.3.2.ds1-11)]);
25 });
26 my %state = $tree->allstates([qw(glibc/2.1.1-1 glibc/2.1.1-5)], [qw(glibc/2.1.1-3 glibc/2.3.2.ds1-11)], [qw(glibc/2.3.2.ds1-22 glibc/2.3.2.ds1-2)]);
27 for my $ver (sort keys %state) {
28     print "\$state{$ver} = $state{$ver}\n";
29 }
30 timethis(0, sub {
31     $tree->allstates([qw(glibc/2.1.1-1 glibc/2.1.1-5)], [qw(glibc/2.1.1-3 glibc/2.3.2.ds1-11)], [qw(glibc/2.3.2.ds1-22 glibc/2.3.2.ds1-2)]);
32 });
33 #my %versions = map { $_ => 1 } qw( 2.3.1-17 2.3.1-16 2.3.1-15 2.3.1-14 2.3.1-13 2.3.1-12 2.3.1-11 2.3.1-10 2.3.1-9 2.3.1-8 2.3.1-7 2.3.1-6 2.3.1-5 2.3.1-4 2.3.1-3 2.3.1-2 2.3.1-1 2.2.5-15 2.2.5-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2.1-4 2.1-3 2.1-2 2.1-1 2.2.5-11.2 2.2.5-11.1 2.2.5-11 2.2.5-10 2.2.5-9 2.1.3-20 2.1.3-19 2.1.3-18 2.1.3-17 2.1.3-16 2.1.3-15 2.1.3-14);
34 #my @versions = sort keys %versions;
35 #
36 #for my $x (@versions) {
37 #    print $tree->buggy($x, [qw(2.2-7 2.1.1-8 2.2.1-4 2.2.5-15 2.1.3-11 2.2.5-9 2.1.3-18)], [qw(2.1.3-20 2.2-7 2.3.1-1)]) ? "$x buggy\n" : "$x not buggy\n";
38 #}