diff options
author | mkanat%bugzilla.org <> | 2006-08-01 07:34:20 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-08-01 07:34:20 +0200 |
commit | e3cf843de60425b0ea8c8ff57a576c468d61b9bd (patch) | |
tree | f59aa5b2c1a2ef1d7b50a43e037fc39f9f114cf5 /Bugzilla/Install | |
parent | e47049d74ad1dc7ee5c54336756b9c30bae16cf4 (diff) | |
download | bugzilla-e3cf843de60425b0ea8c8ff57a576c468d61b9bd.tar.gz bugzilla-e3cf843de60425b0ea8c8ff57a576c468d61b9bd.tar.xz |
Bug 346594: Move GraphViz check into Bugzilla::Install::Requirements
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=myk
Diffstat (limited to 'Bugzilla/Install')
-rw-r--r-- | Bugzilla/Install/Requirements.pm | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index c5342966a..e521f6e11 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -31,6 +31,7 @@ our @EXPORT = qw( MOD_PERL_MODULES check_requirements + check_graphviz have_vers vers_cmp install_command @@ -347,6 +348,36 @@ sub check_requirements { } +sub check_graphviz { + my ($output) = @_; + + return 1 if (Bugzilla->params->{'webdotbase'} =~ /^https?:/); + + printf("Checking for %15s %-9s ", "GraphViz", "(any)") if $output; + + my $return = 0; + if(-x Bugzilla->params->{'webdotbase'}) { + print "ok: found\n" if $output; + $return = 1; + } else { + print "not a valid executable: " . Bugzilla->params->{'webdotbase'} . "\n"; + } + + my $webdotdir = bz_locations()->{'webdotdir'}; + # Check .htaccess allows access to generated images + if (-e "$webdotdir/.htaccess") { + my $htaccess = new IO::File("$webdotdir/.htaccess", 'r') + || die "$webdotdir/.htaccess: " . $!; + if (!grep(/png/, $htaccess->getlines)) { + print "Dependency graph images are not accessible.\n"; + print "delete $webdotdir/.htaccess and re-run checksetup.pl to fix.\n"; + } + $htaccess->close; + } + + return $return; +} + # This was originally clipped from the libnet Makefile.PL, adapted here to # use the below vers_cmp routine for accurate version checking. @@ -499,6 +530,16 @@ represent the name of the module and the version that we require. C<optional> - Which optional modules are installed and up-to-date enough for Bugzilla. +=item C<check_graphviz($output)> + +Description: Checks if the graphviz binary specified in the + C<webdotbase> parameter is a valid binary, or a valid URL. + +Params: C<$output> - C<$true> if you want the function to + print out information about what it's doing. + +Returns: C<1> if the check was successful, C<0> otherwise. + =item C<vers_cmp($a, $b)> Description: This is a comparison function, like you would use in |