diff options
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index eb0ed19d3e9..febca48d334 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -169,7 +169,7 @@ my %action_specification = ( "function" => \&action_conf }, "dump-tlpdb" => { - "options" => { "local" => 1, remote => 1 }, + "options" => { local => 1, remote => 1, json => 1 }, "run-post" => 0, "function" => \&action_dumptlpdb }, @@ -1378,14 +1378,22 @@ sub action_dumptlpdb { $::machinereadable = 1; if ($opts{"local"} && !$opts{"remote"}) { - # for consistency we write out the location of the installation, - # too, in the same format as when dumping the remote tlpdb - print "location-url\t", $localtlpdb->root, "\n"; - $localtlpdb->writeout; + if ($opts{"json"}) { + print $localtlpdb->as_json; + } else { + # for consistency we write out the location of the installation, + # too, in the same format as when dumping the remote tlpdb + print "location-url\t", $localtlpdb->root, "\n"; + $localtlpdb->writeout; + } } elsif ($opts{"remote"} && !$opts{"local"}) { - init_tlmedia_or_die(); - $remotetlpdb->writeout; + init_tlmedia_or_die(1); + if ($opts{"json"}) { + print $remotetlpdb->as_json; + } else { + $remotetlpdb->writeout; + } } else { tlwarn("$prg dump-tlpdb: need exactly one of --local and --remote.\n"); |