line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Installer::Precondition::PRC; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
78908
|
$Tapper::Installer::Precondition::PRC::AUTHORITY = 'cpan:TAPPER'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$Tapper::Installer::Precondition::PRC::VERSION = '4.1.1'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
68
|
|
10
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
11
|
use File::Basename; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
185
|
|
13
|
2
|
|
|
2
|
|
1737
|
use Hash::Merge::Simple 'merge'; |
|
2
|
|
|
|
|
1320
|
|
|
2
|
|
|
|
|
140
|
|
14
|
2
|
|
|
2
|
|
1868
|
use File::ShareDir 'module_file'; |
|
2
|
|
|
|
|
17704
|
|
|
2
|
|
|
|
|
193
|
|
15
|
2
|
|
|
2
|
|
1196
|
use Moose; |
|
2
|
|
|
|
|
541589
|
|
|
2
|
|
|
|
|
22
|
|
16
|
2
|
|
|
2
|
|
17375
|
use YAML; |
|
2
|
|
|
|
|
20985
|
|
|
2
|
|
|
|
|
4636
|
|
17
|
|
|
|
|
|
|
extends 'Tapper::Installer::Precondition'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub create_common_config |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
0
|
|
0
|
my ($self, $config) = @_; |
25
|
0
|
|
|
|
|
0
|
$config->{report_server} = $self->{cfg}->{report_server}; |
26
|
0
|
|
|
|
|
0
|
$config->{report_port} = $self->{cfg}->{report_port}; |
27
|
0
|
|
|
|
|
0
|
$config->{report_api_port} = $self->{cfg}->{report_api_port}; |
28
|
0
|
|
|
|
|
0
|
$config->{hostname} = $self->{cfg}->{hostname}; # allows guest systems to know their host system name |
29
|
0
|
|
|
|
|
0
|
$config->{test_run} = $self->{cfg}->{test_run}; |
30
|
0
|
0
|
|
|
|
0
|
$config->{mcp_port} = $self->{cfg}->{mcp_port} if $self->{cfg}->{mcp_port}; |
31
|
0
|
|
|
|
|
0
|
$config->{mcp_server} = $self->{cfg}->{mcp_server}; |
32
|
0
|
0
|
|
|
|
0
|
$config->{sync_port} = $self->{cfg}->{sync_port} if $self->{cfg}->{sync_port}; |
33
|
0
|
0
|
|
|
|
0
|
$config->{prc_nfs_server} = $self->{cfg}->{prc_nfs_server} if $self->{cfg}->{prc_nfs_server}; # prc_nfs_path is set by merging paths above |
34
|
0
|
0
|
|
|
|
0
|
$config->{scenario_id} = $self->{cfg}->{scenario_id} if $self->{cfg}->{scenario_id}; |
35
|
0
|
|
|
|
|
0
|
$config->{paths} = $self->{cfg}->{paths}; |
36
|
0
|
0
|
|
|
|
0
|
$config->{files} = $self->{cfg}->{files} if $self->{cfg}->{files} ; |
37
|
0
|
0
|
|
|
|
0
|
$config->{testplan} = $self->{cfg}->{testplan} if $self->{cfg}->{testplan}; |
38
|
0
|
|
|
|
|
0
|
$config->{log_to_file} = $self->{cfg}->{log_to_file}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
0
|
return $config; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub create_unix_config |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
0
|
|
0
|
my ($self, $prc) = @_; |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
|
|
0
|
my $config = $self->create_common_config($prc->{config}); |
50
|
0
|
|
|
|
|
0
|
$config = merge($config, {times=>$self->{cfg}->{times}}); |
51
|
0
|
|
|
|
|
0
|
my @timeouts; |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
0
|
if ($prc->{config}->{guest_count}) |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
|
|
0
|
$config->{guest_count} = $prc->{config}->{guest_count}; |
56
|
0
|
|
|
|
|
0
|
$config->{timeouts} = $prc->{config}->{timeouts}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
else |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
|
|
0
|
$config->{mcp_server} = $self->{cfg}->{mcp_server}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
0
|
return $config; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub write_unix_config |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
|
0
|
my ($self, $prc) = @_; |
70
|
0
|
|
|
|
|
0
|
my $basedir = $self->cfg->{paths}{base_dir}; |
71
|
0
|
|
|
|
|
0
|
my $config = $self->create_unix_config($prc); |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
0
|
$self->makedir("$basedir/etc") if not -d "$basedir/etc"; |
74
|
0
|
0
|
|
|
|
0
|
open my $file, '>',"$basedir/etc/tapper" or return "Can not open /etc/tapper in $basedir:$!"; |
75
|
0
|
|
|
|
|
0
|
print $file YAML::Dump($config); |
76
|
0
|
|
|
|
|
0
|
close $file; |
77
|
0
|
|
|
|
|
0
|
return 0; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub install_startscript |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
|
|
0
|
|
0
|
my ($self, $distro) = @_; |
85
|
0
|
|
|
|
|
0
|
my $basedir = $self->cfg->{paths}{base_dir}; |
86
|
0
|
|
|
|
|
0
|
my ($error, $retval); |
87
|
0
|
0
|
|
|
|
0
|
if (not -d "$basedir/etc/init.d" ) { |
88
|
0
|
0
|
|
|
|
0
|
mkdir("$basedir/etc/init.d") or return "Can't create /etc/init.d/ in $basedir"; |
89
|
|
|
|
|
|
|
} |
90
|
0
|
|
|
|
|
0
|
($error, $retval) = $self->log_and_exec("cp",module_file('Tapper::Installer', "startfiles/$distro/etc/init.d/tapper"),"$basedir/etc/init.d/tapper"); |
91
|
0
|
0
|
|
|
|
0
|
return $retval if $error; |
92
|
0
|
0
|
|
|
|
0
|
if ($distro!~/tapper/) { |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
0
|
pipe (my $read, my $write); |
95
|
0
|
0
|
0
|
|
|
0
|
return ("Can't open pipe:$!") if not (defined $read and defined $write); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
# fork for the stuff inside chroot |
98
|
0
|
|
|
|
|
0
|
my $pid = fork(); |
99
|
0
|
0
|
|
|
|
0
|
return "fork failed: $!" if not defined $pid; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# child |
102
|
0
|
0
|
|
|
|
0
|
if ($pid == 0) { |
103
|
0
|
|
|
|
|
0
|
close $read; |
104
|
0
|
|
|
|
|
0
|
chroot $basedir; |
105
|
0
|
|
|
|
|
0
|
chdir ("/"); |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
0
|
my $ret = 0; |
108
|
0
|
|
|
|
|
0
|
my ($error, $retval); |
109
|
0
|
0
|
|
|
|
0
|
if ($distro=~m/suse|debian/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
110
|
0
|
|
|
|
|
0
|
($error, $retval)=$self->log_and_exec("insserv","/etc/init.d/tapper"); |
111
|
|
|
|
|
|
|
} elsif ($distro=~m/(redhat)|(fedora)/) { |
112
|
0
|
|
|
|
|
0
|
($error, $retval)=$self->log_and_exec("chkconfig","--add","tapper"); |
113
|
|
|
|
|
|
|
} elsif ($distro=~m/(ubuntu)/) { |
114
|
0
|
|
|
|
|
0
|
($error, $retval)=$self->log_and_exec("update-rc.d","-f", "tapper", "defaults"); |
115
|
|
|
|
|
|
|
} elsif ($distro=~/gentoo/) { |
116
|
0
|
|
|
|
|
0
|
($error, $retval)=$self->log_and_exec("rc-update", "add", "tapper_gentoo", "default"); |
117
|
|
|
|
|
|
|
} else { |
118
|
0
|
|
|
|
|
0
|
($error, $retval)=(1,"No supported distribution detected."); |
119
|
|
|
|
|
|
|
} |
120
|
0
|
0
|
|
|
|
0
|
print($write "$retval") if $error; |
121
|
0
|
|
|
|
|
0
|
close $write; |
122
|
0
|
|
|
|
|
0
|
exit $error; |
123
|
|
|
|
|
|
|
} else { # parent |
124
|
0
|
|
|
|
|
0
|
close $write; |
125
|
0
|
|
|
|
|
0
|
waitpid($pid,0); |
126
|
0
|
0
|
|
|
|
0
|
if ($?) { |
127
|
0
|
|
|
|
|
0
|
my $output = <$read>; |
128
|
0
|
|
|
|
|
0
|
return($output); |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub create_windows_config |
136
|
|
|
|
|
|
|
{ |
137
|
0
|
|
|
0
|
|
0
|
my ($self, $prc) = @_; |
138
|
0
|
|
|
|
|
0
|
my $basedir = $self->cfg->{paths}{base_dir}; |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
0
|
my $config = $self->create_common_config(); |
141
|
0
|
0
|
|
|
|
0
|
$config->{guest_number} = $prc->{config}->{guest_number} if $prc->{config}->{guest_number}; |
142
|
|
|
|
|
|
|
|
143
|
0
|
0
|
|
|
|
0
|
if ($prc->{config}->{guest_count}) |
144
|
|
|
|
|
|
|
{ |
145
|
0
|
|
|
|
|
0
|
$config->{guest_count} = $prc->{config}->{guest_count}; |
146
|
|
|
|
|
|
|
} |
147
|
0
|
0
|
|
|
|
0
|
if ($prc->{config}->{testprogram_list}) { |
|
|
0
|
|
|
|
|
|
148
|
0
|
|
|
|
|
0
|
for (my $i=0; $i< int @{$prc->{config}->{testprogram_list}}; $i++) { |
|
0
|
|
|
|
|
0
|
|
149
|
|
|
|
|
|
|
# string concatenation for hash keys, otherwise perl can't tell whether |
150
|
|
|
|
|
|
|
# $i ot $i_prog is the name of the variable |
151
|
0
|
|
|
|
|
0
|
my $list_element = $prc->{config}->{testprogram_list}->[$i]; |
152
|
0
|
|
|
|
|
0
|
$config->{"test".$i."_prog"} = $list_element->{program}; |
153
|
0
|
|
0
|
|
|
0
|
$config->{"test".$i."_prog"} ||= $list_element->{test_program}; |
154
|
0
|
|
|
|
|
0
|
$config->{"test".$i."_runtime_default"} = $list_element->{runtime}; |
155
|
0
|
|
|
|
|
0
|
$config->{"test".$i."_timeout"} = $list_element->{timeout}; |
156
|
0
|
|
0
|
|
|
0
|
$config->{"test".$i."_timeout"} ||= $list_element->{timeout_testprogram}; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
} elsif ($prc->{config}->{test_program}) { |
159
|
0
|
|
|
|
|
0
|
$config->{test0_prog} = $prc->{config}->{test_program}; |
160
|
0
|
|
|
|
|
0
|
$config->{test0_runtime_default} = $prc->{config}->{runtime}; |
161
|
0
|
|
|
|
|
0
|
$config->{test0_timeout} = $prc->{config}->{timeout_testprogram} |
162
|
|
|
|
|
|
|
} |
163
|
0
|
|
|
|
|
0
|
return $config; |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub write_windows_config |
169
|
|
|
|
|
|
|
{ |
170
|
0
|
|
|
0
|
|
0
|
my ($self, $prc) = @_; |
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
0
|
my $config = $self->create_windows_config($prc); |
173
|
0
|
|
|
|
|
0
|
my $basedir = $self->cfg->{paths}{base_dir}; |
174
|
0
|
0
|
|
|
|
0
|
open my $file, '>', $basedir.'/test.config' or return "Can not open /test.config in $basedir:$!"; |
175
|
0
|
|
|
|
|
0
|
print $file YAML::Dump($config); |
176
|
0
|
|
|
|
|
0
|
close $file; |
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
0
|
return 0 |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub install |
185
|
|
|
|
|
|
|
{ |
186
|
1
|
|
|
1
|
|
578
|
my ($self, $prc) = @_; |
187
|
|
|
|
|
|
|
|
188
|
1
|
|
|
|
|
115
|
my $basedir = $self->cfg->{paths}{base_dir}; |
189
|
0
|
|
|
|
|
0
|
my ($error, $retval); |
190
|
0
|
|
|
|
|
0
|
my $distro = $self->get_distro($basedir); |
191
|
0
|
0
|
0
|
|
|
0
|
$retval = $self->install_startscript($distro) if $distro and not $prc->{skip_startscript}; |
192
|
0
|
0
|
|
|
|
0
|
return $retval if $retval; |
193
|
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
0
|
$error = $self->write_unix_config($prc); |
195
|
0
|
0
|
|
|
|
0
|
return $error if $error; |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
0
|
$error = $self->write_windows_config($prc); |
199
|
0
|
0
|
|
|
|
0
|
return $error if $error; |
200
|
|
|
|
|
|
|
|
201
|
0
|
0
|
|
|
|
0
|
if ($prc->{tapper_package}) { |
202
|
0
|
|
|
|
|
0
|
my $pkg_object=Tapper::Installer::Precondition::Package->new($self->cfg); |
203
|
0
|
|
|
|
|
0
|
my $package={filename => $prc->{tapper_package}}; |
204
|
0
|
0
|
|
|
|
0
|
$self->logdie($retval) if $retval = $pkg_object->install($package); |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
0
|
|
|
|
|
0
|
return 0; |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub get_distro |
214
|
|
|
|
|
|
|
{ |
215
|
3
|
|
|
3
|
|
2580
|
my ($self, $dir) = @_; |
216
|
3
|
|
|
|
|
240
|
my @files=glob("$dir/etc/*-release"); |
217
|
3
|
|
|
|
|
10
|
for my $file(@files){ |
218
|
1
|
50
|
|
|
|
10
|
return "suse" if $file =~ /suse/i; |
219
|
0
|
0
|
|
|
|
0
|
return "redhat" if $file =~ /redhat/i; |
220
|
0
|
0
|
|
|
|
0
|
return "gentoo" if $file =~ /gentoo/i; |
221
|
0
|
0
|
|
|
|
0
|
return "tapper" if $file =~ /tapper/i; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
{ |
224
|
2
|
100
|
|
|
|
5
|
open my $fh, '<',"$dir/etc/issue" or next; |
|
2
|
|
|
|
|
72
|
|
225
|
1
|
|
|
|
|
4
|
local $\=''; |
226
|
1
|
|
|
|
|
586
|
my $issue = <$fh>; |
227
|
1
|
|
|
|
|
21
|
close $fh; |
228
|
1
|
|
|
|
|
2
|
my $distro; |
229
|
1
|
|
|
|
|
13
|
($distro) = $issue =~ m/(Debian|Ubuntu)/i; |
230
|
1
|
50
|
|
|
|
20
|
return lc($distro) if $distro; |
231
|
|
|
|
|
|
|
} |
232
|
1
|
|
|
|
|
6
|
return ""; |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
1; |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
__END__ |
239
|
|
|
|
|
|
|
=pod |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=encoding utf-8 |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head1 NAME |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
Tapper::Installer::Precondition::PRC |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=head1 SYNOPSIS |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
use Tapper::Installer::Precondition::PRC; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head1 NAME |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
Tapper::Installer::Precondition::PRC - Install Program Run Control to a given location |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=head1 FUNCTIONS |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=head2 create_common_config |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
Create the part of the config that is the same for both Windows and Unix. |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
@return hash ref |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=head2 create_unix_config |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
Generate a config for PRC running on Unix system. Take special care for |
266
|
|
|
|
|
|
|
virtualisation environments. In this case, the host system runs a proxy |
267
|
|
|
|
|
|
|
which collects status messages from all virtualisation guests. |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
@param hash reference - contains all information about the PRC to install |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
@return hash ref - config |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=head2 write_unix_config |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
Generate and write config for unix test. |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
@param hash reference - contains all information about the PRC to install |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
@return success - 0 |
280
|
|
|
|
|
|
|
@return error - error string |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
=head2 install_startscript |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
Install a startscript for init in test state. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
@return success - 0 |
287
|
|
|
|
|
|
|
@return error - error string |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
=head2 create_windows_config |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Create the config for a windows guest running the special Win-PRC. Win-PRC |
292
|
|
|
|
|
|
|
expects a flat YAML with some different keys and does not want any waste |
293
|
|
|
|
|
|
|
options. |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
@param hash reference - contains all information about the PRC to install |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
@return hash ref - windows config |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=head2 write_windows_config |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
Generate and write config for windows guest. |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
@param hash reference - contains all information about the PRC to install |
304
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
@return success - 0 |
306
|
|
|
|
|
|
|
@return error - error string |
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=head2 install |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
Install the tools used to control running of programs on the test |
311
|
|
|
|
|
|
|
system. This function is implemented to fullfill the needs of kernel |
312
|
|
|
|
|
|
|
testing and is likely to change dramatically in the future due to |
313
|
|
|
|
|
|
|
limited extensibility. Furthermore, it has the name of the PRC hard |
314
|
|
|
|
|
|
|
coded which isn't a good thing either. |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
@param hash ref - contains all information about the PRC to install |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
@return success - 0 |
319
|
|
|
|
|
|
|
@return error - return value of system or error string |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head2 get_distro |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
Find out which distribution is installed below the directory structure |
324
|
|
|
|
|
|
|
given as argument. The guessed distribution is returned as a string. |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
@param string - path name under which to check for an installed |
327
|
|
|
|
|
|
|
distribution |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
@return success - name of the distro |
330
|
|
|
|
|
|
|
@return error - empty string |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head1 AUTHOR |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
This software is Copyright (c) 2012 by Advanced Micro Devices, Inc.. |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
This is free software, licensed under: |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
=cut |
345
|
|
|
|
|
|
|
|