From dc82862df05cc9db02ef403288acb689d4578651 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 15 Oct 2017 00:47:23 +0000 Subject: add install/available keys to JSON output, deal with unavailable packages git-svn-id: svn://tug.org/texlive/trunk@45543 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPOBJ.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Master/tlpkg/TeXLive/TLPOBJ.pm') diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 3e603bc99a3..95c5adeffbf 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -422,6 +422,7 @@ sub writeout_simple { sub as_json { my $self = shift; + my %addargs = @_; require JSON; #my $json = JSON::PP->new->utf8; my %foo = %{$self}; @@ -441,6 +442,10 @@ sub as_json { $foo{'relocated'} = $JSON::false; } } + # set the additional args + for my $k (keys %addargs) { + $foo{$k} = $addargs{$k}; + } my $utf8_encoded_json_text = JSON::encode_json(\%foo); # $json->encode(\%foo); return $utf8_encoded_json_text; } -- cgit v1.2.3