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..199bee27 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 ); @@ -41,7 +40,7 @@ sub _make_man { my $input = "$Bin/../doc/$name.md"; my $man_dir = "$target/man/man$section"; - mkpath($man_dir); + mkpath($man_dir) or die "Failed to create directory $man_dir: $!"; my $output = "$man_dir/$name.$section"; if ( $translator eq 'pandoc' ) { @@ -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,18 +66,20 @@ sub _make_man { '-M', "section:$section", $input, '-o', $output, - ); + ) == 0 or die "Failed to run lowdown: $!"; } } sub _make_lib_man_links { my $target = shift; - my $header = read_file("$Bin/../include/maxminddb.h"); + my $header = read_file("$Bin/../include/maxminddb.h") + or die "Failed to read header file: $!"; for my $proto ( $header =~ /^ *extern.+?(MMDB_\w+)\(/gsm ) { - open my $fh, '>', "$target/man/man3/$proto.3"; + open my $fh, '>', "$target/man/man3/$proto.3" + or die "Failed to open file: $!"; print {$fh} ".so man3/libmaxminddb.3\n"; - close $fh; + close $fh or die "Failed to close file: $!"; } } @@ -92,8 +93,8 @@ sub _pandoc_postprocess { s/^\.IP\n\.nf/.IP "" 4\n.nf/gm; s/(Automatically generated by Pandoc)(.+)$/$1/m; }, - $file - ); + $file, + ) or die "Failed to edit file: $!"; } main(shift);