summaryrefslogtreecommitdiff
path: root/Master/tlpkg/doc/JSON-formats.txt
blob: 3447a819f4d77b15b8a3b09cf60061aef105187f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
$Id$
(This file public domain.)

JSON formats for the various outputs of tlmgr
=============================================

Fields guaranteed to be present are marked with a *

TLPOBJ
------
JSON object with key/values according to the underlying structure with a few
exception (docfiles and docfiledata are merged). Details:

* String type:
  *name, shortdesc, longdesc, *category, catalogue, containerchecksum,
  srccontainerchecksum, doccontainerchecksum
  Example: "name": "12many"

* Number type:
  *revision, runsize, docsize, srcsize, containersize, srccontainersize, doccontainersize
  Example: "revision": 12345

* Boolean type:
  available, installed, relocated
  Example: "relocated": false

* Array type (with the sub-type in parenthesis):
  - of String type: runfiles, srcfiles, executes, depends, postactions
    Example: "runfiles": [ "texmf-dist/...", "texmf-dist/...file2" ]
  - of Object type:
    . docfiles: keys: *file, language, details (all Strings)
      Example:
        [ { "file": "docfile1", "lang": "en" }, { "file": "docfile2", "detail": "readme file" } ]

* Object type:
  - binfiles: keys are architecture names, values are arrays of strings (list of binfiles)
    Example: { "x86_64-linux": [ "binfile1", "binfile2", ... ], "win32": [ "binfile3" ] }
  - binsize: keys are architecture names, values are numbers
    Example: { "x86_64-linux": 1233, "win32": 333 }
  - cataloguedata: keys are topics, version, license, ctan, date, related (all strings)
    Example: { "topics": "graphic", "version": "1.23" }


Note: A minimal TLPOBJ might look like
{
  "name": "minimal",
  "category": "Package",
  "revision": 12345
}



TLPOBJINFO
----------
This JSON format is dumped on tlmgr info --data json and is slightly different
format compared to TLPOBJ above:

Removed fields: revision
Added fields:
- Number type: lrev, rrev -- local and remote revision of the package
- Boolean type: available (available at repository), installed


TLPDBSINGLE
-----------
JSON object with the following fields:
* Object type:
  - options: keys are the tlmgr names of %TLConfig::TLPDBOptions, that is
    . Number type: autobackup, fileassocs
    . Boolean type: formats, desktop_integration, generate_updmap, docfiles, 
                    srcfiles, postcode, w32_multi_user
    . String type: backupdir, location, sys_bin, sys_info, sys_man
    . Object type: repository: keys are tags, values are Strings
       if there is only one location then the tag is "main"
    Example:
      "options": {
        "autobackup": 2,
        "formats": false,
        "postcode": true,
        "backupdir": "/backup/tl",
        "repository": {
          "main": "http://mirror.ctan.org/systems/texlive/tlnet",
          "tlcontrib": "..."
        }
      }

  - settings: keys are the names of %TLConfig::TLPDBSettings, that is
    . Boolean type: usertree
    . String type: platform
    . Array type: available_architectures (Strings)

  - configs: keys are the names of %TLConfig::TLPDBConfigs, that is
    . Boolean type: container_split_src_files, container_split_doc_files
    . String type: container_format, minrelease, release

* Array type:
  - tlpkgs: JSON array of TLPOBJs in JSON format


TLPDB
-----
This format is used when dumping tlpdb, local or remote
JSON object with the following fields:
keys are tags, values are tlpdb in TLPDBSINGLE format
Example:
{
  "main": {
    "options": {...},
    "tlpkgs": [...]
  },
  "tlcontrib": {
    "option": {...},
    "tlpkgs": [...]
  }
}

TLBACKUP
--------
This format is used when dumping available backups via the
tlmgr restore action.
JSON array of JSON objects, one per available backup.
Each backup has keys: name, rev, date (all strings).
Example:
[
   {
      "date" : "2017-10-30 11:04",
      "name" : "uplatex",
      "rev" : "45414"
   },
   {
      "date" : "2017-09-28 10:50",
      "name" : "uplatex",
      "rev" : "45141"
   }
]


TLPAPER
-------
array of objects, each one having three keys: program, file, options.
`program' gives the program name, `file' the place where the configuration
has been found, and `options' is an array of strings with the first 
one being the currently selected paper.
Example for one element of the array:
   {
      "options" : [
         "a4",
         "letter"
      ],
      "file" : "/usr/local/texlive/2017/texmf-config/tex/generic/config/pdftexconfig.tex",
      "program" : "pdftex"
   }


TLOPTIONS
---------
one object with keys are the option names and values are as follows:
- String for options: sys_bin, sys_info, sys_man, backupdir
- Boolean: install_srcfiles, install_docfiles, generate_updmap, 
           w32_multi_user, desktop_integration, create_formats, post_code
- Number: file_assocs, autobackup
- Object: location: keys are tags, values are URLs (Strings)
Example:
{
   "sys_bin" : "/usr/local/bin",
   "sys_info" : "/usr/local/share/info",
   "sys_man" : "/usr/local/share/man",
   "file_assocs" : 1,
   "location" : {
      "main" : "/home/norbert/public_html/tlnet",
      "tlcritical" : "/home/norbert/public_html/tlcritical",
   },
   "autobackup" : 1,
   "install_srcfiles" : true,
   "post_code" : true,
   "create_formats" : true,
   "backupdir" : "tlpkg/backups",
   "w32_multi_user" : true,
   "desktop_integration" : true,
   "generate_updmap" : false,
   "install_docfiles" : true
}


TODO
  UPDATE JSON format