From 5748f80c058974017d895151b6e782a49505c29d Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 15 Aug 2020 16:36:57 +0300 Subject: [PATCH] refactor: remove unused imports --- fortune-mod/fortune/gen-strfile-manpage.pl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fortune-mod/fortune/gen-strfile-manpage.pl b/fortune-mod/fortune/gen-strfile-manpage.pl index f9fc669..432e8f8 100644 --- a/fortune-mod/fortune/gen-strfile-manpage.pl +++ b/fortune-mod/fortune/gen-strfile-manpage.pl @@ -4,9 +4,8 @@ use strict; use warnings; use autodie; -use File::Basename qw / dirname /; -use File::Path qw / mkpath /; use Getopt::Long qw/ GetOptions /; +use Path::Tiny qw/ path tempdir tempfile cwd /; my $output_fn; my $cookiedir; @@ -21,13 +20,12 @@ GetOptions( '--output=s' => \$output_fn, ) or die "Wrong options - $!"; +die "missing --src-dir" if ( not $CMAKE_CURRENT_SOURCE_DIR ); system( qw# docmake manpages #, "${CMAKE_CURRENT_SOURCE_DIR}/util/strfile.docbook5.xml" ) and die "system failed"; -use Path::Tiny qw/ path tempdir tempfile cwd /; - path("${CMAKE_CURRENT_SOURCE_DIR}/util/strfile.man") ->spew_utf8( - path("./strfile.1")->slurp_utf8() =~ s#^\s+(\.RE|\.PP)\s*$#$1#gmsr =~ + cwd()->child("strfile.1")->slurp_utf8() =~ s#^\s+(\.RE|\.PP)\s*$#$1#gmsr =~ s#^\s+$##gmsr ); -- 2.40.0