line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Siebel::AssertOS;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
50494
|
use 5.010;
|
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
110
|
|
4
|
2
|
|
|
2
|
|
1596
|
use Siebel::AssertOS::Linux::Distribution qw(distribution_name);
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
215
|
|
5
|
2
|
|
|
2
|
|
14
|
use feature 'switch';
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1951
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.05;
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import {
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
179
|
shift;
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
3
|
die_if_os_isnt();
|
14
|
|
|
|
|
|
|
}
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub die_if_os_isnt {
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
33
|
1
|
1
|
8
|
my $os = shift || $^O;
|
19
|
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
4
|
os_is($os) ? 1 : die_unsupported();
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
}
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub die_unsupported {
|
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
1
|
1
|
23
|
die 'OS unsupported';
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub os_is {
|
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
1
|
2
|
my $os = shift;
|
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
2
|
given ($os) {
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
27
|
when ('linux') {
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# supported Linux distribuitions
|
39
|
1
|
|
|
|
|
4
|
my %distros =
|
40
|
|
|
|
|
|
|
( redhat => 1, suse => 1, 'oracle enterprise linux' => 1 );
|
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
|
|
4
|
my $distro = distribution_name();
|
43
|
|
|
|
|
|
|
|
44
|
1
|
50
|
|
|
|
6
|
if ( exists( $distros{ $distro } ) ) {
|
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
0
|
return 1;
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
else {
|
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
|
|
6
|
return 0;
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
}
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
}
|
56
|
0
|
|
|
|
|
|
when ('MSWin32') { return 1 }
|
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
when ('aix') { return 1 }
|
|
0
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
when ('solaris') { return 1 }
|
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
when ('hpux') { return 1 }
|
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
default { return 0 }
|
|
0
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
}
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
}
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
1;
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
__END__
|