From a3be3fcce9c99055c4e1c01108d277de5c81db85 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Jan 2021 10:02:10 +0100 Subject: [PATCH] Bug 24272: Use Pod2Usage and surround values with '' Signed-off-by: Jonathan Druart (cherry picked from commit b1915293441b7f61d0e61c6b7dd105de1bbd5d8e) Signed-off-by: Fridolin Somers (cherry picked from commit 1601911977dc427e11428190bf62f416023c381b) Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit 3cdc534a398eb24ccd113a55abd19d2c58ca1a01) Signed-off-by: Victor Grousset/tuxayo --- misc/maintenance/check_syspref_cache.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/misc/maintenance/check_syspref_cache.pl b/misc/maintenance/check_syspref_cache.pl index ac60081389..3de4b27f78 100755 --- a/misc/maintenance/check_syspref_cache.pl +++ b/misc/maintenance/check_syspref_cache.pl @@ -16,6 +16,8 @@ # along with Koha; if not, see . use Modern::Perl; +use Getopt::Long; +use Pod::Usage; use Koha::Script; use Koha::Caches; @@ -36,6 +38,14 @@ Catch data inconsistencies in cached sysprefs vs those in the database =cut +my ( $help, $man ); +GetOptions( + 'help|?' => \$help, + 'man' => \$man, +); + +pod2usage(1) if $help; +pod2usage( -verbose => 2 ) if $man; my $syspref_cache = Koha::Caches->get_instance('syspref'); my $prefs = Koha::Config::SysPrefs->search(); @@ -44,5 +54,6 @@ while (my $pref = $prefs->next) { my $var = lc $pref->variable; my $cached_var = $syspref_cache->get_from_cache("syspref_$var"); next unless defined $cached_var; #If not defined in cache we will fetch from DB so this case is OK - print "$var: value in cache is $cached_var and value in db is ".$pref->value,"\n" unless $cached_var eq $pref->value; + say sprintf( "%s: value in cache is '%s' and value in db is '%s'", $var, $cached_var, $pref->value ) + unless $cached_var eq $pref->value; } -- 2.39.5