summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-10-16 13:30:51 +0000
committerNorbert Preining <preining@logic.at>2017-10-16 13:30:51 +0000
commit7897147d3438f4a13492c780041c65ac7723184d (patch)
treed9a97850bc19e34bb9e63932aaded9b6b47dfe03 /Master/tlpkg/TeXLive
parent0fc3099d15c927418f2c91d42485cb7a619a2b2f (diff)
more adjustments for json output
git-svn-id: svn://tug.org/texlive/trunk@45546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 95c5adeffbf..1530c1a06c8 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -426,8 +426,16 @@ sub as_json {
require JSON;
#my $json = JSON::PP->new->utf8;
my %foo = %{$self};
+ # set the additional args
+ for my $k (keys %addargs) {
+ if (defined($addargs{$k})) {
+ $foo{$k} = $addargs{$k};
+ } else {
+ delete($foo{$k});
+ }
+ }
# make sure numbers are encoded as numbers
- for my $k (qw/revision runsize docsize srcsize containersize
+ for my $k (qw/revision runsize docsize srcsize containersize lrev rrev
srccontainersize doccontainersize runcontainersize/) {
$foo{$k} += 0 if exists($foo{$k});
}
@@ -442,10 +450,6 @@ 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;
}