line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Narada; |
2
|
|
|
|
|
|
|
|
3
|
41
|
|
|
41
|
|
94568
|
use warnings; |
|
41
|
|
|
|
|
56
|
|
|
41
|
|
|
|
|
1200
|
|
4
|
41
|
|
|
41
|
|
137
|
use strict; |
|
41
|
|
|
|
|
99
|
|
|
41
|
|
|
|
|
684
|
|
5
|
41
|
|
|
41
|
|
120
|
use Carp; |
|
41
|
|
|
|
|
51
|
|
|
41
|
|
|
|
|
5922
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 'v2.3.7'; |
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
|
296
|
my %need = map {$_=>1} @_ ? @_ : qw( narada narada-1 ); |
|
125
|
|
|
|
|
440
|
|
25
|
82
|
100
|
100
|
|
|
2256
|
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
|
|
|
3118
|
return $type if $type && $need{$type}; |
31
|
15
|
|
|
|
|
1210
|
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__ |