OLD | NEW |
1 | 1 |
2 XZ Utils | 2 XZ Utils |
3 ======== | 3 ======== |
4 | 4 |
5 0. Overview | 5 0. Overview |
6 1. Documentation | 6 1. Documentation |
7 1.1. Overall documentation | 7 1.1. Overall documentation |
8 1.2. Documentation for command line tools | 8 1.2. Documentation for command-line tools |
9 1.3. Documentation for liblzma | 9 1.3. Documentation for liblzma |
10 2. Version numbering | 10 2. Version numbering |
11 3. Reporting bugs | 11 3. Reporting bugs |
12 4. Translating the xz tool | 12 4. Translating the xz tool |
13 5. Other implementations of the .xz format | 13 5. Other implementations of the .xz format |
14 6. Contact information | 14 6. Contact information |
15 | 15 |
16 | 16 |
17 0. Overview | 17 0. Overview |
18 ----------- | 18 ----------- |
19 | 19 |
20 XZ Utils provide a general-purpose data compression library and | 20 XZ Utils provide a general-purpose data-compression library plus |
21 command line tools. The native file format is the .xz format, but | 21 command-line tools. The native file format is the .xz format, but |
22 also the legacy .lzma format is supported. The .xz format supports | 22 also the legacy .lzma format is supported. The .xz format supports |
23 multiple compression algorithms, which are called "filters" in | 23 multiple compression algorithms, which are called "filters" in the |
24 context of XZ Utils. The primary filter is currently LZMA2. With | 24 context of XZ Utils. The primary filter is currently LZMA2. With |
25 typical files, XZ Utils create about 30 % smaller files than gzip. | 25 typical files, XZ Utils create about 30 % smaller files than gzip. |
26 | 26 |
27 To ease adapting support for the .xz format into existing applications | 27 To ease adapting support for the .xz format into existing applications |
28 and scripts, the API of liblzma is somewhat similar to the API of the | 28 and scripts, the API of liblzma is somewhat similar to the API of the |
29 popular zlib library. For the same reason, the command line tool xz | 29 popular zlib library. For the same reason, the command-line tool xz |
30 has similar command line syntax than that of gzip. | 30 has a command-line syntax similar to that of gzip. |
31 | 31 |
32 When aiming for the highest compression ratio, LZMA2 encoder uses | 32 When aiming for the highest compression ratio, the LZMA2 encoder uses |
33 a lot of CPU time and may use, depending on the settings, even | 33 a lot of CPU time and may use, depending on the settings, even |
34 hundreds of megabytes of RAM. However, in fast modes, LZMA2 encoder | 34 hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder |
35 competes with bzip2 in compression speed, RAM usage, and compression | 35 competes with bzip2 in compression speed, RAM usage, and compression |
36 ratio. | 36 ratio. |
37 | 37 |
38 LZMA2 is reasonably fast to decompress. It is a little slower than | 38 LZMA2 is reasonably fast to decompress. It is a little slower than |
39 gzip, but a lot faster than bzip2. Being fast to decompress means | 39 gzip, but a lot faster than bzip2. Being fast to decompress means |
40 that the .xz format is especially nice when the same file will be | 40 that the .xz format is especially nice when the same file will be |
41 decompressed very many times (usually on different computers), which | 41 decompressed very many times (usually on different computers), which |
42 is the case e.g. when distributing software packages. In such | 42 is the case e.g. when distributing software packages. In such |
43 situations, it's not too bad if the compression takes some time, | 43 situations, it's not too bad if the compression takes some time, |
44 since that needs to be done only once to benefit many people. | 44 since that needs to be done only once to benefit many people. |
45 | 45 |
46 With some file types, combining (or "chaining") LZMA2 with an | 46 With some file types, combining (or "chaining") LZMA2 with an |
47 additional filter can improve compression ratio. A filter chain may | 47 additional filter can improve the compression ratio. A filter chain may |
48 contain up to four filters, although usually only one two is used. | 48 contain up to four filters, although usually only one or two are used. |
49 For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 | 49 For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 |
50 in the filter chain can improve compression ratio of executable files. | 50 in the filter chain can improve compression ratio of executable files. |
51 | 51 |
52 Since the .xz format allows adding new filter IDs, it is possible that | 52 Since the .xz format allows adding new filter IDs, it is possible that |
53 some day there will be a filter that is, for example, much faster to | 53 some day there will be a filter that is, for example, much faster to |
54 compress than LZMA2 (but probably with worse compression ratio). | 54 compress than LZMA2 (but probably with worse compression ratio). |
55 Similarly, it is possible that some day there is a filter that will | 55 Similarly, it is possible that some day there is a filter that will |
56 compress better than LZMA2. | 56 compress better than LZMA2. |
57 | 57 |
58 XZ Utils doesn't support multithreaded compression or decompression | 58 XZ Utils doesn't support multithreaded compression or decompression |
(...skipping 22 matching lines...) Expand all Loading... |
81 THANKS Incomplete list of people who have helped making | 81 THANKS Incomplete list of people who have helped making |
82 this software | 82 this software |
83 NEWS User-visible changes between XZ Utils releases | 83 NEWS User-visible changes between XZ Utils releases |
84 ChangeLog Detailed list of changes (commit log) | 84 ChangeLog Detailed list of changes (commit log) |
85 TODO Known bugs and some sort of to-do list | 85 TODO Known bugs and some sort of to-do list |
86 | 86 |
87 Note that only some of the above files are included in binary | 87 Note that only some of the above files are included in binary |
88 packages. | 88 packages. |
89 | 89 |
90 | 90 |
91 1.2. Documentation for command line tools | 91 1.2. Documentation for command-line tools |
92 | 92 |
93 The command line tools are documented as man pages. In source code | 93 The command-line tools are documented as man pages. In source code |
94 releases (and possibly also in some binary packages), the man pages | 94 releases (and possibly also in some binary packages), the man pages |
95 are also provided in plain text (ASCII only) and PDF formats in the | 95 are also provided in plain text (ASCII only) and PDF formats in the |
96 directory "doc/man" to make the man pages more accessible to those | 96 directory "doc/man" to make the man pages more accessible to those |
97 whose operating system doesn't provide an easy way to view man pages. | 97 whose operating system doesn't provide an easy way to view man pages. |
98 | 98 |
99 | 99 |
100 1.3. Documentation for liblzma | 100 1.3. Documentation for liblzma |
101 | 101 |
102 The liblzma API headers include short docs about each function | 102 The liblzma API headers include short docs about each function |
103 and data type as Doxygen tags. These docs should be quite OK as | 103 and data type as Doxygen tags. These docs should be quite OK as |
104 a quick reference. | 104 a quick reference. |
105 | 105 |
106 I have planned to write a bunch of very well documented example | 106 I have planned to write a bunch of very well documented example |
107 programs, which (due to comments) should work as a tutorial to | 107 programs, which (due to comments) should work as a tutorial to |
108 various features of liblzma. No such example programs have been | 108 various features of liblzma. No such example programs have been |
109 written yet. | 109 written yet. |
110 | 110 |
111 For now, if you have never used liblzma, libbzip2, or zlib, I | 111 For now, if you have never used liblzma, libbzip2, or zlib, I |
112 recommend learning *basics* of zlib API. Once you know that, it | 112 recommend learning the *basics* of the zlib API. Once you know that, |
113 should be easier to learn liblzma. | 113 it should be easier to learn liblzma. |
114 | 114 |
115 http://zlib.net/manual.html | 115 http://zlib.net/manual.html |
116 http://zlib.net/zlib_how.html | 116 http://zlib.net/zlib_how.html |
117 | 117 |
118 | 118 |
119 2. Version numbering | 119 2. Version numbering |
120 -------------------- | 120 -------------------- |
121 | 121 |
122 The version number format of XZ Utils is X.Y.ZS: | 122 The version number format of XZ Utils is X.Y.ZS: |
123 | 123 |
124 - X is the major version. When this is incremented, the library | 124 - X is the major version. When this is incremented, the library |
125 API and ABI break. | 125 API and ABI break. |
126 | 126 |
127 - Y is the minor version. It is incremented when new features are | 127 - Y is the minor version. It is incremented when new features |
128 added without breaking existing API or ABI. Even Y indicates | 128 are added without breaking the existing API or ABI. An even Y |
129 stable release and odd Y indicates unstable (alpha or beta | 129 indicates a stable release and an odd Y indicates unstable |
130 version). | 130 (alpha or beta version). |
131 | 131 |
132 - Z is the revision. This has different meaning for stable and | 132 - Z is the revision. This has a different meaning for stable and |
133 unstable releases: | 133 unstable releases: |
| 134 |
134 * Stable: Z is incremented when bugs get fixed without adding | 135 * Stable: Z is incremented when bugs get fixed without adding |
135 any new features. | 136 any new features. This is intended to be convenient for |
| 137 downstream distributors that want bug fixes but don't want |
| 138 any new features to minimize the risk of introducing new bugs. |
| 139 |
136 * Unstable: Z is just a counter. API or ABI of features added | 140 * Unstable: Z is just a counter. API or ABI of features added |
137 in earlier unstable releases having the same X.Y may break. | 141 in earlier unstable releases having the same X.Y may break. |
138 | 142 |
139 - S indicates stability of the release. It is missing from the | 143 - S indicates stability of the release. It is missing from the |
140 stable releases where Y is an even number. When Y is odd, S | 144 stable releases, where Y is an even number. When Y is odd, S |
141 is either "alpha" or "beta" to make it very clear that such | 145 is either "alpha" or "beta" to make it very clear that such |
142 versions are not stable releases. The same X.Y.Z combination is | 146 versions are not stable releases. The same X.Y.Z combination is |
143 not used for more than one stability level i.e. after X.Y.Zalpha, | 147 not used for more than one stability level, i.e. after X.Y.Zalpha, |
144 the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. | 148 the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. |
145 | 149 |
146 | 150 |
147 3. Reporting bugs | 151 3. Reporting bugs |
148 ----------------- | 152 ----------------- |
149 | 153 |
150 Naturally it is easiest for me if you already know what causes the | 154 Naturally it is easiest for me if you already know what causes the |
151 unexpected behavior. Even better if you have a patch to propose. | 155 unexpected behavior. Even better if you have a patch to propose. |
152 However, quite often the reason for unexpected behavior is unknown, | 156 However, quite often the reason for unexpected behavior is unknown, |
153 so here are a few things to do before sending a bug report: | 157 so here are a few things to do before sending a bug report: |
(...skipping 15 matching lines...) Expand all Loading... |
169 using gdb: | 173 using gdb: |
170 $ gdb /path/to/app-binary # Load the app to the debugger. | 174 $ gdb /path/to/app-binary # Load the app to the debugger. |
171 (gdb) core core # Open the coredump. | 175 (gdb) core core # Open the coredump. |
172 (gdb) bt # Print the backtrace. Copy & paste to bug report. | 176 (gdb) bt # Print the backtrace. Copy & paste to bug report. |
173 (gdb) quit # Quit gdb. | 177 (gdb) quit # Quit gdb. |
174 | 178 |
175 Report your bug via email or IRC (see Contact information below). | 179 Report your bug via email or IRC (see Contact information below). |
176 Don't send core dump files or any executables. If you have a small | 180 Don't send core dump files or any executables. If you have a small |
177 example file(s) (total size less than 256 KiB), please include | 181 example file(s) (total size less than 256 KiB), please include |
178 it/them as an attachment. If you have bigger test files, put them | 182 it/them as an attachment. If you have bigger test files, put them |
179 online somewhere and include an URL to the file(s) in the bug report. | 183 online somewhere and include a URL to the file(s) in the bug report. |
180 | 184 |
181 Always include the exact version number of XZ Utils in the bug report. | 185 Always include the exact version number of XZ Utils in the bug report. |
182 If you are using a snapshot from the git repository, use "git describe" | 186 If you are using a snapshot from the git repository, use "git describe" |
183 to get the exact snapshot version. If you are using XZ Utils shipped | 187 to get the exact snapshot version. If you are using XZ Utils shipped |
184 in an operating system distribution, mention the distribution name, | 188 in an operating system distribution, mention the distribution name, |
185 distribution version, and exact xz package version; if you cannot | 189 distribution version, and exact xz package version; if you cannot |
186 repeat the bug with the code compiled from unpatched source code, | 190 repeat the bug with the code compiled from unpatched source code, |
187 you probably need to report a bug to your distribution's bug tracking | 191 you probably need to report a bug to your distribution's bug tracking |
188 system. | 192 system. |
189 | 193 |
190 | 194 |
191 4. Translating the xz tool | 195 4. Translating the xz tool |
192 -------------------------- | 196 -------------------------- |
193 | 197 |
194 The messages from the xz tool have been translated into a few | 198 The messages from the xz tool have been translated into a few |
195 languages. Before starting to translate into a new language, ask | 199 languages. Before starting to translate into a new language, ask |
196 the author that someone else hasn't already started working on it. | 200 the author whether someone else hasn't already started working on it. |
197 | 201 |
198 Test your translation. Testing includes comparing the translated | 202 Test your translation. Testing includes comparing the translated |
199 output to the original English version by running the same commands | 203 output to the original English version by running the same commands |
200 in both your target locale and with LC_ALL=C. Ask someone to | 204 in both your target locale and with LC_ALL=C. Ask someone to |
201 proof-read and test the translation. | 205 proof-read and test the translation. |
202 | 206 |
203 Testing can be done e.g. by installing xz into a temporary directory: | 207 Testing can be done e.g. by installing xz into a temporary directory: |
204 | 208 |
205 ./configure --disable-shared --prefix=/tmp/xz-test | 209 ./configure --disable-shared --prefix=/tmp/xz-test |
206 # <Edit the .po file in the po directory.> | 210 # <Edit the .po file in the po directory.> |
207 make -C po update-po | 211 make -C po update-po |
208 make install | 212 make install |
209 bash debug/translations.bash | less | 213 bash debug/translations.bash | less |
210 bash debug/translations.bash | less -S # For --list outputs | 214 bash debug/translations.bash | less -S # For --list outputs |
211 | 215 |
212 Repeat the above as needed (no need to re-run configure though). | 216 Repeat the above as needed (no need to re-run configure though). |
213 | 217 |
214 Note especially the following: | 218 Note especially the following: |
215 | 219 |
216 - The output of --help and --long-help must look nice on | 220 - The output of --help and --long-help must look nice on |
217 a 80-column terminal. It's OK to add extra lines if needed. | 221 an 80-column terminal. It's OK to add extra lines if needed. |
218 | 222 |
219 - In contrast, don't add extra lines to error messages and such. | 223 - In contrast, don't add extra lines to error messages and such. |
220 They are often preceded with e.g. a filename on the same line, | 224 They are often preceded with e.g. a filename on the same line, |
221 so you have no way to predict where to put a \n. Let the terminal | 225 so you have no way to predict where to put a \n. Let the terminal |
222 do the wrapping even if it looks ugly. Adding new lines will be | 226 do the wrapping even if it looks ugly. Adding new lines will be |
223 even uglier in the generic case even if it looks nice in a few | 227 even uglier in the generic case even if it looks nice in a few |
224 limited examples. | 228 limited examples. |
225 | 229 |
226 - Be careful with column alignment in tables and table-like output | 230 - Be careful with column alignment in tables and table-like output |
227 (--list, --list --verbose --verbose, --info-memory, --help, and | 231 (--list, --list --verbose --verbose, --info-memory, --help, and |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 299 |
296 If you have questions, bug reports, patches etc. related to XZ Utils, | 300 If you have questions, bug reports, patches etc. related to XZ Utils, |
297 contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English). | 301 contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English). |
298 I'm sometimes slow at replying. If you haven't got a reply within two | 302 I'm sometimes slow at replying. If you haven't got a reply within two |
299 weeks, assume that your email has got lost and resend it or use IRC. | 303 weeks, assume that your email has got lost and resend it or use IRC. |
300 | 304 |
301 You can find me also from #tukaani on Freenode; my nick is Larhzu. | 305 You can find me also from #tukaani on Freenode; my nick is Larhzu. |
302 The channel tends to be pretty quiet, so just ask your question and | 306 The channel tends to be pretty quiet, so just ask your question and |
303 someone may wake up. | 307 someone may wake up. |
304 | 308 |
OLD | NEW |