line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Narada; |
2
|
|
|
|
|
|
|
|
3
|
41
|
|
|
41
|
|
139289
|
use warnings; |
|
41
|
|
|
|
|
79
|
|
|
41
|
|
|
|
|
1580
|
|
4
|
41
|
|
|
41
|
|
199
|
use strict; |
|
41
|
|
|
|
|
118
|
|
|
41
|
|
|
|
|
893
|
|
5
|
41
|
|
|
41
|
|
179
|
use Carp; |
|
41
|
|
|
|
|
83
|
|
|
41
|
|
|
|
|
7775
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 'v2.3.6'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# Possible types of current directory: |
11
|
|
|
|
|
|
|
# - narada-1 |
12
|
|
|
|
|
|
|
# config/patch/ |
13
|
|
|
|
|
|
|
# config/version |
14
|
|
|
|
|
|
|
# var/backup/ |
15
|
|
|
|
|
|
|
# var/patch/ |
16
|
|
|
|
|
|
|
# - narada |
17
|
|
|
|
|
|
|
# VERSION (except when migrating from 0.0.0) |
18
|
|
|
|
|
|
|
# .backup/ |
19
|
|
|
|
|
|
|
# - narada-1 and narada |
20
|
|
|
|
|
|
|
# config/backup/ |
21
|
|
|
|
|
|
|
# config/log/ |
22
|
|
|
|
|
|
|
# var/log/ |
23
|
|
|
|
|
|
|
sub detect { |
24
|
82
|
100
|
|
82
|
0
|
403
|
my %need = map {$_=>1} @_ ? @_ : qw( narada narada-1 ); |
|
125
|
|
|
|
|
581
|
|
25
|
82
|
100
|
100
|
|
|
3136
|
my $type |
|
|
100
|
66
|
|
|
|
|
26
|
|
|
|
|
|
|
= -d 'config/backup' && -d '.backup' ? 'narada' |
27
|
|
|
|
|
|
|
: -d 'config/backup' && -d 'var/backup' ? 'narada-1' |
28
|
|
|
|
|
|
|
: undef |
29
|
|
|
|
|
|
|
; |
30
|
82
|
100
|
66
|
|
|
3739
|
return $type if $type && $need{$type}; |
31
|
15
|
|
|
|
|
1888
|
die 'This is not '.join(' or ', keys %need)." directory\n"; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
36
|
|
|
|
|
|
|
__END__ |