2 # $HeadURL: /local/cpanpm/trunk/bin/query-rt-group-by-requestor.pl $
7 Read YAML databases and list all missing tickets in the style needed
8 as datainput for the rt-deleter.pl
16 use Set
::Integer
::Gapfillers
;
17 use Set
::IntSpan
::Fast
;
19 $YAML::Syck
::ImplicitUnicode
= 1;
21 my $yaml_db_file = __FILE__
;
22 $yaml_db_file =~ s
|[^/]+\
.pl
$|query
-rt
-group
-by
-requestor
.yml
|;
24 if (-e
$yaml_db_file) {
25 print "Reading '$yaml_db_file'\n";
26 $Q = YAML
::Syck
::LoadFile
($yaml_db_file);
28 die "Didn't find '$yaml_db_file'";
32 $yaml_db_file =~ s
|[^/]+\
.yml
$|rt
-deleter
.yml
|;
33 if (-e
$yaml_db_file) {
34 print "Reading '$yaml_db_file'\n";
35 $D = YAML
::Syck
::LoadFile
($yaml_db_file);
37 die "Didn't find '$yaml_db_file'";
40 print "Constructing the set\n";
41 my $set = Set
::IntSpan
::Fast
->new();
42 for my $k (keys %{$Q->{tickets
}}) {
43 $set->add($k) if keys %{$Q->{tickets
}{$k}};
45 for my $k (keys %$D) {
49 my $fset = $set->as_string;
52 print "Constructing the gapfiller\n";
53 my @have = map { if (/-/) {
59 my $sigf = Set
::Integer
::Gapfillers
->new(
61 upper
=> $have[-1][1],
64 my $gf = $sigf->gapfillers;
65 for my $i (0..$#$gf) {
67 if ($gap->[0]==$gap->[1]) {
70 print " $gap->[0]..$gap->[1]";