From 5117611c2471660b7db8b4c4c00b20c3d3a58a11 Mon Sep 17 00:00:00 2001 From: Henry Cox Date: Mon, 6 Jan 2025 13:40:51 -0500 Subject: [PATCH] Remove explicit JSON dependency in favor of ordered preference list. Signed-off-by: Henry Cox --- scripts/criteria | 8 ++++++-- scripts/criteria.pm | 1 - scripts/threshold.pm | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/criteria b/scripts/criteria index bcc0e17..b1d75cf 100755 --- a/scripts/criteria +++ b/scripts/criteria @@ -42,7 +42,11 @@ use FindBin; use Getopt::Long; use lib "$FindBin::RealBin"; use criteria qw(new); -use JSON; + +use lib "$FindBin::RealBin/../lib"; +use lib "$FindBin::RealBin/../../../lib"; # path from 'support-scripts' + +use lcovutil; my $obj = criteria->new($0, @ARGV); @@ -54,7 +58,7 @@ if (!defined($obj) || return undef; } my $json = pop(@ARGV); -my $db = decode_json($json); +my $db = JsonSupport::decode($json); my ($status, $msgs) = $obj->check_criteria(@ARGV, $db); foreach my $m (@$msgs) { diff --git a/scripts/criteria.pm b/scripts/criteria.pm index 0474637..dc7088a 100644 --- a/scripts/criteria.pm +++ b/scripts/criteria.pm @@ -39,7 +39,6 @@ package criteria; use strict; -use JSON; use Getopt::Long qw(GetOptionsFromArray); our @ISA = qw(Exporter); diff --git a/scripts/threshold.pm b/scripts/threshold.pm index 3a1b233..793f403 100644 --- a/scripts/threshold.pm +++ b/scripts/threshold.pm @@ -48,7 +48,6 @@ package threshold; use strict; -use JSON; use Getopt::Long qw(GetOptionsFromArray); use Scalar::Util qw/looks_like_number/;