Explorar el Código

Annotate the one shell dispatch, and declare three missing prereqs

bin/favicon_mongler.pl:52 was the only system/exec/qx/backtick anywhere in
bin/ or lib/, and logicLAB::ProhibitShellDispatch wants it gone.  There is
nothing to replace it with: Imager has no SVG reader, and Image::LibRSVG --
the only Perl binding to a rasterizer -- was last released in 2006.  So the
script keeps driving inkscape and says why in a no-critic annotation, rather
than laundering the same subprocess through an IPC module to quiet the linter.

While on that line, the die reported $!, which is errno and says nothing about
a child that ran and exited non-zero.  It now reports $! only for the -1
"never started" case and the exit status otherwise.  The inkscape -e flag is
left alone: e23b678 changed it to -o and 5f0cdca deliberately put it back.

Makefile.PL gains File::Which, Sys::Hostname::FQDN and Ref::Util, all used by
code in the tree but never declared.

Trog::Log::DBI imported Capture::Tiny's capture_merged and never called it.

Also fixes three files that went from tidy to untidy in 694e318 -- dropping
'= ()' from @extra_series left stale alignment padding on the line above it in
migrate2/3, and migrate6 wanted a blank line before an added comment block.
The remaining untidiness in Log/DBI.pm predates this branch and is left alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJ2NAMQyytncwHKSmD5dFe
George Baugh hace 1 mes
padre
commit
40cdbccabb
Se han modificado 6 ficheros con 12 adiciones y 5 borrados
  1. 3 0
      Makefile.PL
  2. 5 1
      bin/favicon_mongler.pl
  3. 1 1
      bin/migrate2.pl
  4. 1 1
      bin/migrate3.pl
  5. 1 0
      bin/migrate6.pl
  6. 1 2
      lib/Trog/Log/DBI.pm

+ 3 - 0
Makefile.PL

@@ -37,6 +37,7 @@ WriteMakefile(
     'File::Slurper::Temp'    => '0',
     'File::Touch'            => '0',
     'File::Path'             => '0',
+    'File::Which'            => '0',
     'HTML::SocialMeta'       => '0',
     'HTTP::Body'             => '0',
     'IO::String'             => '0',
@@ -45,9 +46,11 @@ WriteMakefile(
     'JSON::MaybeXS'          => '0',
     'JSON::Validator::Schema::Troglodyne' => '0',
     'Sys::Virt'              => '0',
+    'Sys::Hostname::FQDN'    => '0',
     'List::Util'             => '0',
     'Mojo::File'             => '0',
     'POSIX'                  => '0',
+    'Ref::Util'              => '0',
     'Pod::Html'              => '0',
     'Starman'                => '0',
     'Text::Xslate'           => '0',

+ 5 - 1
bin/favicon_mongler.pl

@@ -49,7 +49,11 @@ my %files = (
 foreach my $size ( sort { $b <=> $a } keys(%files) ) {
     print "*** Generating ${size}x${size} .$files{$size} now... ***\n";
     my @cmd = ( $bin, '-w', $size, '-h', $size, $icon, '-e', "$dir/favicon-$size.$files{$size}" );
-    system(@cmd) && die "Failed to run @cmd: $!";
+
+    # There is no maintained Perl SVG rasterizer to bind instead -- Imager has
+    # no SVG reader, and Image::LibRSVG was last released in 2006 -- so driving
+    # the renderer as a subprocess is the only option here.
+    system(@cmd) and die "Failed to run @cmd: " . ( $? == -1 ? $! : 'exit status ' . ( $? >> 8 ) );    ## no critic (logicLAB::ProhibitShellDispatch)
     print "*** Wrote $dir/favicon-$size.$files{$size} ***\n\n";
 }
 

+ 1 - 1
bin/migrate2.pl

@@ -57,7 +57,7 @@ $ENV{NOHUP} = 1;
 sub uuid { return UUID::Tiny::create_uuid_as_string( UUID::Tiny::UUID_V1, UUID::Tiny::UUID_NS_DNS ); }
 
 # Modify these variables to suit your installation.
-my $user         = 'george';
+my $user = 'george';
 my @extra_series;
 
 my $conf        = Trog::Config::get();

+ 1 - 1
bin/migrate3.pl

@@ -54,7 +54,7 @@ $ENV{NOHUP} = 1;
 sub uuid { return UUID::Tiny::create_uuid_as_string( UUID::Tiny::UUID_V1, UUID::Tiny::UUID_NS_DNS ); }
 
 # Modify these variables to suit your installation.
-my $user         = 'george';
+my $user = 'george';
 my @extra_series;
 
 my $conf        = Trog::Config::get();

+ 1 - 0
bin/migrate6.pl

@@ -83,6 +83,7 @@ while ( my $entry = readdir $dh ) {
 
     print "Writing changes to $fname\n";
     my $encoded = JSON::MaybeXS::encode_json($decoded);
+
     # Temp:: rather than plain File::Slurper -- it writes to a tempfile and
     # renames over the target, so a crash partway can't leave a half written
     # post behind.

+ 1 - 2
lib/Trog/Log/DBI.pm

@@ -5,8 +5,7 @@ use re '/aa';
 
 use parent qw{Log::Dispatch::DBI};
 
-use Ref::Util     qw{is_arrayref};
-use Capture::Tiny qw{capture_merged};
+use Ref::Util qw{is_arrayref};
 
 use POSIX           qw{mktime};
 use POSIX::strptime qw{strptime};