summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2017-03-23 21:11:41 +0100
committerDan Fandrich <dan@coneharvesters.com>2017-03-23 21:11:41 +0100
commitae22034d0d711881b0cbf1e8be3090cad486bb97 (patch)
tree689da4fdf88eb62f10d3d68b0d2606fd0f3d1eb9
parentf355a92cd5b117c71d8626efc1be280bb28037a2 (diff)
downloadcurl-ae22034d0d711881b0cbf1e8be3090cad486bb97.tar.gz
mkhelp: disable compression if the perl gzip module is unavailable
This is nowadays included with the base perl distribution, but wasn't prior to about perl 5.14
-rw-r--r--src/mkhelp.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mkhelp.pl b/src/mkhelp.pl
index 8b7f72157..4b540744c 100644
--- a/src/mkhelp.pl
+++ b/src/mkhelp.pl
@@ -113,8 +113,19 @@ print <<HEAD
HEAD
;
if($c) {
- # if compressed
- use IO::Compress::Gzip;
+ # If compression requested, check that the Gzip module is available
+ # or else disable compression
+ $c = eval
+ {
+ require IO::Compress::Gzip;
+ IO::Compress::Gzip->import();
+ 1;
+ };
+ print STDERR "Warning: compression requested but Gzip is not available\n" if (!$c)
+}
+
+if($c)
+{
my $content = join("", @out);
my $gzippedContent;
IO::Compress::Gzip::gzip(