From: Karen Etheridge Date: Sat, 6 Dec 2014 04:00:33 +0000 (-0800) Subject: prevent version incompatibilities leading to "JSON::XS::Boolean::* redefined" warnings X-Git-Tag: v1.003003~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FJSON-MaybeXS.git;a=commitdiff_plain;h=14a1801c39c7505f9464fc94255a333dee07bdc8 prevent version incompatibilities leading to "JSON::XS::Boolean::* redefined" warnings --- diff --git a/Changes b/Changes index b49c56c..b4cb2fb 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,8 @@ Revision history for JSON-MaybeXS - ensure an old Cpanel::JSON::XS is upgraded if it is too old, as it will always be used in preference to JSON::XS + - avoid "JSON::XS::Boolean::* redefined" warnings caused by an old JSON::XS + loaded at the same time as a newer Cpanel::JSON::XS 1.003002 - 2014-11-16 - correctly fix boolean interoperability with older Cpanel::JSON::MaybeXS diff --git a/Makefile.PL b/Makefile.PL index f316895..b18aa4b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -77,6 +77,19 @@ $WriteMakefileArgs{PREREQ_PM}{'Cpanel::JSON::XS'} = '2.3310' and ((eval { require Cpanel::JSON::XS; 1 } and not eval { Cpanel::JSON::XS->VERSION('2.3310'); 1 }) or (not eval { require JSON::XS; 1; } and can_xs())); +# avoid "JSON::XS::Boolean::* redefined" warnings caused by incompatibilities +# between JSON::XS 2.x and 3.0 -- +# if JSON::XS is installed and < 3.0 +# and Cpanel::JSON::JSON is (or is about to be) >= 3.0, +# then update JSON::XS to eliminate the incompatibility +$WriteMakefileArgs{PREREQ_PM}{'JSON::XS'} = '3.00' + if not parse_args()->{PUREPERL_ONLY} + and eval { require JSON::XS; 1 } and not eval { JSON::XS->VERSION('3.0'); 1 } + and (eval { require Cpanel::JSON::XS; Cpanel::JSON::XS->VERSION('3.0'); 1 } + # we presume here that if we are installing Cpanel::JSON::XS, we + # are installing the latest version + or exists $WriteMakefileArgs{PREREQ_PM}{'Cpanel::JSON::XS'}); + $WriteMakefileArgs{MIN_PERL_VERSION} = delete $WriteMakefileArgs{PREREQ_PM}{perl} || 0; die 'attention developer: you need to do a sane meta merge here!'