line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Narada; |
2
|
|
|
|
|
|
|
|
3
|
41
|
|
|
41
|
|
172456
|
use warnings; |
|
41
|
|
|
|
|
95
|
|
|
41
|
|
|
|
|
1344
|
|
4
|
41
|
|
|
41
|
|
217
|
use strict; |
|
41
|
|
|
|
|
101
|
|
|
41
|
|
|
|
|
998
|
|
5
|
41
|
|
|
41
|
|
203
|
use Carp; |
|
41
|
|
|
|
|
73
|
|
|
41
|
|
|
|
|
7732
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 'v2.3.8'; |
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
|
472
|
my %need = map {$_=>1} @_ ? @_ : qw( narada narada-1 ); |
|
125
|
|
|
|
|
708
|
|
25
|
82
|
100
|
100
|
|
|
2927
|
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
|
100
|
|
|
20199
|
return $type if $type && $need{$type}; |
31
|
15
|
|
|
|
|
1602
|
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__ |