install_util/GBrowseInstall.pm

filter: Statementstmt 23.6% 132 / 559 Branchbran 17.7% 33 / 186 Conditioncond 10.6% 16 / 151 MC/DCmcdc 1.1% 1 / 86 Subroutinesub 45.9% 28 / 61 Podpod 2.3% 1 / 43 totaltotal 19.4% 211 / 1086 CC 152 SCAR 47.6
CC
152
Cov
20%
ACTION_install
462.0
ACTION_demo
380.0
check_installed
182.0
CRAP 116.6
« blib/conf/plugins/GeneFinder.pm ↑ Summary blib/lib/Bio/Graphics/Browser2/DataLoader/generic.pm »
1 package GBrowseInstall;
2  
3 2 ▶use base 'Module::Build';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use ExtUtils::CBuilder;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use ExtUtils::MakeMaker 'prompt';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use File::Basename 'dirname','basename';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use File::Path 'rmtree','mkpath';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use File::Temp 'tempdir';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use IO::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use IO::Dir;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use File::Compare 'compare';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use File::Copy 'copy','cp';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use GBrowseGuessDirectories;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use Carp 'cluck';
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 2 use overload '""' => 'asString',
21 2 ▶ fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use constant REGISTRATION_SERVER => 'http://modencode.oicr.on.ca/cgi-bin/gbrowse_registration';
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 my @OK_PROPS = (conf => 'Directory for GBrowse\'s config and support files?',
26 htdocs => 'Directory for GBrowse\'s static images & HTML files?',
27 tmp => 'Directory for GBrowse\'s temporary data',
28 persistent => 'Directory for GBrowse\'s sessions, uploaded tracks and other persistent data',
29 databases => 'Directory for GBrowse\'s example databases',
30 cgibin => 'Directory for GBrowse\'s CGI script executables?',
31 portdemo => 'Internet port to run demo web site on (for demo)?',
32 apachemodules => 'Apache loadable module directory (for demo)?',
33 wwwuser => 'User account under which Apache daemon runs?',
34 installconf => 'Automatically update Apache config files to run GBrowse?',
35 installetc => 'Automatically update system config files to run gbrowse-slave?',
36 );
37 2 my %OK_PROPS = @OK_PROPS;
38  
39 # TO FIX: this contains much of the same code as in the non-demo build
40 # and should be refactored.
41 sub ACTION_demo {
42 0 ▶ my $self = shift;
Subroutine ACTION_demo: not called CC=19 SCAR=59.4
Pod undocumented
43 0 $self->depends_on('config_data');
44 0 $self->depends_on('build');
45  
46 0 my $dir = tempdir(
47 'GBrowse_demo_XXXX',
48 TMPDIR=>1,
49 CLEANUP=>0,
50 );
51 0 ▶ my $port = $self->config_data('portdemo')
Condition0%0/3
$self->config_data('portdemo') || 'GBrowseGuessDirectories'->portdemo
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('portdemo') || 'GBrowseGuessDirectories'->portdemo
$self->config_data('portdemo') 'GBrowseGuessDirectories'->portdemo
Truth table0%0/3
A || B
A= $self->config_data('portdemo')B= 'GBrowseGuessDirectories'->portdemo
ABresult
1X1
011
000
52 || GBrowseGuessDirectories->portdemo();
53 0 ▶ my $modules = $self->config_data('apachemodules')
Condition0%0/3
$self->config_data('apachemodules') || 'GBrowseGuessDirectories'->apachemodules
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('apachemodules') || 'GBrowseGuessDirectories'->apachemodules
$self->config_data('apachemodules') 'GBrowseGuessDirectories'->apachemodules
Truth table0%0/3
A || B
A= $self->config_data('apachemodules')B= 'GBrowseGuessDirectories'->apachemodules
ABresult
1X1
011
000
54 || GBrowseGuessDirectories->apachemodules;
55 0 ▶ my $db = $self->config_data('databases')
Condition0%0/3
$self->config_data('databases') || 'GBrowseGuessDirectories'->databases
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('databases') || 'GBrowseGuessDirectories'->databases
$self->config_data('databases') 'GBrowseGuessDirectories'->databases
Truth table0%0/3
A || B
A= $self->config_data('databases')B= 'GBrowseGuessDirectories'->databases
ABresult
1X1
011
000
56 || GBrowseGuessDirectories->databases;
57 0 my $cgiurl = $self->cgiurl;
58 0 my $persistent = $self->config_data('persistent');
59  
60 0 mkdir "$dir/conf";
61 0 mkdir "$dir/htdocs";
62 0 mkdir "$dir/logs";
63 0 mkdir "$dir/locks";
64 0 mkdir "$dir/tmp";
65  
66 # make copies of htdocs and conf
67 0 open my $saveout,">&STDOUT";
68 0 open STDOUT,">/dev/null";
69  
70 0 my $f = IO::File->new('MANIFEST');
71 0 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 0 0 0
72 0 chomp;
73 0 ▶ if (m!^(conf|htdocs)!) {
Branch: 3 branches
BranchTrueFalseTotal
if (/^(conf|htdocs)/) { } 0 0 0
elsif (/cgi-bin/) { } 0 0 0
elsif (/^sample_data/) { } 0 0 0
74 0 $self->copy_if_modified($_ => $dir);
75 } elsif (m!cgi-bin!) {
76 0 $self->copy_if_modified(from => $_,to_dir => "$dir/cgi-bin/gb2",flatten=>1);
77 } elsif (m!^sample_data!) {
78 0 chdir $self->base_dir();
79 0 my ($subdir) = m!^sample_data/([^/]+)/!;
80 0 $self->copy_if_modified(from => $_,
81 to_dir => "$dir/htdocs/databases/$subdir",
82 flatten => 1,
83 );
84 }
85 }
86 0 close $f;
87 0 chdir $self->base_dir;
88 0 open STDOUT,"<&",$saveout;
89  
90 # fix GBrowse.conf to point to correct directories
91 0 for my $f ("$dir/conf/GBrowse.conf",
92 "$dir/conf/yeast_simple.conf",
93 "$dir/conf/yeast_chr1+2.conf",
94 "$dir/conf/pop_demo.conf",
95 "$dir/conf/yeast_renderfarm.conf",
96 "$dir/htdocs/index.html") {
97 0 ▶ my $in = IO::File->new($f) or die "$dir/conf/$f: $!";
Branch: 1 branch
BranchTrueFalseTotal
my $in = "IO::File"->new($f) or die "$dir/conf/${f}: $!" 0 0 0
98 0 ▶ my $out = IO::File->new("$f.new",'>') or die $!;
Branch: 1 branch
BranchTrueFalseTotal
my $out = "IO::File"->new("$f.new", ">") or die $! 0 0 0
99 0 ▶ while (<$in>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $in)) 0 0 0
100 0 s!\$CONF!$dir/conf!g;
101 0 s!\$HTDOCS!$dir/htdocs!g;
102 0 s!\$DATABASES!$dir/htdocs/databases!g;
103 0 s!\$PERSISTENT!$dir/$persistent!g;
104 0 s!\$TMP!$dir/tmp!g;
105 0 s/\$CGIURL/$cgiurl/g;
106 0 s!\$VERSION!$self->dist_version!eg;
107 0 s/\$CAN_USER_ACCOUNTS_OPENID/$self->has_openid/eg;
108 0 s/\$CAN_USER_ACCOUNTS_REG/$self->has_smtp/eg;
109 0 s/\$CAN_USER_ACCOUNTS/$self->has_mysql_or_sqlite/eg;
110 0 s/\$USER_ACCOUNT_DB/$self->guess_user_account_db/eg;
111 0 s/\$SMTP_GATEWAY/$self->guess_smtp_gateway/eg;
112 0 s!^url_base\s*=.+!url_base = /!g;
113 0 s!^user_accounts[^=]+=.*!user_accounts = 0!;
114 0 $out->print($_);
115 }
116 0 close $out;
117 0 rename "$f.new",$f;
118 }
119
120 0 my $conf_data = $self->httpd_conf($dir,$port);
121 0 ▶ my $conf = IO::File->new("$dir/conf/httpd.conf",'>')
Branch: 1 branch
BranchTrueFalseTotal
my $conf = "IO::File"->new("$dir/conf/httpd.conf", ">") or die "$dir/conf/httpd.conf: $!" 0 0 0
122 or die "$dir/conf/httpd.conf: $!";
123 0 $conf->print($conf_data);
124 0 $conf->close;
125  
126 0 $conf_data = $self->gbrowse_demo_conf($port,$dir);
127 0 ▶ $conf = IO::File->new("$dir/conf/apache_gbrowse.conf",'>')
Branch: 1 branch
BranchTrueFalseTotal
$conf = "IO::File"->new("$dir/conf/apache_gbrowse.conf", ">") or die "$dir/conf/apache_gbrowse.conf: $!" 0 0 0
128 or die "$dir/conf/apache_gbrowse.conf: $!";
129 0 $conf->print($conf_data);
130 0 $conf->close;
131  
132 0 $conf_data = $self->mime_conf();
133 0 ▶ my $mime = IO::File->new("$dir/conf/mime.types",'>')
Branch: 1 branch
BranchTrueFalseTotal
my $mime = "IO::File"->new("$dir/conf/mime.types", ">") or die "$dir/conf/mime.types: $!" 0 0 0
134 or die "$dir/conf/mime.types: $!";
135 0 $mime->print($conf_data);
136 0 $mime->close;
137  
138 0 ▶ my $apache = GBrowseGuessDirectories->apache
Branch: 1 branch
BranchTrueFalseTotal
my $apache = "GBrowseGuessDirectories"->apache or die "Could not find apache executable on this system. Can't run demo" 0 0 0
139 or die "Could not find apache executable on this system. Can't run demo";
140  
141 0 system "$apache -k start -f $dir/conf/httpd.conf";
142 0 sleep 3;
143 0 ▶ if (-e "$dir/logs/apache2.pid") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$dir/logs/apache2.pid") { } 0 0 0
144 0 print STDERR "Demo config and log files have been written to $dir\n";
145 0 print STDERR "Demo is now running on http://localhost:$port\n";
146 0 print STDERR "Run \"./Build demostop\" to stop it.\n";
147 0 $self->config_data(demodir=>$dir);
148 } else {
149 0 print STDERR "Apache failed to start. Perhaps the demo is already running?\n";
150 0 ▶ if (-e "$dir/logs/error.log") {
Branch: 1 branch
BranchTrueFalseTotal
if (-e "$dir/logs/error.log") 0 0 0
151 0 print STDERR "==Apache Error Log==\n";
152 0 my $f = IO::File->new("$dir/logs/error.log");
153 0 ▶ print STDERR while <$f>;
Branch: 1 branch
BranchTrueFalseTotal
defined($_ = readline $f) and do { print STDERR $_ } 0 0 0
154 }
155 0 rmtree([$dir]);
156 }
157 }
158  
159 sub ACTION_demostop {
160 0 ▶ my $self = shift;
Subroutine ACTION_demostop: not called CC=4 SCAR=30.0
Pod undocumented
161 0 my $dir = $self->config_data('demodir');
162 0 my $home = $self->base_dir();
163 0 ▶ unless ($dir && -e $dir) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($dir and -e $dir) 0 0 0
Condition0%0/3
$dir and -e $dir
!ll&&!rl&&r
000
MC/DC0%0/2
$dir and -e $dir
$dir -e $dir
Truth table0%0/3
A and B
A= $dirB= -e $dir
ABresult
0X0
100
111
164 0 print STDERR "Demo doesn't seem to be running.\n";
165 0 return;
166 }
167 0 ▶ my $apache = GBrowseGuessDirectories->apache
Branch: 1 branch
BranchTrueFalseTotal
my $apache = "GBrowseGuessDirectories"->apache or die "Could not find apache executable on this system. Can't stop demo" 0 0 0
168 or die "Could not find apache executable on this system. Can't stop demo";
169  
170 0 system "$apache -k stop -f $dir/conf/httpd.conf";
171 0 rmtree([$dir,"$home/htdocs/tmp"]);
172 0 $self->config_data('demodir'=>undef);
173 0 print STDERR "Demo stopped.\n";
174 }
175  
176 sub ACTION_clean {
177 0 ▶ my $self = shift;
Subroutine ACTION_clean: not called CC=1 SCAR=6.9
Pod undocumented
178 0 $self->SUPER::ACTION_clean;
179 0 unlink 'INSTALL.SKIP';
180 }
181  
182 sub ACTION_realclean {
183 0 ▶ my $self = shift;
Subroutine ACTION_realclean: not called CC=2 SCAR=17.9
Pod undocumented
184 0 $self->SUPER::ACTION_realclean;
185 0 foreach ('CAlign.xs','CAlign.pm') {
186 0 unlink "./lib/Bio/Graphics/Browser/$_";
187 }
188 }
189  
190 sub ACTION_build {
191 0 ▶ my $self = shift;
Subroutine ACTION_build: not called CC=2 SCAR=17.9
Pod undocumented
192 0 $self->depends_on('config');
193 0 ▶ $self->depends_on('register') unless $self->registration_done;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->registration_done 0 0 0
194 0 $self->SUPER::ACTION_build;
195 0 mkdir './htdocs/tmp';
196 0 chmod 0777,'./htdocs/tmp';
197 }
198  
199 sub ACTION_reconfig {
200 0 ▶ my $self = shift;
Subroutine ACTION_reconfig: not called CC=3 SCAR=24.8
Pod undocumented
201 0 $self->config_done(0);
202 0 ▶ unless (Module::Build->y_n("Reuse previous configuration as defaults?",'y')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ("Module::Build"->y_n("Reuse previous configuration as defaults?", "y")) 0 0 0
203 0 for (keys %{$self->private_props}) {
204 0 $self->config_data($_=>undef);
205 }
206 }
207 0 $self->depends_on('config_data');
208 0 warn "\n**Paths reconfigured. Running \"Build clean\".\n";
209 0 $self->ACTION_clean;
210 }
211  
212 sub ACTION_test {
213 1 ▶ my $self = shift;
Subroutine ACTION_test: called CC=1 SCAR=0.0
Pod undocumented
214 1 $self->depends_on('config_data');
215 1 $self->SUPER::ACTION_test;
216 }
217  
218 sub ACTION_distclean {
219 0 ▶ my $self = shift;
Subroutine ACTION_distclean: not called CC=1 SCAR=6.9
Pod undocumented
220 0 $self->SUPER::ACTION_distclean;
221 0 rmtree(['debian/libgbrowse-perl']);
222 }
223  
224 sub ACTION_config {
225 1 ▶ my $self = shift;
Subroutine ACTION_config: called CC=14 SCAR=49.4
Pod undocumented
226 1 local $^W = 0;
227  
228 1 ▶ my $prefix = $self->install_base || $self->prefix || '';
Condition40%2/5
$self->install_base || $self->prefix || ''
l!l
01
$self->install_base or $self->prefix
l!l&&r!l&&!r
001
MC/DC0%0/2
$self->install_base || $self->prefix || ''
$self->install_base $self->prefix
Truth table33%1/3
A or B
A= $self->install_baseB= $self->prefix
ABresult
1X1
011
000
229 1 GBrowseGuessDirectories->prefix($prefix);
230  
231 # $self->depends_on('build');
232 1 ▶ return if $self->config_done;
Branch: 1 branch
BranchTrueFalseTotal
if $self->config_done 1 0 1
233  
234 0 print STDERR "\n**Beginning interactive configuration**\n";
235  
236 0 my $props = $self->private_props;
237 my %opts = map {
238 0 $_=>$self->config_data($_)
239 } keys %$props;
240  
241 0 my $dire_warning = 0;
242 0 my @keys = @OK_PROPS;
243 0 ▶ while (@keys) {
Branch: 1 branch
BranchTrueFalseTotal
if (@keys) 0 0 0
244 0 my $key = shift @keys;
245 0 my $val = shift @keys; # not used
246  
247 # next if $self->config_data($key);
248 0 my $conf_dir = $props->{$key} =~ /directory/i;
249  
250 $opts{$key} = prompt($props->{$key},
251 $opts{$key} ||
252 ($conf_dir
253 ? File::Spec->canonpath(
254 File::Spec->catfile(GBrowseGuessDirectories->$key($opts{apache})))
255 0 ▶ : GBrowseGuessDirectories->$key($opts{apache})));
Branch: 1 branch
BranchTrueFalseTotal
$conf_dir ? : 0 0 0
Condition0%0/3
$opts{$key} || ($conf_dir ? 'File::Spec'->canonpath('File::Spec'->catfile('GBrowseGuessDirectories'->$key($opts{'apache'}))) : 'GBrowseGuessDirectories'->$key($opts{'apache'}))
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{$key} || ($conf_dir ? 'File::Spec'->canonpath('File::Spec'->catfile('GBrowseGuessDirectories'->$key($opts{'apache'}))) : 'GBrowseGuessDirectories'->$key($opts{'apache'}))
$opts{$key} ($conf_dir ? 'File::Spec'->canonpath('File::Spec'->catfile('GBrowseGuessDirectories'->$key($opts{'apache'}))) : 'GBrowseGuessDirectories'->$key($opts{'apache'}))
Truth table0%0/3
A || B
A= $opts{$key}B= ($conf_dir ? 'File::Spec'->canonpath('File::Spec'->catfile('GBrowseGuessDirectories'->$key($opts{'apache'}))) : 'GBrowseGuessDirectories'->$key($opts{'apache'}))
ABresult
1X1
011
000
256 0 ▶ if ($conf_dir) {
Branch: 1 branch
BranchTrueFalseTotal
if ($conf_dir) 0 0 0
257 0 my ($volume,$dir) = File::Spec->splitdir($opts{$key});
258 0 my $top_level = File::Spec->catfile($volume,$dir);
259  
260 0 ▶ if ($opts{$key} =~ m!(/usr/local/apache2*)!) {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts{$key} =~ m[(/usr/local/apache2*)]) 0 0 0
261 #it looks like there is no apahce installed; let the user know
262 0 my $apachedir = $1;
263 0 ▶ if (!-d $apachedir and !$dire_warning) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-d $apachedir or $dire_warning) 0 0 0
Condition0%0/3
-d $apachedir or $dire_warning
l!l&&r!l&&!r
000
MC/DC0%0/2
-d $apachedir or $dire_warning
-d $apachedir $dire_warning
Truth table0%0/3
A or B
A= -d $apachedirB= $dire_warning
ABresult
1X1
011
000
264 0 print STDERR <<END
265  
266 ******************************WARNING***********************************
267 GBrowse is being configured to install in $apachedir, but that
268 directory doesn't exist, which means either Apache isn\'t installed
269 or the installer couldn't find it. If you continue with this
270 installation there is a good chance it won't work if Apache isn't
271 installed.
272 ******************************WARNING***********************************
273  
274 END
275 ;
276 0 $dire_warning = 1;
277 }
278 }
279  
280 0 ▶ unless (-d $top_level) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-d $top_level) 0 0 0
281 0 ▶ next if Module::Build->y_n("The directory $top_level does not exist. Use anyway?",'n');
Branch: 1 branch
BranchTrueFalseTotal
if "Module::Build"->y_n("The directory $top_level does not exist. Use anyway?", "n") 0 0 0
282 0 redo;
283 }
284 }
285 }
286  
287 0 for my $key (keys %opts) {
288 0 $self->config_data($key=>$opts{$key});
289 }
290  
291 0 $self->config_done(1);
292  
293 0 print STDERR "\n**Interactive configuration done. Run './Build reconfig' to reconfigure**\n";
294 }
295  
296 sub ACTION_register {
297 0 ▶ my $self = shift;
Subroutine ACTION_register: not called CC=6 SCAR=37.4
Pod undocumented
298 0 ▶ return unless -t STDIN;
Branch: 1 branch
BranchTrueFalseTotal
unless -t STDIN 0 0 0
299 0 print STDERR "\n**Registration**\nGBrowse2 registration is optional, but will help us maintain funding for this project.\n";
300 0 ▶ if (Module::Build->y_n("Do you wish to register your installation?",'y')) {
Branch: 1 branch
BranchTrueFalseTotal
if ('Module::Build'->y_n('Do you wish to register your installation?', 'y')) { } 0 0 0
301 0 print STDERR "All values are optional, but appreciated.\n";
302 0 my $user = prompt('Your name:');
303 0 my $email = prompt('Your email address:');
304 0 my $org = prompt('Your organization:');
305 0 my $organism = prompt('Organisms you will be using GBrowse for (one line):');
306 0 my $site = prompt('If GBrowse will be public, the URL of your web site:');
307 0 my $result = eval {
308 0 eval "use HTTP::Request::Common";
309 0 eval "use LWP::UserAgent";
310 0 my $ua = LWP::UserAgent->new;
311 0 my $response = $ua->request(POST(REGISTRATION_SERVER,
312 [user=>$user,email=>$email,
313 org=>$org,organism=>$organism,
314 site=>$site]
315 ));
316 0 ▶ die $response->status_line unless $response->is_success;
Branch: 1 branch
BranchTrueFalseTotal
unless $response->is_success 0 0 0
317 0 my $content = $response->decoded_content;
318 0 $content eq 'ok';
319 };
320 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) { } 0 0 0
321 0 print STDERR "An error occurred during registration: $@\n";
322 0 print STDERR "If you are able to fix the error, you can register later ";
323 0 print STDERR "using \"./Build register\"\n";
324 } else {
325 0 ▶ print STDERR $result ? "Thank you. Your registration was sent successfully.\n"
Branch: 1 branch
BranchTrueFalseTotal
$result ? : 0 0 0
326 : "An error occurred during registration. Thanks anyway.\n";
327 }
328 } else {
329 0 print STDERR "If you wish to register at a later time please \"./Build register\"\n";
330 0 print STDERR "Press any key to continue\n";
331 0 my $h = <STDIN>;
332 }
333 0 $self->registration_done(1);
334 }
335  
336  
337 sub ACTION_config_data {
338 1 ▶ my $self = shift;
Subroutine ACTION_config_data: called CC=1 SCAR=0.0
Pod undocumented
339 1 $self->depends_on('config');
340 1 $self->SUPER::ACTION_config_data;
341 }
342  
343 sub ACTION_apache_conf {
344 0 ▶ my $self = shift;
Subroutine ACTION_apache_conf: not called CC=1 SCAR=6.9
Pod undocumented
345 0 $self->depends_on('config');
346  
347 0 my $docs = basename($self->config_data('htdocs'));
348 0 print STDERR <<END;
349  
350 INSTRUCTIONS: Paste the following into your Apache configuration
351 file. You may wish to save it separately and include it using the
352 Apache "Include /path/to/file" directive. Then restart Apache and
353 point your browser to http://your.site/$docs/ to start browsing the
354 sample genomes.
355  
356 >>>>>> cut here <<<<<
357 END
358 ;
359 0 print $self->apache_conf;
360 }
361  
362 sub apache_conf {
363 0 ▶ my $self = shift;
Subroutine apache_conf: not called CC=5 SCAR=34.0
Pod documented
364 0 my $dir = $self->config_data('htdocs');
365 0 my $conf = $self->config_data('conf');
366 0 my $cgibin = $self->config_data('cgibin');
367 0 my $tmp = $self->config_data('tmp');
368 0 my $databases = $self->config_data('databases');
369 0 my $cgiroot = basename($cgibin);
370 0 my $perl5lib= $self->added_to_INC;
371 0 ▶ my $inc = $perl5lib ? "SetEnv PERL5LIB \"$perl5lib\"" : '';
Branch: 1 branch
BranchTrueFalseTotal
$perl5lib ? : 0 0 0
372 0 ▶ my $fcgi_inc = $perl5lib ? "-initial-env PERL5LIB=$perl5lib" : '';
Branch: 1 branch
BranchTrueFalseTotal
$perl5lib ? : 0 0 0
373 0 ▶ my $fcgid_inc= $perl5lib ? "FcgidInitialEnv PERL5LIB $perl5lib" : '';
Branch: 1 branch
BranchTrueFalseTotal
$perl5lib ? : 0 0 0
374 my $modperl_switches = $perl5lib
375 0 ▶ ? "PerlSwitches ".join ' ',map{"-I$_"} split ':',$perl5lib
Branch: 1 branch
BranchTrueFalseTotal
$perl5lib ? : 0 0 0
376 : '';
377  
378 0 return <<END;
379 Alias "/gbrowse2/i/" "$tmp/images/"
380 Alias "/gbrowse2" "$dir"
381 ScriptAlias "/gb2" "$cgibin"
382  
383 <Directory "$dir">
384 AllowOverride Options
385 Options -Indexes -MultiViews +FollowSymLinks
386 Order allow,deny
387 Allow from all
388 </Directory>
389  
390 <Directory "$dir/tutorial">
391 Options +Indexes
392 </Directory>
393  
394 <Directory "$tmp/images/">
395 Order allow,deny
396 Allow from all
397 </Directory>
398  
399 <Directory "$databases">
400 Order allow,deny
401 Deny from all
402 </Directory>
403  
404 <Directory "$cgibin">
405 ${inc}
406 Options ExecCGI
407 SetEnv GBROWSE_CONF "$conf"
408 </Directory>
409  
410 <IfModule mod_fcgid.c>
411 Alias /fgb2 "$cgibin"
412 <Location /fgb2>
413 SetHandler fcgid-script
414 </Location>
415 FcgidInitialEnv GBROWSE_CONF $conf
416 # these directives prevent idle/busy timeouts and may need to be
417 # adjusted up or down
418 FcgidMinProcessesPerClass 6
419 FcgidConnectTimeout 30
420 FcgidIOTimeout 600
421 FcgidBusyTimeout 600
422 # allow larger file uploads up to 128M under FastCGI (default is 128K)
423 FcgidMaxRequestLen 134217728
424 $fcgid_inc
425 </IfModule>
426  
427 <IfModule mod_fastcgi.c>
428 Alias /fast "$cgibin"
429 <Location /fast>
430 SetHandler fastcgi-script
431 </Location>
432 # Note: you may need to increase -idle-timeout if file uploads are timing out and returning server
433 # errors.
434 FastCgiConfig -startDelay 30 -appConnTimeout 30 -idle-timeout 600 -maxClassProcesses 20 $fcgi_inc -initial-env GBROWSE_CONF=$conf
435 </IfModule>
436  
437 # Use of mod_perl is no longer supported. Use at your own risk.
438 <IfModule mod_perl.c>
439 Alias /mgb2 "$cgibin"
440 $modperl_switches
441 <Location /mgb2>
442 SetHandler perl-script
443 PerlResponseHandler ModPerl::Registry
444 PerlOptions +ParseHeaders
445 </Location>
446 </IfModule>
447 END
448 }
449  
450 sub ACTION_install {
451 0 ▶ my $self = shift;
Subroutine ACTION_install: not called CC=21 SCAR=61.4
Pod undocumented
452 0 ▶ my $prefix = $self->install_base || $self->prefix || '';
Condition0%0/5
$self->install_base || $self->prefix || ''
l!l
00
$self->install_base or $self->prefix
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_base || $self->prefix || ''
$self->install_base $self->prefix
Truth table0%0/3
A or B
A= $self->install_baseB= $self->prefix
ABresult
1X1
011
000
453 0 GBrowseGuessDirectories->prefix($prefix);
454  
455 0 $self->depends_on('config_data');
456 $self->install_path->{conf}
457 0 ▶ ||= $self->config_data('conf') || GBrowseGuessDirectories->conf;
Condition0%0/6
$self->install_path->{"conf"} ||= $self->config_data("conf") || "GBrowseGuessDirectories"->conf
l!l&&r!l&&!r
000
$self->config_data('conf') || 'GBrowseGuessDirectories'->conf
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->install_path->{"conf"} ||= $self->config_data("conf") || "GBrowseGuessDirectories"->conf
$self->install_path->{"conf"} $self->config_data('conf') 'GBrowseGuessDirectories'->conf
Truth table0%0/4
A ||= B || C
A= $self->install_path->{"conf"}B= $self->config_data('conf')C= 'GBrowseGuessDirectories'->conf
ABCresult
1XX1
01X1
0011
0000
458 $self->install_path->{htdocs}
459 0 ▶ ||= $self->config_data('htdocs')
Condition0%0/6
$self->install_path->{"htdocs"} ||= $self->config_data("htdocs") || "GBrowseGuessDirectories"->htdocs
l!l&&r!l&&!r
000
$self->config_data('htdocs') || 'GBrowseGuessDirectories'->htdocs
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->install_path->{"htdocs"} ||= $self->config_data("htdocs") || "GBrowseGuessDirectories"->htdocs
$self->install_path->{"htdocs"} $self->config_data('htdocs') 'GBrowseGuessDirectories'->htdocs
Truth table0%0/4
A ||= B || C
A= $self->install_path->{"htdocs"}B= $self->config_data('htdocs')C= 'GBrowseGuessDirectories'->htdocs
ABCresult
1XX1
01X1
0011
0000
460 || GBrowseGuessDirectories->htdocs;
461 0 ▶ $self->install_path->{'cgi-bin'}
Condition0%0/6
$self->install_path->{"cgi-bin"} ||= $self->config_data("cgibin") || "GBrowseGuessDirectories"->cgibin
l!l&&r!l&&!r
000
$self->config_data('cgibin') || 'GBrowseGuessDirectories'->cgibin
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->install_path->{"cgi-bin"} ||= $self->config_data("cgibin") || "GBrowseGuessDirectories"->cgibin
$self->install_path->{"cgi-bin"} $self->config_data('cgibin') 'GBrowseGuessDirectories'->cgibin
Truth table0%0/4
A ||= B || C
A= $self->install_path->{"cgi-bin"}B= $self->config_data('cgibin')C= 'GBrowseGuessDirectories'->cgibin
ABCresult
1XX1
01X1
0011
0000
462 ||= $self->config_data('cgibin')
463 || GBrowseGuessDirectories->cgibin;
464 0 ▶ $self->install_path->{'etc'}
Condition0%0/3
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
$self->install_path->{"etc"} "GBrowseGuessDirectories"->etc
Truth table0%0/3
A ||= B
A= $self->install_path->{"etc"}B= "GBrowseGuessDirectories"->etc
ABresult
1X1
011
000
465 ||= GBrowseGuessDirectories->etc;
466 0 ▶ $self->install_path->{'databases'}
Condition0%0/6
$self->install_path->{"databases"} ||= $self->config_data("databases") || "GBrowseGuessDirectories"->databases
l!l&&r!l&&!r
000
$self->config_data('databases') || 'GBrowseGuessDirectories'->databases
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->install_path->{"databases"} ||= $self->config_data("databases") || "GBrowseGuessDirectories"->databases
$self->install_path->{"databases"} $self->config_data('databases') 'GBrowseGuessDirectories'->databases
Truth table0%0/4
A ||= B || C
A= $self->install_path->{"databases"}B= $self->config_data('databases')C= 'GBrowseGuessDirectories'->databases
ABCresult
1XX1
01X1
0011
0000
467 ||= $self->config_data('databases')
468 || GBrowseGuessDirectories->databases;
469 0 ▶ $self->install_path->{'persistent'}
Condition0%0/6
$self->install_path->{"persistent"} ||= $self->config_data("persistent") || "GBrowseGuessDirectories"->persistent
l!l&&r!l&&!r
000
$self->config_data('persistent') || 'GBrowseGuessDirectories'->persistent
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->install_path->{"persistent"} ||= $self->config_data("persistent") || "GBrowseGuessDirectories"->persistent
$self->install_path->{"persistent"} $self->config_data('persistent') 'GBrowseGuessDirectories'->persistent
Truth table0%0/4
A ||= B || C
A= $self->install_path->{"persistent"}B= $self->config_data('persistent')C= 'GBrowseGuessDirectories'->persistent
ABCresult
1XX1
01X1
0011
0000
470 ||= $self->config_data('persistent')
471 || GBrowseGuessDirectories->persistent;
472
473 0 $self->SUPER::ACTION_install();
474  
475 0 ▶ my $user = $self->config_data('wwwuser') || GBrowseGuessDirectories->wwwuser;
Condition0%0/3
$self->config_data('wwwuser') || 'GBrowseGuessDirectories'->wwwuser
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('wwwuser') || 'GBrowseGuessDirectories'->wwwuser
$self->config_data('wwwuser') 'GBrowseGuessDirectories'->wwwuser
Truth table0%0/3
A || B
A= $self->config_data('wwwuser')B= 'GBrowseGuessDirectories'->wwwuser
ABresult
1X1
011
000
476  
477 # fix some directories so that www user can write into them
478 0 ▶ my $tmp = $self->config_data('tmp') || GBrowseGuessDirectories->tmp;
Condition0%0/3
$self->config_data('tmp') || 'GBrowseGuessDirectories'->tmp
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('tmp') || 'GBrowseGuessDirectories'->tmp
$self->config_data('tmp') 'GBrowseGuessDirectories'->tmp
Truth table0%0/3
A || B
A= $self->config_data('tmp')B= 'GBrowseGuessDirectories'->tmp
ABresult
1X1
011
000
479 0 mkpath($tmp);
480 0 my ($uid,$gid) = (getpwnam($user))[2,3];
481  
482 # taint check issues
483 0 $uid =~ /^(\d+)$/;
484 0 $uid = $1;
485 0 $gid =~ /^(\d+)$/;
486 0 $gid = $1;
487
488 0 ▶ unless (chown $uid,$gid,$tmp) {
Branch: 1 branch
BranchTrueFalseTotal
unless (chown $uid, $gid, $tmp) 0 0 0
489 0 $self->ownership_warning($tmp,$user);
490 }
491  
492 0 my $htdocs_i = File::Spec->catfile($self->install_path->{htdocs},'i');
493 0 my $images = File::Spec->catfile($tmp,'images');
494 0 my $htdocs = $self->install_path->{htdocs};
495 0 chown $uid,-1,$htdocs;
496 {
497 0 local $> = $uid;
498 0 symlink($images,$htdocs_i); # so symlinkifowner match works!
499 }
500 0 chown $>,-1,$self->install_path->{htdocs};
501  
502 0 my $persistent = $self->install_path->{'persistent'};
503 0 my $sessions = File::Spec->catfile($persistent,'sessions');
504 0 my $userdata = File::Spec->catfile($persistent,'userdata');
505 0 mkpath([$sessions,$userdata],0711);
506  
507 0 my $databases = $self->install_path->{'databases'};
508
509 0 ▶ unless (chown $uid,$gid,glob(File::Spec->catfile($databases,'').'*')) {
Branch: 1 branch
BranchTrueFalseTotal
unless (chown $uid, $gid, glob("File::Spec"->catfile($databases, "") . '*')) 0 0 0
510 0 $self->ownership_warning($databases,$user);
511 }
512  
513 0 chmod 0755,File::Spec->catfile($self->install_path->{'etc'},'init.d','gbrowse-slave');
514 0 chmod 0755,File::Spec->catfile($self->install_path->{'etc'},'init.d','gbrowse-aws-balancer');
515 0 $self->fix_selinux;
516  
517 0 my $base = basename($self->install_path->{htdocs});
518  
519 # Configure the databases, if needed.
520 0 print STDERR "Updating user account database...\n";
521 0 my $metadb_script = File::Spec->catfile("bin", "gbrowse_metadb_config.pl");
522 0 my $perl = $self->perl;
523 0 my @inc = map{"-I$_"} split ':',$self->added_to_INC;
524 0 system $perl,@inc,$metadb_script;
525 0 system 'sudo','chown','-R',"$uid.$gid",$sessions,$userdata;
526  
527 # make the gbrowse-aws-balancer file, which might contain secret keys, read-only to root
528 0 ▶ if ($self->config_data('installetc') =~ /^[yY]/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->config_data("installetc") =~ /^[yY]/) 0 0 0
529 0 ▶ my $install_path = $self->install_path->{'etc'} || GBrowseGuessDirectories->etc;
Condition0%0/3
$self->install_path->{'etc'} || 'GBrowseGuessDirectories'->etc
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_path->{'etc'} || 'GBrowseGuessDirectories'->etc
$self->install_path->{'etc'} 'GBrowseGuessDirectories'->etc
Truth table0%0/3
A || B
A= $self->install_path->{'etc'}B= 'GBrowseGuessDirectories'->etc
ABresult
1X1
011
000
530 0 system 'sudo','chmod','go-rwx',File::Spec->catfile($install_path,'default','gbrowse-aws-balancer');
531 }
532  
533 0 ▶ if (Module::Build->y_n(
Branch: 1 branch
BranchTrueFalseTotal
if ("Module::Build"->y_n("It is recommended that you restart Apache. Shall I try this for you?", "y")) 0 0 0
534 "It is recommended that you restart Apache. Shall I try this for you?",'y'
535 )) {
536 0 system "sudo /etc/init.d/apache2 restart";
537 }
538
539 0 print STDERR "\n***INSTALLATION COMPLETE***\n";
540 0 print STDERR "Load http://localhost/$base for demo and documentation.\n";
541 0 print STDERR "Visit the http://gmod.org for more information on setting up databases for users and custom tracks.\n";
542 }
543  
544 sub ACTION_install_slave {
545 0 ▶ my $self = shift;
Subroutine ACTION_install_slave: not called CC=4 SCAR=30.0
Pod undocumented
546 0 ▶ my $prefix = $self->install_base || $self->prefix ||'';
Condition0%0/5
$self->install_base || $self->prefix || ''
l!l
00
$self->install_base or $self->prefix
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_base || $self->prefix || ''
$self->install_base $self->prefix
Truth table0%0/3
A or B
A= $self->install_baseB= $self->prefix
ABresult
1X1
011
000
547 0 GBrowseGuessDirectories->prefix($prefix);
548 0 ▶ $self->install_path->{'etc'} ||= GBrowseGuessDirectories->etc;
Condition0%0/3
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
$self->install_path->{"etc"} "GBrowseGuessDirectories"->etc
Truth table0%0/3
A ||= B
A= $self->install_path->{"etc"}B= "GBrowseGuessDirectories"->etc
ABresult
1X1
011
000
549 0 $self->SUPER::ACTION_install();
550 }
551  
552 sub ACTION_debian {
553 0 ▶ my $self = shift;
Subroutine ACTION_debian: not called CC=1 SCAR=6.9
Pod undocumented
554 0 system "debuild";
555 }
556  
557 sub fix_selinux {
558 0 ▶ my $self = shift;
Subroutine fix_selinux: not called CC=6 SCAR=37.4
Pod undocumented
559 0 ▶ return unless -e '/proc/filesystems';
Branch: 1 branch
BranchTrueFalseTotal
unless -e "/proc/filesystems" 0 0 0
560 0 ▶ my $f = IO::File->new('/proc/filesystems') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $f = "IO::File"->new("/proc/filesystems") or return 0 0 0
561 0 ▶ return unless grep /selinux/i,<$f>;
Branch: 1 branch
BranchTrueFalseTotal
unless grep /selinux/i, readline $f 0 0 0
562  
563 0 ▶ my $enabled = IO::File->new('/selinux/enforce') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $enabled = "IO::File"->new("/selinux/enforce") or return 0 0 0
564 0 ▶ return unless grep /1/,<$enabled>;
Branch: 1 branch
BranchTrueFalseTotal
unless grep /1/, readline $enabled 0 0 0
565  
566 0 print STDERR "\n*** SELinux detected -- fixing permissions ***\n";
567  
568 0 my $htdocs = $self->config_data('htdocs');
569 0 my $conf = $self->config_data('conf');
570 0 my $tmp = $self->config_data('tmp');
571 0 my $db = $self->config_data('databases');
572 0 system "/usr/bin/chcon -R -t httpd_sys_content_t $conf";
573 0 system "/usr/bin/chcon -R -t httpd_sys_content_t $htdocs";
574 0 system "/usr/bin/chcon -R -t httpd_sys_content_rw_t $tmp";
575 0 system "/usr/bin/chcon -R -t httpd_sys_content_rw_t $db";
576 }
577  
578 sub process_conf_files {
579 1 ▶ my $self = shift;
Subroutine process_conf_files: called CC=8 SCAR=23.4
Pod undocumented
580 1 my $f = IO::File->new('MANIFEST');
581  
582 1 ▶ my $prefix = $self->install_base || $self->prefix || '';
Condition40%2/5
$self->install_base || $self->prefix || ''
l!l
01
$self->install_base or $self->prefix
l!l&&r!l&&!r
001
MC/DC0%0/2
$self->install_base || $self->prefix || ''
$self->install_base $self->prefix
Truth table33%1/3
A or B
A= $self->install_baseB= $self->prefix
ABresult
1X1
011
000
583 1 GBrowseGuessDirectories->prefix($prefix);
584 1 ▶ my $install_path = $self->config_data('conf') || GBrowseGuessDirectories->conf;
Condition33%1/3
$self->config_data('conf') || 'GBrowseGuessDirectories'->conf
l!l&&r!l&&!r
100
MC/DC0%0/2
$self->config_data('conf') || 'GBrowseGuessDirectories'->conf
$self->config_data('conf') 'GBrowseGuessDirectories'->conf
Truth table33%1/3
A || B
A= $self->config_data('conf')B= 'GBrowseGuessDirectories'->conf
ABresult
1X1
011
000
585  
586 1 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 695 1 696
587 695 ▶ next unless m!^conf/!;
Branch: 1 branch
BranchTrueFalseTotal
unless m[^conf/] 624 71 695
588 71 chomp;
589 71 my $base = $_;
590  
591 71 my $copied = $self->copy_if_modified($_=>'blib');
592 71 ▶ if ($copied || !$self->up_to_date('_build/config_data',"blib/$_")) {
Branch: 1 branch
BranchTrueFalseTotal
if ($copied or not $self->up_to_date("_build/config_data", "blib/$_")) 0 71 71
Condition33%1/3
$copied or not $self->up_to_date("_build/config_data", "blib/$_")
l!l&&r!l&&!r
0071
MC/DC0%0/2
$copied or not $self->up_to_date("_build/config_data", "blib/$_")
$copied not $self->up_to_date("_build/config_data", "blib/$_")
Truth table33%1/3
A or not(B)
A= $copiedB= not $self->up_to_date("_build/config_data", "blib/$_")
ABresult
1X1
011
000
593 0 $self->substitute_in_place("blib/$_");
594 0 $self->check_installed($install_path,$base);
595 }
596 }
597  
598 }
599  
600 sub check_installed {
601 0 ▶ my $self = shift;
Subroutine check_installed: not called CC=13 SCAR=52.0
Pod undocumented
602 0 my ($install_path,$blib_file) = @_;
603 0 ▶ my $skip = $self->{skip} ||= IO::File->new('>>INSTALL.SKIP') or die "INSTALL.SKIP: $!";
Branch: 1 branch
BranchTrueFalseTotal
my $skip = ($self->{"skip"} ||= "IO::File"->new(">>INSTALL.SKIP")) or die "INSTALL.SKIP: $!" 0 0 0
Condition0%0/3
$self->{"skip"} ||= "IO::File"->new(">>INSTALL.SKIP")
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"skip"} ||= "IO::File"->new(">>INSTALL.SKIP")
$self->{"skip"} "IO::File"->new(">>INSTALL.SKIP")
Truth table0%0/3
A ||= B
A= $self->{"skip"}B= "IO::File"->new(">>INSTALL.SKIP")
ABresult
1X1
011
000
604 0 (my $base = $blib_file) =~ s!^[^/]+/!!;
605 0 my $staged = File::Spec->catfile('./blib',$blib_file);
606 0 my $installed = File::Spec->catfile($install_path,$base);
607  
608 0 ▶ if (-e $installed && (compare($staged,$installed) != 0)) {
Branch: 1 branch
BranchTrueFalseTotal
if (-e $installed and compare($staged, $installed) != 0) 0 0 0
Condition0%0/3
-e $installed and compare($staged, $installed) != 0
!ll&&!rl&&r
000
MC/DC0%0/2
-e $installed and compare($staged, $installed) != 0
-e $installed compare($staged, $installed) != 0
Truth table0%0/3
A and B
A= -e $installedB= compare($staged, $installed) != 0
ABresult
0X0
100
111
609 0 my ($confirmed,$keep);
610  
611 0 ▶ if ($ENV{AUTOMATED_TESTING} || !(-t STDIN)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ENV{"AUTOMATED_TESTING"} or not -t STDIN) 0 0 0
Condition0%0/3
$ENV{"AUTOMATED_TESTING"} or not -t STDIN
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{"AUTOMATED_TESTING"} or not -t STDIN
$ENV{"AUTOMATED_TESTING"} not -t STDIN
Truth table0%0/3
A or not(B)
A= $ENV{"AUTOMATED_TESTING"}B= not -t STDIN
ABresult
1X1
011
000
612 0 $confirmed++;
613 0 $keep++;
614 }
615  
616 0 ▶ while (!$confirmed) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($confirmed) 0 0 0
617 0 print STDERR "$installed has changed. Should \"Build install\" [R]eplace with new version or [K]eep currently installed version [K]? ";
618 0 my $line = <>;
619 0 chomp($line);
620 0 ▶ $line ||= '';
Condition0%0/2
$line ||= ""
l!l
00
MC/DC0%0/1
$line ||= ""
$line
Truth table0%0/2
A
A= $line
Aresult
11
00
621 0 ▶ if ($line =~ /^[Kk]/) {
Branch: 3 branches
BranchTrueFalseTotal
if ($line =~ /^[Kk]/) { } 0 0 0
elsif ($line =~ /^[Rr]/) { } 0 0 0
elsif ($line =~ /^$/) { } 0 0 0
622 0 $keep++;
623 0 $confirmed++;
624 } elsif ($line =~ /^[Rr]/) {
625 0 $confirmed++;
626 } elsif ($line =~ /^$/) {
627 0 $keep++;
628 0 $confirmed++;
629 }
630 }
631
632 0 ▶ if ($keep) {
Branch: 1 branch
BranchTrueFalseTotal
if ($keep) { } 0 0 0
633 0 print STDERR "\"Build install\" will keep original $installed. New version can be found in ${installed}.new\n\n";
634 0 cp($staged,"${staged}.new");
635 0 print $skip '^',"blib/",quotemeta($blib_file),'$',"\n";
636 } else {
637 0 print STDERR "\"Build install\" will replace original $installed. Original version can be found in ${installed}.orig\n\n";
638 0 cp($installed,"${staged}.orig");
639 }
640 }
641 }
642  
643 sub process_htdocs_files {
644 1 ▶ my $self = shift;
Subroutine process_htdocs_files: called CC=9 SCAR=26.5
Pod undocumented
645 1 my $f = IO::File->new('MANIFEST');
646 1 ▶ my $install_path = $self->install_path->{'htdocs'} || GBrowseGuessDirectories->htdocs;
Condition33%1/3
$self->install_path->{'htdocs'} || 'GBrowseGuessDirectories'->htdocs
l!l&&r!l&&!r
010
MC/DC0%0/2
$self->install_path->{'htdocs'} || 'GBrowseGuessDirectories'->htdocs
$self->install_path->{'htdocs'} 'GBrowseGuessDirectories'->htdocs
Truth table33%1/3
A || B
A= $self->install_path->{'htdocs'}B= 'GBrowseGuessDirectories'->htdocs
ABresult
1X1
011
000
647  
648 1 my %doneit;
649 1 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 695 1 696
650 695 ▶ next unless m!^htdocs/!;
Branch: 1 branch
BranchTrueFalseTotal
unless m[^htdocs/] 340 355 695
651 355 chomp;
652 355 my $base = $_;
653 355 my $copied = $self->copy_if_modified($base=>'blib');
654 355 ▶ if ($copied or !$self->up_to_date('_build/config_data',"blib/$base")) {
Branch: 1 branch
BranchTrueFalseTotal
if ($copied or not $self->up_to_date("_build/config_data", "blib/$base")) 0 355 355
Condition33%1/3
$copied or not $self->up_to_date("_build/config_data", "blib/$base")
l!l&&r!l&&!r
00355
MC/DC0%0/2
$copied or not $self->up_to_date("_build/config_data", "blib/$base")
$copied not $self->up_to_date("_build/config_data", "blib/$base")
Truth table33%1/3
A or not(B)
A= $copiedB= not $self->up_to_date("_build/config_data", "blib/$base")
ABresult
1X1
011
000
655 0 $self->substitute_in_place("blib/$base");
656 0 ▶ $self->check_installed($install_path,$base) if $copied;
Branch: 1 branch
BranchTrueFalseTotal
if $copied 0 0 0
657 }
658 }
659  
660 # hacky thing for getting the cloud index.html right
661 1 ▶ if (eval "require Bio::Graphics::Browser2::Render::Slave::AWS_Balancer;1") {
Branch: 1 branch
BranchTrueFalseTotal
if (eval "require Bio::Graphics::Browser2::Render::Slave::AWS_Balancer;1") 1 0 1
662 1 ▶ if (Bio::Graphics::Browser2::Render::Slave::AWS_Balancer->running_as_instance) {
Branch: 1 branch
BranchTrueFalseTotal
if ("Bio::Graphics::Browser2::Render::Slave::AWS_Balancer"->running_as_instance) 0 1 1
663 0 warn "Cloud instance detected; renaming index.html";
664 0 rename "blib/htdocs/index.html","blib/htdocs/index_default.html";
665 0 rename "blib/htdocs/cloud_index.html","blib/htdocs/index.html";
666 }
667 }
668 }
669  
670 sub process_cgibin_files {
671 1 ▶ my $self = shift;
Subroutine process_cgibin_files: called CC=4 SCAR=14.1
Pod undocumented
672 1 my $f = IO::File->new('MANIFEST');
673 1 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 695 1 696
674 695 ▶ next unless m!^cgi-bin/!;
Branch: 1 branch
BranchTrueFalseTotal
unless m[^cgi-bin/] 686 9 695
675 9 chomp;
676 9 my $copied = $self->copy_if_modified($_=>'blib');
677 9 my $path = File::Spec->catfile('blib',$_);
678 9 ▶ if ($copied) {
Branch: 1 branch
BranchTrueFalseTotal
if ($copied) 0 9 9
679 0 $self->fix_shebang_line($path);
680 0 chmod 0755,$path;
681 }
682 }
683 }
684  
685 sub process_etc_files {
686 1 ▶ my $self = shift;
Subroutine process_etc_files: called CC=18 SCAR=41.9
Pod undocumented
687  
688 1 ▶ my $prefix = $self->install_base || $self->prefix || '';
Condition40%2/5
$self->install_base || $self->prefix || ''
l!l
01
$self->install_base or $self->prefix
l!l&&r!l&&!r
001
MC/DC0%0/2
$self->install_base || $self->prefix || ''
$self->install_base $self->prefix
Truth table33%1/3
A or B
A= $self->install_baseB= $self->prefix
ABresult
1X1
011
000
689 1 GBrowseGuessDirectories->prefix($prefix);
690 1 ▶ my $install_path = $self->install_path->{'etc'} || GBrowseGuessDirectories->etc;
Condition33%1/3
$self->install_path->{'etc'} || 'GBrowseGuessDirectories'->etc
l!l&&r!l&&!r
010
MC/DC0%0/2
$self->install_path->{'etc'} || 'GBrowseGuessDirectories'->etc
$self->install_path->{'etc'} 'GBrowseGuessDirectories'->etc
Truth table33%1/3
A || B
A= $self->install_path->{'etc'}B= 'GBrowseGuessDirectories'->etc
ABresult
1X1
011
000
691  
692 1 ▶ if ($self->config_data('installetc') =~ /^[yY]/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->config_data("installetc") =~ /^[yY]/) 1 0 1
693 1 my $f = IO::File->new('MANIFEST');
694 1 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 695 1 696
695 695 ▶ next unless m!^etc/!;
Branch: 1 branch
BranchTrueFalseTotal
unless m[^etc/] 691 4 695
696 4 chomp;
697  
698 4 my $base = $_;
699  
700 4 my $copied = $self->copy_if_modified($_=>'blib');
701 4 ▶ if ($copied or !$self->up_to_date('_build/config_data',"blib/$_")) {
Branch: 1 branch
BranchTrueFalseTotal
if ($copied or not $self->up_to_date("_build/config_data", "blib/$_")) 0 4 4
Condition33%1/3
$copied or not $self->up_to_date("_build/config_data", "blib/$_")
l!l&&r!l&&!r
004
MC/DC0%0/2
$copied or not $self->up_to_date("_build/config_data", "blib/$_")
$copied not $self->up_to_date("_build/config_data", "blib/$_")
Truth table33%1/3
A or not(B)
A= $copiedB= not $self->up_to_date("_build/config_data", "blib/$_")
ABresult
1X1
011
000
702 0 $self->substitute_in_place("blib/$_");
703 0 $self->check_installed($install_path,$base);
704 }
705 }
706 }
707  
708 # generate the apache config data
709 1 ▶ my $includes = GBrowseGuessDirectories->apache_includes || '';
Condition50%1/2
'GBrowseGuessDirectories'->apache_includes || ''
l!l
01
MC/DC0%0/1
'GBrowseGuessDirectories'->apache_includes || ''
'GBrowseGuessDirectories'->apache_includes
Truth table50%1/2
A
A= 'GBrowseGuessDirectories'->apache_includes
Aresult
11
00
710  
711 # the following workaround checks for perl.conf (which must load before gbrowse.conf on modperl envs)
712 # and renames the file so that it is loaded after perl.conf
713 1 ▶ my $file = -e "${includes}/perl.conf"
Branch: 1 branch
BranchTrueFalseTotal
-e "$includes/perl.conf" ? : 0 1 1
714 ? 'z_gbrowse2.conf'
715 : 'gbrowse2.conf';
716  
717 1 my $target = "blib${includes}/$file";
718 1 ▶ if ($includes && !$self->up_to_date('_build/config_data',$target)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($includes and not $self->up_to_date("_build/config_data", $target)) 0 1 1
Condition33%1/3
$includes and not $self->up_to_date("_build/config_data", $target)
!ll&&!rl&&r
100
MC/DC0%0/2
$includes and not $self->up_to_date("_build/config_data", $target)
$includes not $self->up_to_date("_build/config_data", $target)
Truth table33%1/3
A and not(B)
A= $includesB= not $self->up_to_date("_build/config_data", $target)
ABresult
0X0
100
111
719 0 ▶ if ($self->config_data('installconf') =~ /^[yY]/ && !-e "${includes}/$file") {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->config_data('installconf') =~ /^[yY]/ and not -e "$includes/$file") { } 0 0 0
Condition0%0/3
$self->config_data("installconf") =~ /^[yY]/ and not -e "$includes/$file"
!ll&&!rl&&r
000
MC/DC0%0/2
$self->config_data("installconf") =~ /^[yY]/ and not -e "$includes/$file"
$self->config_data("installconf") =~ /^[yY]/ not -e "$includes/$file"
Truth table0%0/3
A and not(B)
A= $self->config_data("installconf") =~ /^[yY]/B= not -e "$includes/$file"
ABresult
0X0
100
111
720 0 warn "Creating include file for Apache config: $target\n";
721 0 my $dir = dirname($target);
722 0 mkpath([$dir]);
723 0 ▶ if (my $f = IO::File->new("blib${includes}/$file",'>')) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $f = "IO::File"->new("blib$includes/$file", ">")) 0 0 0
724 0 $f->print($self->apache_conf);
725 0 $f->close;
726 }
727 } else {
728 0 ▶ print STDERR
Branch: 1 branch
BranchTrueFalseTotal
-e "$includes/$file" ? : 0 0 0
729 -e "${includes}/$file"
730 ? "${includes}/$file is already installed. "
731 : "Automatic Apache config disabled. ";
732 0 print STDERR "Please run ./Build apache_conf to see this file's recommended contents.\n";
733 }
734  
735 }
736 1 ▶ if (!$self->config_data('installetc') =~ /^[yY]/) {
Branch: 1 branch
BranchTrueFalseTotal
if (!$self->config_data("installetc") =~ /^[yY]/) 0 1 1
737 0 warn "Not configuring your system to run gbrowse-slave automatically. Please reconfigure with this option enabled if you wish to do this.";
738 }
739 }
740  
741 sub process_database_files {
742 1 ▶ my $self = shift;
Subroutine process_database_files: called CC=3 SCAR=11.0
Pod undocumented
743 1 my $f = IO::File->new('MANIFEST');
744 1 ▶ while (<$f>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $f)) 695 1 696
745 695 ▶ next unless m!^sample_data/!;
Branch: 1 branch
BranchTrueFalseTotal
unless m[^sample_data/] 683 12 695
746 12 chomp;
747 12 my $dest = $_; $dest =~ s|^sample_data/||;
748 12 $self->copy_if_modified(from => $_,
749 to => "blib/databases/$dest",
750 );
751 }
752 }
753  
754 sub substitute_in_place {
755 0 ▶ my $self = shift;
Subroutine substitute_in_place: not called CC=9 SCAR=45.0
Pod undocumented
756 0 my $path = shift;
757 0 ▶ return if $path =~ /\.\w+$/ && $path !~ /\.(html|txt|conf)$/;
Branch: 1 branch
BranchTrueFalseTotal
if $path =~ /\.\w+$/ and not $path =~ /\.(html|txt|conf)$/ 0 0 0
Condition0%0/3
$path =~ /\.\w+$/ and not $path =~ /\.(html|txt|conf)$/
!ll&&!rl&&r
000
MC/DC0%0/2
$path =~ /\.\w+$/ and not $path =~ /\.(html|txt|conf)$/
$path =~ /\.\w+$/ not $path =~ /\.(html|txt|conf)$/
Truth table0%0/3
A and not(B)
A= $path =~ /\.\w+$/B= not $path =~ /\.(html|txt|conf)$/
ABresult
0X0
100
111
758 0 ▶ my $in = IO::File->new($path) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $in = "IO::File"->new($path) or return 0 0 0
759 0 ▶ my $out = IO::File->new("$path.$$",'>') or return;
Branch: 1 branch
BranchTrueFalseTotal
my $out = "IO::File"->new("$path.${$}", ">") or return 0 0 0
760  
761 0 print STDERR "Performing variable substitutions in $path\n";
762  
763 0 my $htdocs = $self->config_data('htdocs');
764 0 my $conf = $self->config_data('conf');
765 0 my $cgibin = $self->config_data('cgibin');
766 0 my $persistent = $self->config_data('persistent');
767 0 my $databases = $self->config_data('databases');
768 0 my $tmp = $self->config_data('tmp');
769 0 my $wwwuser = $self->config_data('wwwuser');
770 0 ▶ my $perl5lib = $self->perl5lib || '';
Condition0%0/2
$self->perl5lib || ''
l!l
00
MC/DC0%0/1
$self->perl5lib || ''
$self->perl5lib
Truth table0%0/2
A
A= $self->perl5lib
Aresult
11
00
771 0 my $installscript = $self->install_destination('script');
772 0 ▶ my $etc = $self->install_path->{'etc'} ||= GBrowseGuessDirectories->etc;
Condition0%0/3
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->install_path->{"etc"} ||= "GBrowseGuessDirectories"->etc
$self->install_path->{"etc"} "GBrowseGuessDirectories"->etc
Truth table0%0/3
A ||= B
A= $self->install_path->{"etc"}B= "GBrowseGuessDirectories"->etc
ABresult
1X1
011
000
773 0 my $cgiurl = $self->cgiurl;
774  
775 0 ▶ $persistent ||= $databases;
Condition0%0/3
$persistent ||= $databases
l!l&&r!l&&!r
000
MC/DC0%0/2
$persistent ||= $databases
$persistent $databases
Truth table0%0/3
A ||= B
A= $persistentB= $databases
ABresult
1X1
011
000
776  
777 0 ▶ while (<$in>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $in)) 0 0 0
778 0 s/\$INSTALLSCRIPT\b/$installscript/g;
779 0 s/\$ETC\b/$etc/g;
780 0 s/\$PERL5LIB\b/$perl5lib/g;
781 0 s/\$HTDOCS\b/$htdocs/g;
782 0 s/\$CONF\b/$conf/g;
783 0 s/\$CGIBIN\b/$cgibin/g;
784 0 s/\$CGIURL\b/$cgiurl/g;
785 0 s/\$WWWUSER\b/$wwwuser/g;
786 0 s/\$DATABASES\b/$databases/g;
787 0 s/\$PERSISTENT\b/$persistent/g;
788 0 s/\$VERSION\b/$self->dist_version/eg;
789 0 s/\$CAN_USER_ACCOUNTS_OPENID\b/$self->has_openid/eg;
790 0 s/\$CAN_USER_ACCOUNTS_REG\b/$self->has_smtp/eg;
791 0 s/\$CAN_USER_ACCOUNTS\b/$self->has_mysql_or_sqlite/eg;
792 0 s/\$USER_ACCOUNT_DB\b/$self->guess_user_account_db/eg;
793 0 s/\$SMTP_GATEWAY\b/$self->guess_smtp_gateway/eg;
794 0 s/\$TMP\b/$tmp/g;
795 0 $out->print($_);
796 }
797 0 $in->close;
798 0 $out->close;
799 0 rename("$path.$$",$path);
800 }
801  
802 sub has_mysql_or_sqlite {
803 0 ▶ my $self = shift;
Subroutine has_mysql_or_sqlite: not called CC=3 SCAR=24.8
Pod undocumented
804 0 ▶ return eval "require DBD::mysql; 1" || eval "require DBD::SQLite; 1" || 0;
Condition0%0/5
eval 'require DBD::mysql; 1' || eval 'require DBD::SQLite; 1' || 0
l!l
00
eval "require DBD::mysql; 1" or eval "require DBD::SQLite; 1"
l!l&&r!l&&!r
000
MC/DC0%0/2
eval 'require DBD::mysql; 1' || eval 'require DBD::SQLite; 1' || 0
eval "require DBD::mysql; 1" eval "require DBD::SQLite; 1"
Truth table0%0/3
A or B
A= eval "require DBD::mysql; 1"B= eval "require DBD::SQLite; 1"
ABresult
1X1
011
000
805 }
806  
807 sub has_smtp {
808 0 ▶ my $self = shift;
Subroutine has_smtp: not called CC=2 SCAR=17.9
Pod undocumented
809 0 ▶ return eval "require Net::SMTP; 1" || 0;
Condition0%0/2
eval 'require Net::SMTP; 1' || 0
l!l
00
MC/DC0%0/1
eval 'require Net::SMTP; 1' || 0
eval 'require Net::SMTP; 1'
Truth table0%0/2
A
A= eval 'require Net::SMTP; 1'
Aresult
11
00
810 }
811  
812 sub has_openid {
813 0 ▶ my $self = shift;
Subroutine has_openid: not called CC=2 SCAR=17.9
Pod undocumented
814 0 ▶ return eval "require Net::OpenID::Consumer; require LWP::UserAgent; 1" || 0;
Condition0%0/2
eval 'require Net::OpenID::Consumer; require LWP::UserAgent; 1' || 0
l!l
00
MC/DC0%0/1
eval 'require Net::OpenID::Consumer; require LWP::UserAgent; 1' || 0
eval 'require Net::OpenID::Consumer; require LWP::UserAgent; 1'
Truth table0%0/2
A
A= eval 'require Net::OpenID::Consumer; require LWP::UserAgent; 1'
Aresult
11
00
815 }
816  
817 sub guess_user_account_db {
818 0 ▶ my $self = shift;
Subroutine guess_user_account_db: not called CC=3 SCAR=24.8
Pod undocumented
819 0 ▶ if (eval "require DBD::SQLite; 1") {
Branch: 2 branches
BranchTrueFalseTotal
if (eval 'require DBD::SQLite; 1') { } 0 0 0
elsif (eval 'require DBD::mysql; 1') { } 0 0 0
820 0 my $databases = $self->config_data('databases');
821 0 return "DBI:SQLite:$databases/users.sqlite";
822 } elsif (eval "require DBD::mysql; 1") {
823 0 return 'DBI:mysql:gbrowse_login;user=gbrowse;password=gbrowse';
824 } else {
825 0 return "no database defined # please correct this";
826 }
827 }
828  
829 sub guess_smtp_gateway {
830 0 ▶ my $self = shift;
Subroutine guess_smtp_gateway: not called CC=1 SCAR=6.9
Pod undocumented
831 0 return 'localhost # this assumes that a correctly configured smtp server is running on current machine; change if necessary';
832 }
833  
834 sub private_props {
835 0 ▶ return \%OK_PROPS;
Subroutine private_props: not called CC=1 SCAR=6.9
Pod undocumented
836 }
837  
838 sub valid_property {
839 20 ▶ my $self = shift;
Subroutine valid_property: called CC=2 SCAR=7.0
Pod undocumented
840 20 my $prop = shift;
841 20 ▶ return $OK_PROPS{$prop} || $self->SUPER::valid_property($prop);
Condition66%2/3
$OK_PROPS{$prop} || $self->SUPER::valid_property($prop)
l!l&&r!l&&!r
0812
MC/DC50%1/2
$OK_PROPS{$prop} || $self->SUPER::valid_property($prop)
$OK_PROPS{$prop} $self->SUPER::valid_property($prop)
Truth table66%2/3
A || B
A= $OK_PROPS{$prop}B= $self->SUPER::valid_property($prop)
ABresult
1X1
011
000
842 }
843  
844 sub httpd_conf {
845 0 ▶ my $self = shift;
Subroutine httpd_conf: not called CC=2 SCAR=17.9
Pod undocumented
846 0 my ($dir,$port) = @_;
847  
848 0 ▶ my $modules = $self->config_data('apachemodules')
Condition0%0/3
$self->config_data('apachemodules') || 'GBrowseGuessDirectories'->apachemodules
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->config_data('apachemodules') || 'GBrowseGuessDirectories'->apachemodules
$self->config_data('apachemodules') 'GBrowseGuessDirectories'->apachemodules
Truth table0%0/3
A || B
A= $self->config_data('apachemodules')B= 'GBrowseGuessDirectories'->apachemodules
ABresult
1X1
011
000
849 || GBrowseGuessDirectories->apachemodules;
850  
851 0 my $user = $>;
852 0 my ($group) = $) =~ /^(\d+)/;
853  
854 0 return <<END;
855 ServerName "localhost"
856 ServerRoot "$dir/conf"
857 LockFile "$dir/locks/accept.lock"
858 PidFile "$dir/logs/apache2.pid"
859 ErrorLog "$dir/logs/error.log"
860 LogFormat "%h %l %u %t \\"%r\\" %>s %b" common
861 CustomLog "$dir/logs/access.log" common
862 LogLevel warn
863 User #$user
864 Group #$group
865  
866 Timeout 300
867 KeepAlive On
868 MaxKeepAliveRequests 100
869 KeepAliveTimeout 15
870 DefaultType text/plain
871 HostnameLookups Off
872  
873 <IfModule so_module>
874  
875 <IfModule !log_config_module>
876 LoadModule log_config_module $modules/mod_log_config.so
877 </IfModule>
878  
879 <IfModule !cgid_module>
880 LoadModule cgid_module $modules/mod_cgid.so
881 ScriptSock "$dir/logs/cgisock"
882 </IfModule>
883  
884 <IfModule !authz_host_module>
885 LoadModule authz_host_module $modules/mod_authz_host.so
886 </IfModule>
887  
888 <IfModule !env_module>
889 LoadModule env_module $modules/mod_env.so
890 </IfModule>
891  
892 <IfModule !alias_module>
893 LoadModule alias_module $modules/mod_alias.so
894 </IfModule>
895  
896 <IfModule !dir_module>
897 LoadModule dir_module $modules/mod_dir.so
898 </IfModule>
899  
900 <IfModule !mime_module>
901 LoadModule mime_module $modules/mod_mime.so
902 </IfModule>
903  
904 </IfModule>
905  
906 TypesConfig "$dir/conf/mime.types"
907  
908 Listen $port
909 Include "$dir/conf/apache_gbrowse.conf"
910 END
911 }
912  
913 sub gbrowse_demo_conf {
914 0 ▶ my $self = shift;
Subroutine gbrowse_demo_conf: not called CC=2 SCAR=17.9
Pod undocumented
915 0 my ($port,$dir) = @_;
916 0 my $blib = File::Spec->catfile($self->base_dir(),$self->blib);
917 0 my $inc = "$blib/lib:$blib/arch";
918 0 my $more = $self->added_to_INC;
919 0 ▶ $inc .= ":$more" if $more;
Branch: 1 branch
BranchTrueFalseTotal
if $more 0 0 0
920  
921 0 return <<END;
922 NameVirtualHost *:$port
923 <VirtualHost *:$port>
924 ServerAdmin webmaster\@localhost
925 Alias "/i/" "$dir/tmp/images/"
926 ScriptAlias "/cgi-bin/" "$dir/cgi-bin/"
927
928 DocumentRoot $dir/htdocs/
929 <Directory />
930 Options FollowSymLinks
931 AllowOverride None
932 </Directory>
933 <Directory $dir/htdocs/>
934 Options Indexes FollowSymLinks MultiViews
935 AllowOverride None
936 Order allow,deny
937 allow from all
938 </Directory>
939  
940 <Directory "$dir/cgi-bin/">
941 SetEnv PERL5LIB $inc
942 SetEnv GBROWSE_MASTER GBrowse.conf
943 SetEnv GBROWSE_CONF $dir/conf
944 SetEnv GBROWSE_DOCS $dir/htdocs
945 SetEnv GBROWSE_ROOT /
946 AllowOverride None
947 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
948 Order allow,deny
949 Allow from all
950 </Directory>
951 </VirtualHost>
952 END
953 }
954  
955 sub mime_conf {
956 0 ▶ my $self = shift;
Subroutine mime_conf: not called CC=1 SCAR=6.9
Pod undocumented
957 0 return <<END;
958 image/gif gif
959 image/jpeg jpeg jpg jpe
960 image/png png
961 image/svg+xml svg svgz
962 text/css css
963 text/html html htm shtml
964 END
965 }
966  
967 sub config_done {
968 1 ▶ my $self = shift;
Subroutine config_done: called CC=3 SCAR=11.3
Pod undocumented
969 1 my $done = $self->config_data('config_done');
970 1 ▶ $self->config_data(config_done=>shift) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 1 1
971 1 ▶ warn "NOTE: Run ./Build reconfig to change existing configuration.\n" if $done;
Branch: 1 branch
BranchTrueFalseTotal
if $done 1 0 1
972 1 return $done;
973 }
974  
975 sub registration_done {
976 0 ▶ my $self = shift;
Subroutine registration_done: not called CC=2 SCAR=17.9
Pod undocumented
977 0 my $done = $self->config_data('registration_done');
978 0 ▶ $self->config_data(registration_done=>shift) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
979 0 return $done;
980 }
981  
982 sub added_to_INC {
983 0 ▶ my $self = shift;
Subroutine added_to_INC: not called CC=4 SCAR=30.0
Pod undocumented
984 0 my @inc = grep {!/install_util/} eval {$self->_added_to_INC}; # not in published API
985 0 my $lib_base = $self->install_destination('lib');
986 0 my $arch_base = $self->install_destination('arch');
987 0 my %standard = map {$_=>1} @INC;
988 0 ▶ push @inc,$lib_base unless $standard{$lib_base};
Branch: 1 branch
BranchTrueFalseTotal
unless $standard{$lib_base} 0 0 0
989 0 ▶ push @inc,$arch_base unless $standard{$arch_base};
Branch: 1 branch
BranchTrueFalseTotal
unless $standard{$arch_base} 0 0 0
990 0 ▶ return @inc ? join(':',@inc) : '';
Branch: 1 branch
BranchTrueFalseTotal
@inc ? : 0 0 0
991 }
992  
993 sub perl5lib {
994 0 ▶ my $self = shift;
Subroutine perl5lib: not called CC=1 SCAR=6.9
Pod undocumented
995 0 return $self->added_to_INC or undef;
996 }
997  
998 sub scriptdir {
999 0 ▶ my $self = shift;
Subroutine scriptdir: not called CC=4 SCAR=30.0
Pod undocumented
1000 0 my $id = $self->installdirs;
1001 0 ▶ my $scriptdir = $id eq 'core' ? 'installscript'
Branch: 3 branches
BranchTrueFalseTotal
$id eq 'core' ? : 0 0 0
$id eq 'site' ? : 0 0 0
$id eq 'vendor' ? : 0 0 0
1002 :$id eq 'site' ? 'installsitebin'
1003 :$id eq 'vendor' ? 'installvendorbin'
1004 :'installsitebin';
1005 0 return $Config::Config{$scriptdir};
1006 }
1007  
1008 sub ownership_warning {
1009 0 ▶ my $self = shift;
Subroutine ownership_warning: not called CC=1 SCAR=6.9
Pod undocumented
1010 0 my ($path,$owner) = @_;
1011 0 warn "*** WARNING: Using sudo to change ownership of $path to '$owner'. You may be prompted for your login password ***\n";
1012 0 system "sudo chown -R $owner $path";
1013 }
1014  
1015 sub cgiurl {
1016 0 ▶ my $self = shift;
Subroutine cgiurl: not called CC=1 SCAR=6.9
Pod undocumented
1017 0 my $cgibin = $self->config_data('cgibin');
1018 0 (my $cgiurl = $cgibin) =~ s!^.+/cgi-bin!/cgi-bin!;
1019 0 $cgiurl =~ s!^.+/CGI-Executables!/cgi-bin!; #Macs and their crazy paths
1020 0 return $cgiurl;
1021 }
1022  
1023 sub check_prereq {
1024 0 ▶ my $self = shift;
Subroutine check_prereq: not called CC=2 SCAR=17.9
Pod undocumented
1025 0 my $result = $self->SUPER::check_prereq(@_);
1026 0 ▶ unless ($result) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($result) 0 0 0
1027 0 $self->log_warn(<<END);
1028 * Do not worry if some "recommended" prerequisites are missing. You can install *
1029 * them later if you need the features they provide. Do not proceed with the *
1030 * install if any of "REQUIRED" prerequisites are missing. *
1031 * *
1032 * The optional Safe::World module does not currently run on Perl 5.10 or *
1033 * higher, and so cannot be installed. *
1034  
1035 END
1036 }
1037 0 return $result;
1038 }
1039  
1040 0 ▶sub asString { return 'GBrowse installer' }
Subroutine asString: not called CC=1 SCAR=6.9
Pod undocumented
1041  
1042 2 1;
1043  
1044 __END__
« blib/conf/plugins/GeneFinder.pm ↑ Summary blib/lib/Bio/Graphics/Browser2/DataLoader/generic.pm »