From 014dc8595070533eb7a14771e98640f74037ff78 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 14 May 2015 15:47:04 +0100 Subject: Bug 1164863: backport upstream bug 1163248 to bmo to remove dependency on File::Slurp for checksetup.pl --- Bugzilla/Install/Requirements.pm | 12 ++++++++---- template/en/default/setup/strings.txt.pl | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index fe66b581b..e5a76bc83 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -27,9 +27,8 @@ use strict; use version; use Bugzilla::Constants; -use Bugzilla::Install::Util qw(vers_cmp install_string bin_loc - extension_requirement_packages); -use File::Slurp; +use Bugzilla::Install::Util qw(vers_cmp install_string bin_loc + success extension_requirement_packages); use List::Util qw(max); use Safe; use Term::ANSIColor; @@ -42,6 +41,7 @@ BEGIN { } use base qw(Exporter); +use autodie; our @EXPORT = qw( REQUIRED_MODULES OPTIONAL_MODULES @@ -831,7 +831,11 @@ sub export_cpanfile { } # Write out the cpanfile to the document root - write_file(bz_locations()->{'libpath'} . '/cpanfile', \$cpanfile); + my $file = bz_locations()->{'libpath'} . '/cpanfile'; + open(my $fh, '>', $file); + print $fh $cpanfile; + close $fh; + success(install_string('cpanfile_created', { file => $file })); } 1; diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index 103a2a3f5..257e30f9e 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -66,6 +66,7 @@ EOT Re-run checksetup.pl in interactive mode (without an 'answers' file) to continue. END + cpanfile_created => "##file## created", cpan_bugzilla_home => "WARNING: Using the Bugzilla directory as the CPAN home.", db_enum_setup => "Setting up choices for standard drop-down fields:", -- cgit v1.2.3-24-g4f1b