commit:     d9691f1d5dd9a126804102572ac812d9c8a4ee16
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 30 18:26:34 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 30 18:27:44 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9691f1d

gstreamer-meson.eclass: fix handling meson-1.5's pretty-printed JSON

meson-1.5 pretty-prints its JSON which means the target JSON file here
spawns multiple lines. <$x> will only read one line, per
https://github.com/makamaka/JSON-PP/issues/85#issuecomment-1367719155.

Switch to reading the whole file like in https://stackoverflow.com/a/24959863.

Cloess: https://bugs.gentoo.org/935245
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/gstreamer-meson.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/gstreamer-meson.eclass b/eclass/gstreamer-meson.eclass
index a26b06ba4595..937c86a0f15b 100644
--- a/eclass/gstreamer-meson.eclass
+++ b/eclass/gstreamer-meson.eclass
@@ -393,7 +393,7 @@ use utf8;
 use JSON::PP;
 
 open(my $targets_file, '<:encoding(UTF-8)', 'meson-info/intro-targets.json') 
|| die $!;
-my $data = decode_json <$targets_file>;
+my $data = decode_json (join '', <$targets_file>);
 close($targets_file) || die $!;
 
 if(!$ARGV[0]) {

Reply via email to