From f1bf017b592e77ed30588c47c6cdb66da2463c2e Mon Sep 17 00:00:00 2001 From: vfilippov Date: Mon, 20 Dec 2010 17:58:19 +0000 Subject: [PATCH] Bug 73031 - fix install git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1184 6955db30-a419-402b-8a0d-67ecbb4d7f56 --- Bugzilla/Install/Requirements.pm | 1 + contrib/autoinstall-patch | 31 +++++++++++++++++++++++++++++++ extensions/custis/custis.pl | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 contrib/autoinstall-patch diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 73e570769..a2b1fd6d1 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -496,6 +496,7 @@ sub print_module_instructions { sub _translate_feature { my $features = shift; + $features = [$features] if !ref $features; my @strings; foreach my $feature (@$features) { push(@strings, install_string("feature_$feature")); diff --git a/contrib/autoinstall-patch b/contrib/autoinstall-patch new file mode 100644 index 000000000..06db6b75c --- /dev/null +++ b/contrib/autoinstall-patch @@ -0,0 +1,31 @@ +Add the following to beginning of checksetup.pl: + +BEGIN { $SIG{__DIE__} = sub { + my ($a) = @_; + if ($a =~ /Can\'t locate (\S*).pm in/) + { + my $i = 0; + my @c; + while (@c = caller($i++)) + { + if ($c[3] =~ /\(eval\)/) + { + die @_; + } + } + my $fn = $1.'.pm'; + my $m = $1; + $m =~ s/\//::/gso; + print "Perl module '$m' is needed to run Bugzilla. Install it from CPAN? (Y/n) "; + my $k = ; + if ($k || $k =~ /y|^\s*$/iso) + { + system("cpan '$m'"); + exec("perl '$0' '".join("','", @ARGV)."'"); + } + else + { + die @_; + } + } +}; } diff --git a/extensions/custis/custis.pl b/extensions/custis/custis.pl index 404668f08..7800a768d 100644 --- a/extensions/custis/custis.pl +++ b/extensions/custis/custis.pl @@ -23,6 +23,11 @@ my $OPTIONAL_MODULES = version => '0.1', feature => 'Import of OOXML Excel files (*.xlsx)', }, + { + package => 'Net-IP-Match-XS', + module => 'Net::IP::Match::XS', + feature => 'FOF-Sudo system-to-system authorization', + }, ]; required_modules('custis', $REQUIRED_MODULES);