Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #420 (mh_release.pl errors out on decode_json) #463

Merged
merged 4 commits into from Sep 10, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/common/mh_release.pl
Expand Up @@ -19,7 +19,7 @@

=cut

use JSON qw( decode_json );
use JSON::PP (); # Do not import any functions as it could conflict with the JSON imported functions from other locations in the code

# noloop=start
my $mhdl_url = "https://api.github.com/repos/hollie/misterhouse/tags";
Expand Down Expand Up @@ -102,7 +102,7 @@ sub calc_age {
if (done_now $p_mhdl_page) {
my @html = file_read($mhdl_file);
print_log("Download page retrieved");
my $json = decode_json( @html );
my $json = JSON::PP::decode_json( @html ); # Use the PP version of the call as otherwise this function fails at least on OS X 10.9.4 with Perl 5.18.2
my ($mhdl_date_url, $maj, $min);
foreach (@{$json}) {
next unless $_->{name} =~ m/^v(\d+)\.(\d+)/;
Expand All @@ -129,7 +129,7 @@ sub calc_age {
if (done_now $p_mhdl_date_page) {
my @html = file_read($mhdl_date_file);
print_log("Download date page retrieved");
my $json = decode_json( @html );
my $json = JSON::PP::decode_json( @html );
$Save{mhdl_date} = $json->{commit}{author}{date};
if (defined $Save{mhdl_maj} and defined $Save{mhdl_min}) {
my ($maj,$min,$version_str) = &parse_version();
Expand Down