From 3c7b00789f138ae6b16ffca8678914bb8b49e03e Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:37:26 +0800 Subject: [PATCH] awk refuses to use a2p (#524) * My Linux system has perl 5.32.1, and I installed App::a2p under it using cpanm * Now my system has /usr/local/bin/a2p command available * I built a newer version of perl; now one perl has App::a2p and the other doesn't * This version of awk does not use App::a2p, it only runs the command a2p * The SANITY check was not sane in my case because both perls are able to run a2p, but the awk wrapper refuses on one perl because of App::a2p check * Delete the SANITY code; there is already a check if a2p failed to run so this is good enough * Also remove the too-helpful error check for long options; users will still see "unknown flag" error which unambiguously states that the option can't be used --- bin/awk | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bin/awk b/bin/awk index cf9623c1..a139b968 100755 --- a/bin/awk +++ b/bin/awk @@ -17,12 +17,6 @@ License: perl use strict; -SANITY: { - my $external_module = 'App::a2p'; - my $rc = eval "require $external_module; $external_module->import; 1"; - die "This program needs the $external_module module.\n" unless $rc; - } - my( $program, # the code to eval $tmpin, # the files a2p reads @@ -81,11 +75,6 @@ while (@ARGV) { push(@nargs, $_); last; } - elsif (s/^-//) { - if (length) { usage("Long options not supported") } - shift; - next; - } else { usage("unknown flag: -$_"); }