summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-10-15 00:47:23 +0000
committerNorbert Preining <preining@logic.at>2017-10-15 00:47:23 +0000
commitdc82862df05cc9db02ef403288acb689d4578651 (patch)
treeb42a6f0dcaad2316c187fde2ccbd7707131a3b34 /Master/texmf-dist
parent3d992315224b02439b839e29204a9090fc42f6b4 (diff)
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
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 7dd33fd6d0d..9354d9f8658 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -3617,11 +3617,15 @@ sub show_one_package_json {
my $is_installed = (defined($loctlp) ? 1 : 0);
my $is_available = (defined($remtlp) ? 1 : 0);
if (!($is_installed || $is_available)) {
- tlwarn("$prg: package $p not found neither locally nor remote!\n");
- return($F_WARNING);
+ # output proper JSON for unavailable packages
+ print "{ \"name\":\"$p\", \"available\":false }\n";
+ #tlwarn("$prg: package $p not found neither locally nor remote!\n");
+ #return($F_WARNING);
+ return($F_OK);
}
my $tlp = ($is_installed ? $loctlp : $remtlp);
- my $str = $tlp->as_json();
+ my $str = $tlp->as_json(available => ($is_available ? $JSON::true : $JSON::false),
+ installed => ($is_installed ? $JSON::true : $JSON::false));
print $str, "\n";
return($F_OK);
}