xmltv/grab/huro tv_grab_huro.in,1.59,1.60
Nick Morrott <[email protected]> Mon, 06 Mar 2017 14:33:41 +0000
| Newsgroups | gmane.comp.tv.xmltv.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/xmltv/xmltv/grab/huro
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26750/grab/huro
Modified Files:
tv_grab_huro.in
Log Message:
Do not hardcode usage of JSON::XS when depending on JSON
tv_grab_huro declares a runtime dependency on JSON, but hardcodes calls to
JSON::XS in the actual code. JSON::XS is not declared as a build-time dependency
so there is not guarantee is will be installed.
Therefore, we declare a build-time dependency on JSON and change calls to use
the JSON wrapper, which will use either JSON::PP or JSON::XS if available.
Index: tv_grab_huro.in
===================================================================
RCS file: /cvsroot/xmltv/xmltv/grab/huro/tv_grab_huro.in,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** tv_grab_huro.in 24 Jan 2017 00:44:44 -0000 1.59
--- tv_grab_huro.in 6 Mar 2017 14:33:39 -0000 1.60
***************
*** 783,787 ****
$data =~ s/<\/?span[^>]{0,}>\s?//g; # remove html elements
! $json_data = (($DEFAULT_ENCODING !~ /utf\-?8/i) && ($COUNTRY eq 'hu')) ? JSON::XS->new->utf8(0)->decode(encode($DEFAULT_ENCODING,decode('utf-8', $data))) : JSON::XS->new->utf8(0)->decode($data) or
die "could not fetch/parse $url (json structure)\n";
worker("base-parsing");
--- 783,787 ----
$data =~ s/<\/?span[^>]{0,}>\s?//g; # remove html elements
! $json_data = (($DEFAULT_ENCODING !~ /utf\-?8/i) && ($COUNTRY eq 'hu')) ? JSON->new->utf8(0)->decode(encode($DEFAULT_ENCODING,decode('utf-8', $data))) : JSON->new->utf8(0)->decode($data) or
die "could not fetch/parse $url (json structure)\n";
worker("base-parsing");
***************
*** 1237,1241 ****
binmode(STDOUT,":encoding(UTF-8)");
my $data = get_nice($url);
! my $json_data = (($DEFAULT_ENCODING !~ /utf\-?8/i) && ($COUNTRY eq 'hu')) ? JSON::XS->new->utf8(0)->decode(encode($DEFAULT_ENCODING,decode('utf-8', $data))) : JSON::XS->new->utf8(0)->decode($data) or
die "could not fetch/parse $url (channel listing)";
worker("base-parsing");
--- 1237,1241 ----
binmode(STDOUT,":encoding(UTF-8)");
my $data = get_nice($url);
! my $json_data = (($DEFAULT_ENCODING !~ /utf\-?8/i) && ($COUNTRY eq 'hu')) ? JSON->new->utf8(0)->decode(encode($DEFAULT_ENCODING,decode('utf-8', $data))) : JSON->new->utf8(0)->decode($data) or
die "could not fetch/parse $url (channel listing)";
worker("base-parsing");
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot