|  line  | 
 stmt  | 
 bran  | 
 cond  | 
 sub  | 
 pod  | 
 time  | 
 code  | 
| 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 package XT::Files::Plugin::Dirs;  | 
| 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
3
 | 
6
 | 
 
 | 
 
 | 
  
6
  
 | 
 
 | 
2970
 | 
 use 5.006;  | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
59
 | 
    | 
| 
4
 | 
6
 | 
 
 | 
 
 | 
  
6
  
 | 
 
 | 
35
 | 
 use strict;  | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
    | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
136
 | 
    | 
| 
5
 | 
6
 | 
 
 | 
 
 | 
  
6
  
 | 
 
 | 
29
 | 
 use warnings;  | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
10
 | 
    | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
287
 | 
    | 
| 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 our $VERSION = '0.002';  | 
| 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
9
 | 
6
 | 
 
 | 
 
 | 
  
6
  
 | 
 
 | 
489
 | 
 use parent 'XT::Files::Plugin';  | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
317
 | 
    | 
| 
 
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
80
 | 
    | 
| 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
11
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 sub run {  | 
| 
12
 | 
8
 | 
 
 | 
 
 | 
  
8
  
 | 
  
1
  
 | 
842
 | 
     my ( $self, $args ) = @_;  | 
| 
13
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
14
 | 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
18
 | 
     my @dirs;  | 
| 
15
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
16
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   ARG:  | 
| 
17
 | 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
13
 | 
     for my $arg ( @{$args} ) {  | 
| 
 
 | 
8
 | 
 
 | 
 
 | 
 
 | 
 
 | 
20
 | 
    | 
| 
18
 | 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
25
 | 
         my ( $key, $value ) = @{$arg};  | 
| 
 
 | 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
37
 | 
    | 
| 
19
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
20
 | 
19
 | 
  
100
  
 | 
  
100
  
 | 
 
 | 
 
 | 
106
 | 
         if ( ( $key eq 'bin' ) || ( $key eq 'module' ) || ( $key eq 'test' ) ) {  | 
| 
 
 | 
 
 | 
 
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
21
 | 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
32
 | 
             push @dirs, $arg;  | 
| 
22
 | 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
35
 | 
             next ARG;  | 
| 
23
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
24
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
25
 | 
1
 | 
 
 | 
 
 | 
 
 | 
 
 | 
14
 | 
         $self->log_fatal("Invalid configuration option '$key = $value' for plugin 'Dirs'");  | 
| 
26
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
27
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
28
 | 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
144
 | 
     my $xtf = $self->xtf;  | 
| 
29
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
30
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # We sort the dirs because e.g. bin/lib must be scanned before bin  | 
| 
31
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # because bin_dir() would add every file found.  | 
| 
32
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     #  | 
| 
33
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # By reverse sorting we guarantee that we always scan the most  | 
| 
34
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     # significant directory first.  | 
| 
35
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
   DIR:  | 
| 
36
 | 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
51
 | 
     for my $dir ( reverse sort { $a->[1] cmp $b->[1] } @dirs ) {  | 
| 
 
 | 
20
 | 
 
 | 
 
 | 
 
 | 
 
 | 
49
 | 
    | 
| 
37
 | 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
28
 | 
         my ( $type, $name ) = @{$dir};  | 
| 
 
 | 
18
 | 
 
 | 
 
 | 
 
 | 
 
 | 
38
 | 
    | 
| 
38
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
39
 | 
18
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
51
 | 
         if ( $type eq 'bin' ) {  | 
| 
40
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
32
 | 
             $xtf->bin_dir($name);  | 
| 
41
 | 
10
 | 
 
 | 
 
 | 
 
 | 
 
 | 
22
 | 
             next DIR;  | 
| 
42
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
43
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
44
 | 
8
 | 
  
100
  
 | 
 
 | 
 
 | 
 
 | 
20
 | 
         if ( $type eq 'module' ) {  | 
| 
45
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
             $xtf->module_dir($name);  | 
| 
46
 | 
6
 | 
 
 | 
 
 | 
 
 | 
 
 | 
16
 | 
             next DIR;  | 
| 
47
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
48
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
49
 | 
2
 | 
  
 50
  
 | 
 
 | 
 
 | 
 
 | 
6
 | 
         if ( $type eq 'test' ) {  | 
| 
50
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
12
 | 
             $xtf->test_dir($name);  | 
| 
51
 | 
2
 | 
 
 | 
 
 | 
 
 | 
 
 | 
5
 | 
             next DIR;  | 
| 
52
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
         }  | 
| 
53
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
     }  | 
| 
54
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
55
 | 
7
 | 
 
 | 
 
 | 
 
 | 
 
 | 
26
 | 
     return;  | 
| 
56
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 }  | 
| 
57
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
58
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 1;  | 
| 
59
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
    | 
| 
60
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 
 | 
 __END__  |