From 3a0ab7edef5505980b0d6f522eb7171ce6f86cb8 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 9 Dec 2024 07:54:00 -0800 Subject: [PATCH] Do not use autodie in script This reduced the dependencies. See #359. --- Changes.md | 3 +++ dev-bin/make-man-pages.pl | 15 ++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Changes.md b/Changes.md index 773e52e0..73d039fd 100644 --- a/Changes.md +++ b/Changes.md @@ -9,6 +9,9 @@ pkillarjun. GitHub #357. * Updated `cmake_minimum_required` to a version range to quiet deprecation warnings on new CMake versions. Reported by gmou3. GitHub #359. +* The script for generating man pages no longer uses `autodie`. This + eliminates the dependency on `IPC::System::Simple`. Reported by gmou3. + GitHub #359. ## 1.11.0 - 2024-08-21 diff --git a/dev-bin/make-man-pages.pl b/dev-bin/make-man-pages.pl index d7c29f7b..2b6fc853 100755 --- a/dev-bin/make-man-pages.pl +++ b/dev-bin/make-man-pages.pl @@ -2,7 +2,6 @@ use strict; use warnings; -use autodie qw( :all ); use FindBin qw( $Bin ); @@ -54,7 +53,7 @@ sub _make_man { '-M', "section:$section", $input, '-o', $output, - ); + ) == 0 or die "Failed to run pandoc: $!"; _pandoc_postprocess($output); } elsif ( $translator eq 'lowdown' ) { @@ -67,7 +66,7 @@ sub _make_man { '-M', "section:$section", $input, '-o', $output, - ); + ) == 0 or die "Failed to run lowdown: $!"; } } @@ -76,9 +75,11 @@ sub _make_lib_man_links { my $header = read_file("$Bin/../include/maxminddb.h"); for my $proto ( $header =~ /^ *extern.+?(MMDB_\w+)\(/gsm ) { - open my $fh, '>', "$target/man/man3/$proto.3"; - print {$fh} ".so man3/libmaxminddb.3\n"; - close $fh; + open my $fh, '>', "$target/man/man3/$proto.3" + or die "Failed to open file: $!"; + print {$fh} ".so man3/libmaxminddb.3\n" + or die "Failed to write to file: $!"; + close $fh or die "Failed to close file: $!"; } } @@ -92,7 +93,7 @@ sub _pandoc_postprocess { s/^\.IP\n\.nf/.IP "" 4\n.nf/gm; s/(Automatically generated by Pandoc)(.+)$/$1/m; }, - $file + $file, ); }