Compare commits

...

156 Commits
master ... v5.0

Author SHA1 Message Date
Adrien Nader 265e5ffb70 po/fr: improve wording for help for --lzma1/--lzma2. 2014-12-21 17:06:21 +02:00
Adrien Nader 3dfa915cd1 po/fr: missing line in translation of --extreme. 2014-12-21 17:06:21 +02:00
Lasse Collin 6b65e84bd4 xz: Fix a comment. 2014-12-21 14:08:08 +02:00
Lasse Collin 4da8e1d833 Bump version and soname for 5.0.8. 2014-12-21 13:50:08 +02:00
Lasse Collin f6dc9996b0 Update NEWS for 5.0.8. 2014-12-21 13:48:45 +02:00
Lasse Collin 67d62a375a Translations: Update the French translation.
Thanks to Adrien Nader.
2014-12-20 20:49:49 +02:00
Lasse Collin 283c03fe5b Update THANKS. 2014-12-18 21:33:33 +02:00
Lasse Collin 0c7fe9f227 Update INSTALL about a "make check" failure in test_scripts.sh. 2014-12-18 21:27:52 +02:00
Lasse Collin b46fe3ced9 Build: Update m4/ax_pthread.m4 from Autoconf Archive. 2014-12-18 21:27:41 +02:00
Lasse Collin 6ed0554a15 Build: Replace obsolete AC_HELP_STRING with AS_HELP_STRING. 2014-12-18 21:27:35 +02:00
Lasse Collin 0ab300ec52 Build: Fix Autoconf warnings about escaped backquotes. 2014-12-18 21:26:20 +02:00
Lasse Collin b274ad02c4 Update THANKS. 2014-12-17 21:15:02 +02:00
Lasse Collin 4fdcccd85e Add support for AmigaOS/AROS to tuklib_physmem().
Thanks to Fredrik Wikstrom.
2014-12-17 21:15:02 +02:00
Lasse Collin f229fa32bf xzgrep: Avoid passing both -q and -l to grep.
The behavior of grep -ql varies:
  - GNU grep behaves like grep -q.
  - OpenBSD grep behaves like grep -l.

POSIX doesn't make it 100 % clear what behavior is expected.
Anyway, using both -q and -l at the same time makes no sense
so both options simply should never be used at the same time.

Thanks to Christian Weisgerber.
2014-12-17 21:13:42 +02:00
Lasse Collin 94a1a869ee Build: Detect supported compiler warning flags better.
Clang and nowadays also GCC accept any -Wfoobar option
but then may give a warning that an unknown warning option
was specified. To avoid adding unsupported warning options,
the options are now tested with -Werror.

Thanks to Charles Diza.
2014-12-17 21:13:42 +02:00
Andre Noll 0e50ad7129 l10n: de.po: Change translator email address.
Although the old address is still working, the new one should
be preferred. So this commit changes all three places in de.po
accordingly.

Signed-off-by: Andre Noll <maan@tuebingen.mpg.de>
2014-10-18 18:23:15 +03:00
Andre Noll 9fd333d742 l10n: de.po: Fix typo: Schießen -> Schließen.
That's a funny one since "schießen" means to shoot :)

Signed-off-by: Andre Noll <maan@systemlinux.org>
2014-10-18 18:23:14 +03:00
Lasse Collin 495aaf3a5b Bump version and soname for 5.0.7. 2014-09-20 20:44:32 +03:00
Lasse Collin ac6c8921d1 Update NEWS for 5.0.7. 2014-09-20 20:43:29 +03:00
Lasse Collin d1b0276aaf liblzma: Fix invalid Libs.private value in liblzma.pc. 2014-09-20 20:21:18 +03:00
Lasse Collin cac72956b1 liblzma: Fix a portability problem in Makefile.am.
POSIX supports $< only in inference rules (suffix rules).
Using it elsewhere is a GNU make extension and doesn't
work e.g. with OpenBSD make.

Thanks to Christian Weisgerber for the patch.
2014-09-20 19:48:16 +03:00
Lasse Collin 2cdf0875de Bump version and soname for 5.0.6. 2014-09-14 19:35:45 +03:00
Lasse Collin 0168b6c8fb Update NEWS for 5.0.6. 2014-09-14 19:33:46 +03:00
Lasse Collin 13337714e8 xzgrep: List xzgrep_expected_output in tests/Makefile.am. 2014-09-09 19:18:23 +03:00
Lasse Collin ccc728d829 xzgrep: Improve the test script.
Now it should be close to the functionality of the original
version by Pavel Raiskup.
2014-09-09 19:18:23 +03:00
Lasse Collin 948f5865fe xzgrep: Add a test for the previous fix.
This is a simplified version of Pavel Raiskup's
original patch.
2014-09-09 19:18:23 +03:00
Lasse Collin 64228d0d5c xzgrep: exit 0 when at least one file matches.
Mimic the original grep behavior and return exit_success when
at least one xz compressed file matches given pattern.

Original bugreport:
https://bugzilla.redhat.com/show_bug.cgi?id=1108085

Thanks to Pavel Raiskup for the patch.
2014-09-09 19:18:23 +03:00
Lasse Collin 98d3368ef4 Build: Fix the combination of --disable-xzdec --enable-lzmadec.
In this case "make install" could fail if the man page directory
didn't already exist at the destination. If it did exist, a
dangling symlink was created there. Now the link is omitted
instead. This isn't the best fix but it's better than the old
behavior.
2014-04-26 08:47:36 +03:00
Lasse Collin ba3b5dd082 Build: Add --disable-doc to configure. 2014-04-26 08:47:36 +03:00
Lasse Collin 3d4575f236 Update INSTALL.
Add a note about failing "make check". The source of
the problem should be fixed in libtool (if it really is
a libtool bug and not mine) but I'm unable to spend time
on that for now. Thanks to Nelson H. F. Beebe for reporting
the issue.

Add a note about a possible need to run "ldconfig" after
"make install".
2014-04-26 08:47:24 +03:00
Lasse Collin b9f0584e3e xz: Rename a variable to avoid a namespace collision on Solaris.
I don't know the details but I have an impression that there's
no problem in practice if using GCC since people have built xz
with GCC (without patching xz), but renaming the variable cannot
hurt either.

Thanks to Mark Ashley.
2014-04-26 08:47:24 +03:00
Lasse Collin cc41bcaf77 xz: Fix a comment. 2014-04-26 08:45:49 +03:00
Lasse Collin e34025d666 liblzma: Avoid C99 compound literal arrays.
MSVC 2013 doesn't like them. Maybe they aren't so good
for readability either since many aren't used to them.
2014-04-26 08:38:12 +03:00
Lasse Collin 0b6168974f liblzma: Remove a useless C99ism from sha256.c.
Unsurprisingly it makes no difference in compiled output.
2014-04-26 08:38:12 +03:00
Lasse Collin 41e436076c xz: Fix use of wrong variable.
Since the only call to suffix_set() uses optarg
as the argument, fixing this bug doesn't change
the behavior of the program.
2014-04-26 08:37:15 +03:00
Lasse Collin c33efefd4e Fix typos in comments. 2014-04-26 08:37:00 +03:00
Lasse Collin e560c82f1f Update THANKS. 2014-04-26 08:31:53 +03:00
Lasse Collin 05192b32e5 liblzma: Document the need for block->check for lzma_block_header_decode().
Thanks to Tomer Chachamu.
2014-04-26 08:31:43 +03:00
Lasse Collin 0f35eafe51 Update TODO. 2014-04-26 08:31:21 +03:00
Lasse Collin fc9eaf81d7 Build: Remove a comment about Automake 1.10 from configure.ac.
The previous commit supports silent rules and that requires
Automake 1.11.
2014-04-26 08:30:00 +03:00
Lasse Collin 090c69dda5 Build: Create liblzma.pc in a src/liblzma/Makefile.am.
Previously it was done in configure, but doing that goes
against the Autoconf manual. Autoconf requires that it is
possible to override e.g. prefix after running configure
and that doesn't work correctly if liblzma.pc is created
by configure.

A potential downside of this change is that now e.g.
libdir in liblzma.pc is a standalone string instead of
being defined via ${prefix}, so if one overrides prefix
when running pkg-config the libdir won't get the new value.
I don't know if this matters in practice.

Thanks to Vincent Torri.
2014-04-26 08:29:17 +03:00
Anders F Bjorklund 1f35331332 macosx: separate liblzma package 2013-08-03 13:24:47 +03:00
Anders F Bjorklund 1415f1d946 macosx: set minimum to leopard 2013-08-03 13:24:47 +03:00
Anders F Bjorklund 41913949b9 move configurables into variables 2013-08-03 13:24:47 +03:00
Lasse Collin 3dffda33f4 Build: Fix the detection of missing CRC32.
Thanks to Vincent Torri.
2013-08-03 13:24:36 +03:00
Lasse Collin b69900ed0b Man pages: Use similar syntax for synopsis as in xz.
The man pages of lzmainfo, xzmore, and xzdec had similar
constructs as the man page of xz had before the commit
eb6ca9854b. Eric S. Raymond
didn't mention these man pages in his bug report, but
it's nice to be consistent.
2013-06-30 18:03:54 +03:00
Lasse Collin cf4a1e1879 Update NEWS for 5.0.5. 2013-06-30 15:55:09 +03:00
Lasse Collin cb94bb6d1f Bump version and soname for 5.0.5. 2013-06-30 15:54:38 +03:00
Lasse Collin b7dee202d5 xz: Fix return value type in io_write_buf().
It didn't affect the behavior of the code since -1
becomes true anyway.
2013-06-28 23:56:34 +03:00
Lasse Collin 265e7b44d8 xz: Remove an outdated NetBSD-specific comment.
Nowadays errno == EFTYPE is documented in open(2).
2013-06-28 22:04:40 +03:00
Lasse Collin 78c2f8db90 xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.
POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on
error and "other than -1" on success. This is how it is
documented e.g. on OpenBSD too. On Linux, success with
F_SETFL is always 0 (at least accorinding to fcntl(2)
from man-pages 3.51).
2013-06-28 22:04:36 +03:00
Lasse Collin 91750dff8f xz: Fix use of wrong variable in a fcntl() call.
Due to a wrong variable name, when writing a sparse file
to standard output, *all* file status flags were cleared
(to the extent the operating system allowed it) instead of
only clearing the O_APPEND flag. In practice this worked
fine in the common situations on GNU/Linux, but I didn't
check how it behaved elsewhere.

The original flags were still restored correctly. I still
changed the code to use a separate boolean variable to
indicate when the flags should be restored instead of
relying on a special value in stdout_flags.
2013-06-28 22:04:32 +03:00
Lasse Collin e11888a79a xz: Check the value of lzma_stream_flags.version in --list.
It is a no-op for now, but if an old xz version is used
together with a newer liblzma that supports something new,
then this check becomes important and will stop the old xz
from trying to parse files that it won't understand.
2013-06-26 13:31:19 +03:00
Lasse Collin f39ddd88f3 Build: Require Automake 1.12 and use serial-tests option.
It should actually still work with Automake 1.10 if
the serial-tests option is removed. Automake 1.13 started
using parallel tests by default and the option to get
the old behavior isn't supported before 1.12.

At least for now, parallel tests don't improve anything
in XZ Utils but they hide the progress output from
test_compress.sh.
2013-06-26 12:17:13 +03:00
Lasse Collin cb84e27802 xz: Validate Uncompressed Size from Block Header in list.c.
This affects only "xz -lvv". Normal decompression with xz
already detected if Block Header and Index had mismatched
Uncompressed Size fields. So this just makes "xz -lvv"
show such files as corrupt instead of showing the
Uncompressed Size from Index.
2013-06-26 10:59:19 +03:00
Lasse Collin f01780fce4 Update THANKS. 2013-06-26 10:58:58 +03:00
Lasse Collin d98ede7d70 xz: Make the man page more friendly to doclifter.
Thanks to Eric S. Raymond.
2013-06-26 10:58:07 +03:00
Lasse Collin 19b447b64b xz: A couple of man page fixes.
Now the interaction of presets and custom filter chains
is described correctly. Earlier it contradicted itself.

Thanks to DevHC who reported these issues on IRC to me
on 2012-12-14.
2013-06-26 10:54:24 +03:00
Lasse Collin 45edf2966f xz: Fix interaction between preset and custom filter chains.
There was somewhat illogical behavior when --extreme was
specified and mixed with custom filter chains.

Before this commit, "xz -9 --lzma2 -e" was equivalent
to "xz --lzma2". After it is equivalent to "xz -6e"
(all earlier preset options get forgotten when a custom
filter chain is specified and the default preset is 6
to which -e is applied). I find this less illogical.

This also affects the meaning of "xz -9e --lzma2 -7".
Earlier it was equivalent to "xz -7e" (the -e specified
before a custom filter chain wasn't forgotten). Now it
is "xz -7". Note that "xz -7e" still is the same as "xz -e7".

Hopefully very few cared about this in the first place,
so pretty much no one should even notice this change.

Thanks to Conley Moorhous.
2013-06-26 10:54:18 +03:00
Lasse Collin b065984e5a xz: Change size_t to uint32_t in a few places. 2013-06-26 10:54:09 +03:00
Lasse Collin 32be621f52 Build: Use -Wvla with GCC if supported.
Variable-length arrays are mandatory in C99 but optional in C11.
The code doesn't currently use any VLAs and it shouldn't in the
future either to stay compatible with C11 without requiring any
optional C11 features.
2013-06-26 10:53:57 +03:00
Lasse Collin efb07cfba6 xzdec: Improve the --help message.
The options are now ordered in the same order as in xz's help
message.

Descriptions were added to the options that are ignored.
I left them in parenthesis even if it looks a bit weird
because I find it easier to spot the ignored vs. non-ignored
options from the list that way.
2013-06-26 10:53:57 +03:00
Lasse Collin e3c8be1369 Update THANKS. 2013-04-05 19:34:42 +03:00
Jeff Bastian ad8282efe4 xzgrep: make the '-h' option to be --no-filename equivalent
* src/scripts/xzgrep.in: Accept the '-h' option in argument parsing.
2013-04-05 19:34:42 +03:00
Lasse Collin 9271a3eb0e liblzma: Be less picky in lzma_alone_decoder().
To avoid false positives when detecting .lzma files,
rare values in dictionary size and uncompressed size fields
were rejected. They will still be rejected if .lzma files
are decoded with lzma_auto_decoder(), but when using
lzma_alone_decoder() directly, such files will now be accepted.
Hopefully this is an OK compromise.

This doesn't affect xz because xz still has its own file
format detection code. This does affect lzmadec though.
So after this commit lzmadec will accept files that xz or
xz-emulating-lzma doesn't.

NOTE: lzma_alone_decoder() still won't decode all .lzma files
because liblzma's LZMA decoder doesn't support lc + lp > 4.

Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/7068827

Conflicts:
	src/liblzma/common/alone_decoder.c
	src/liblzma/common/alone_decoder.h
2013-04-05 19:34:09 +03:00
Lasse Collin 211b931cee Avoid unneeded use of awk in xzless.
Use "read" instead of "awk" in xzless to get the version
number of "less". The need for awk was introduced in
the commit db5c1817fa.

Thanks to Ariel P for the patch.
2013-04-05 19:28:08 +03:00
Jonathan Nieder 9f62fd9605 xzless: Make "less -V" parsing more robust
In v4.999.9beta~30 (xzless: Support compressed standard input,
2009-08-09), xzless learned to parse ‘less -V’ output to figure out
whether less is new enough to handle $LESSOPEN settings starting
with “|-”.  That worked well for a while, but the version string from
‘less’ versions 448 (June, 2012) is misparsed, producing a warning:

	$ xzless /tmp/test.xz; echo $?
	/usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \
	integer expression expected
	0

More precisely, modern ‘less’ lists the regexp implementation along
with its version number, and xzless passes the entire version number
with attached parenthetical phrase as a number to "test $a -gt $b",
producing the above confusing message.

	$ less-444 -V | head -1
	less 444
	$ less -V | head -1
	less 456 (no regular expressions)

So relax the pattern matched --- instead of expecting "less <number>",
look for a line of the form "less <number>[ (extra parenthetical)]".
While at it, improve the behavior when no matching line is found ---
instead of producing a cryptic message, we can fall back on a LESSPIPE
setting that is supported by all versions of ‘less’.

The implementation uses "awk" for simplicity.  Hopefully that’s
portable enough.

Reported-by: Jörg-Volker Peetz <jvpeetz@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2012-12-15 20:01:45 +02:00
Lasse Collin 1d05980f5b xz: Fix the note about --rsyncable on the man page. 2012-12-15 20:01:45 +02:00
Lasse Collin fb68497333 xz: Improve handling of failed realloc in xrealloc.
Thanks to Jim Meyering.
2012-12-15 20:01:45 +02:00
Lasse Collin 75013db6d4 A few typo fixes to comments and the xz man page.
Thanks to Jim Meyering.
2012-12-15 20:01:02 +02:00
Lasse Collin e44b21839b Build: Bump gettext version requirement to 0.18.
Otherwise too old version of m4/lib-link.m4 gets included
when autoreconf -fi is run.
2012-08-02 17:14:06 +03:00
Lasse Collin fd3dbb23ca Tests: Remove tests/test_block.c that had gotten committed accidentally. 2012-07-05 07:49:40 +03:00
Lasse Collin 05a735d279 Build: Include macosx/build.sh in the distribution.
It has been in the Git repository since 2010 but probably
few people have seen it since it hasn't been included in
the release tarballs. :-(
2012-07-05 07:49:31 +03:00
Lasse Collin 4e6d62793b Docs: Fix the name LZMA Utils -> XZ Utils in debug/README. 2012-07-05 07:49:21 +03:00
Lasse Collin dd95b5e761 Include debug/translation.bash in the distribution.
Also fix the script name mentioned in README.
2012-07-05 07:49:10 +03:00
Lasse Collin 20778053a0 xz: Update man page date to match the latest update. 2012-06-22 14:36:16 +03:00
Lasse Collin 2cefa84af6 Bump version and soname for 5.0.4. 2012-06-22 10:25:43 +03:00
Lasse Collin 433fec191a Update NEWS for 5.0.4. 2012-06-22 10:25:09 +03:00
Lasse Collin 711fa680f5 Docs: Language fix to 01_compress_easy.c.
Thanks to Jonathan Nieder.
2012-06-22 09:31:42 +03:00
Lasse Collin 3d7ab1dc61 Fix the top-level Makefile.am for the new example programs. 2012-06-22 09:31:42 +03:00
Lasse Collin ef8b8e5f11 Docs: Add new example programs.
These have more comments than the old examples and
human-readable error messages. More tutorial-like examples
are needed but these are a start.
2012-06-22 09:31:42 +03:00
Lasse Collin 75c149bc80 Docs: Move xz_pipe_comp.c and xz_pipe_decomp.c to doc/examples_old.
It is good to keep these around to so that if someone has
copied the decompressor bug from xz_pipe_decomp.c he has
an example how to easily fix it.
2012-06-22 09:31:42 +03:00
Lasse Collin 456307ebf9 Docs: Fix a bug in xz_pipe_decomp.c example program. 2012-06-22 09:31:42 +03:00
Lasse Collin 4c310b8a29 Translations: Update the Italian translation.
Thanks to Milo Casagrande.
2012-05-31 15:53:25 +03:00
Lasse Collin ec32b79366 Translations: Update the French translation.
Thanks to Adrien Nader.
2012-05-30 23:15:07 +03:00
Lasse Collin dd06f40e4d Translations: Update the German translation. 2012-05-29 22:27:00 +03:00
Lasse Collin c66808d1f5 Translations: Update Polish translation. 2012-05-29 22:12:57 +03:00
Lasse Collin 556c22dfed Preliminary NEWS for 5.0.4. 2012-05-29 13:10:36 +03:00
Lasse Collin dd13b66bf5 liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.
lzma_code() could incorrectly return LZMA_BUF_ERROR if
all of the following was true:

  - The caller knows how many bytes of output to expect
    and only provides that much output space.

  - When the last output bytes are decoded, the
    caller-provided input buffer ends right before
    the LZMA2 end of payload marker. So LZMA2 won't
    provide more output anymore, but it won't know it
    yet and thus won't return LZMA_STREAM_END yet.

  - A BCJ filter is in use and it hasn't left any
    unfiltered bytes in the temp buffer. This can happen
    with any BCJ filter, but in practice it's more likely
    with filters other than the x86 BCJ.

Another situation where the bug can be triggered happens
if the uncompressed size is zero bytes and no output space
is provided. In this case the decompression can fail even
if the whole input file is given to lzma_code().

A similar bug was fixed in XZ Embedded on 2011-09-19.
2012-05-29 12:54:47 +03:00
Lasse Collin a0223bf796 Update THANKS. 2012-05-29 12:54:47 +03:00
Lasse Collin 86e57e4bfe xz: Don't show a huge number in -vv when memory limit is disabled. 2012-05-29 12:54:47 +03:00
Lasse Collin 13e44a94da xz: Document the "summary" lines of --robot -lvv.
This documents only the columns that are in v5.0.
The new columns added in the master branch aren't
necessarily stable yet.
2012-05-29 12:54:22 +03:00
Lasse Collin 2f90345e13 xz: Fix output of verbose --robot --list modes.
It printed the filename in "filename (x/y)" format
which it obviously shouldn't do in robot mode.
2012-05-29 12:54:22 +03:00
Lasse Collin 8d4864f53f Update THANKS. 2012-05-24 19:16:37 +03:00
Lasse Collin 35e9c58abb Docs: Cleanup line wrapping a bit. 2012-05-24 19:16:37 +03:00
Benno Schulenberg 532b3e4c56 Fix a few typos and add some missing articles in some documents.
Also hyphenate several compound adjectives.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2012-05-24 19:16:37 +03:00
Lasse Collin afb6ce8c82 Windows: Update notes about static linking with MSVC. 2012-05-24 19:16:14 +03:00
Lasse Collin 7c3ba2ed5c liblzma: Remove outdated comments. 2012-05-24 19:16:14 +03:00
Lasse Collin f55db9c187 DOS: Link against DJGPP's libemu to support FPU emulation.
This way xz should work on 386SX and 486SX. Floating point
only is needed for verbose output in xz.
2012-05-24 19:16:14 +03:00
Lasse Collin 203edff4c7 Docs: Update MINIX 3 information in INSTALL. 2012-05-24 18:54:21 +03:00
Lasse Collin f0a8f95c21 Update THANKS. 2012-05-24 18:52:59 +03:00
Lasse Collin b7ad23fa78 Fix exit status of xzgrep when grepping binary files.
When grepping binary files, grep may exit before it has
read all the input. In this case, gzip -q returns 2 (eating
SIGPIPE), but xz and bzip2 show SIGPIPE as the exit status
(e.g. 141). This causes wrong exit status when grepping
xz- or bzip2-compressed binary files.

The fix checks for the special exit status that indicates SIGPIPE.
It uses kill -l which should be supported everywhere since it
is in both SUSv2 (1997) and POSIX.1-2008.

Thanks to James Buren for the bug report.
2012-05-24 18:52:48 +03:00
Lasse Collin 4e19fbb04a Update THANKS. 2012-05-24 18:52:48 +03:00
Lasse Collin c6fa03a427 Fix compiling with IBM XL C on AIX. 2012-05-24 18:47:52 +03:00
Lasse Collin 7b6ffc9864 Build: Upgrade m4/acx_pthread.m4 to the latest version.
It was renamed to ax_pthread.m4 in Autoconf Archive.
2012-05-24 18:37:08 +03:00
Lasse Collin bfac2be502 Tests: Fix a compiler warning with _FORTIFY_SOURCE.
Reported here:
http://sourceforge.net/projects/lzmautils/forums/forum/708858/topic/4927385
2012-05-24 18:24:44 +03:00
Lasse Collin df85e15671 Docs: Explain the stable releases better in README. 2012-05-24 18:24:44 +03:00
Lasse Collin d06d32f108 xz: Fix a typo in a comment.
Thanks to Bela Lubkin.
2011-11-04 17:57:45 +02:00
Lasse Collin 636fdcfbf5 Update THANKS. 2011-11-03 17:44:22 +02:00
Lasse Collin 55fd02f83e xz: Fix xz on EBCDIC systems.
Thanks to Chris Donawa.
2011-11-03 17:44:22 +02:00
Lasse Collin 4052f36053 Build: Fix "make check" on Windows. 2011-09-06 12:05:44 +03:00
Lasse Collin 0f25758459 Update THANKS. 2011-09-05 16:05:44 +03:00
Lasse Collin 70f03b51ff Workaround unusual SIZE_MAX on SCO OpenServer. 2011-09-05 16:05:44 +03:00
Lasse Collin f138bdf76a Run the scripts with the correct shell in test_scripts.sh.
The scripts are now made executable in the build tree.
This way the scripts can be run like programs in
test_scripts.sh. Previously test_scripts.sh always
used sh but it's not correct if @POSIX_SHELL@ is set
to something else by configure.

Thanks to Jonathan Nieder for the patch.
2011-09-05 16:05:44 +03:00
Lasse Collin 2c144a0365 Fix exit status of "xzdiff foo.xz bar.xz".
xzdiff was clobbering the exit status from diff in a case
statement used to analyze the exit statuses from "xz" when
its operands were two compressed files. Save and restore
diff's exit status to fix this.

The bug is inherited from zdiff in GNU gzip and was fixed
there on 2009-10-09.

Thanks to Jonathan Nieder for the patch and
to Peter Pallinger for reporting the bug.
2011-09-05 16:05:44 +03:00
Anders F Bjorklund edf339227a add build script for macosx universal 2011-07-07 23:09:11 +03:00
Lasse Collin 7fcc6334ea liblzma: Remove unneeded semicolon. 2011-06-16 12:16:05 +03:00
Lasse Collin 631f4d3ae6 Don't call close(-1) in tuklib_open_stdxxx() on error.
Thanks to Jim Meyering.
2011-05-28 18:54:42 +03:00
Lasse Collin c89faf4c9e Translations: Update Italian translation.
Thanks to Milo Casagrande.
2011-05-28 09:47:56 +03:00
Lasse Collin 6fe2fc9b6a Tests: Add a test file for the bug in the previous commit. 2011-05-28 09:44:18 +03:00
Lasse Collin 6c4d4db2bc xz: Fix error handling in xz -lvv.
It could do an invalid free() and read past the end
of the uninitialized filters array.
2011-05-28 09:44:12 +03:00
Lasse Collin 844f84fcad liblzma: Handle allocation failures correctly in lzma_index_init().
Thanks to Jim Meyering.
2011-05-28 09:44:07 +03:00
Lasse Collin 240e8b9791 Build: Set GZIP_ENV=-9n in top-level Makefile.am. 2011-05-23 18:30:51 +03:00
Lasse Collin e32cb264ea Bump version and soname for 5.0.3. 2011-05-21 16:59:22 +03:00
Lasse Collin 65cff45f8f Update NEWS for 5.0.3. 2011-05-21 16:56:53 +03:00
Lasse Collin 316c67ffda Add French translation.
It is known that the BCJ filter --help text is only
partially translated.
2011-05-21 16:29:11 +03:00
Lasse Collin 1931175eea xz: Translate also the string used to print the program name.
French needs a space before a colon, e.g. "xz : foo error".
2011-05-21 15:12:43 +03:00
Lasse Collin 841dc1f891 Update THANKS. 2011-05-17 12:28:18 +03:00
Lasse Collin 0f7e2d3624 Update INSTALL with a note about linker problem on OpenSolaris x86. 2011-05-17 12:28:14 +03:00
Lasse Collin 793d857e01 Build: Fix initialization of enable_check_* variables in configure.ac.
This doesn't matter much in practice since it is unlikely
that anyone would have such environment variable names.

Thanks to Wim Lewis.
2011-05-17 12:28:07 +03:00
Lasse Collin afcff45cee Add underscores to attributes (__attribute((__foo__))). 2011-05-17 12:27:22 +03:00
Lasse Collin 22159c6ba2 Update THANKS. 2011-04-18 19:36:21 +03:00
Martin Väth 5e34990595 xzgrep: fix typo in $0 parsing
Reported-by: Diego Elio Pettenò <flameeyes@gentoo.org>
Signed-off-by: Martin Väth <vaeth@mathematik.uni-wuerzburg.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-04-18 19:36:14 +03:00
Lasse Collin 1125611b9b Remove doubled words from documentation and comments.
Spot candidates by running these commands:
  git ls-files |xargs perl -0777 -n \
    -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
    -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g; print "$ARGV:$n:$v\n"}'

Thanks to Jim Meyering for the original patch.
2011-04-12 12:03:31 +03:00
Lasse Collin 3f8fa53837 liblzma: Document lzma_easy_(enc|dec)oder_memusage() better too. 2011-04-11 21:04:24 +03:00
Lasse Collin 320d734c20 liblzma: Document lzma_raw_(enc|dec)oder_memusage() better.
It didn't mention the return value that is used if
an error occurs.
2011-04-11 20:59:20 +03:00
Lasse Collin 2ee4edeffc liblzma: Don't create an empty Block in lzma_stream_buffer_encode().
Empty Block was created if the input buffer was empty.
Empty Block wastes a few bytes of space, but more importantly
it triggers a bug in XZ Utils 5.0.1 and older when trying
to decompress such a file. 5.0.1 and older consider such
files to be corrupt. I thought that no encoder creates empty
Blocks when releasing 5.0.2 but I was wrong.
2011-04-11 14:00:55 +03:00
Lasse Collin 73f56fb87d liblzma: Fix API docs to mention LZMA_UNSUPPORTED_CHECK.
This return value was missing from the API comments of
four functions.
2011-04-11 14:00:50 +03:00
Lasse Collin 4ce1cf97a8 liblzma: Validate encoder arguments better.
The biggest problem was that the integrity check type
wasn't validated, and e.g. lzma_easy_buffer_encode()
would create a corrupt .xz Stream if given an unsupported
Check ID. Luckily applications don't usually try to use
an unsupport Check ID, so this bug is unlikely to cause
many real-world problems.
2011-04-11 14:00:46 +03:00
Lasse Collin 972f05d7a4 Update THANKS. 2011-04-09 18:30:59 +03:00
Lasse Collin 28154eeaf6 liblzma: Add missing #ifdefs to filter_common.c.
Passing --disable-decoders to configure broke a few
encoders due to missing #ifdefs in filter_common.c.

Thanks to Jason Gorski for the patch.
2011-04-09 18:30:53 +03:00
Lasse Collin aa95516d3d liblzma: Fix a memory leak in stream_encoder.c.
It leaks old filter options structures (hundred bytes or so)
every time the lzma_stream is reinitialized. With the xz tool,
this happens when compressing multiple files.
2011-04-05 15:27:48 +03:00
Lasse Collin 58f52c72f4 Bumped version and liblzma soname to 5.0.2. 2011-04-01 08:47:46 +03:00
Lasse Collin 162779682e Updated NEWS for 5.0.2. 2011-04-01 08:47:20 +03:00
Lasse Collin 45553f9b4b Update INSTALL with another note about IRIX. 2011-03-31 15:07:08 +03:00
Lasse Collin af9d48d551 Tests: Add a new file to test empty LZMA2 streams. 2011-03-31 13:08:10 +03:00
Lasse Collin d099ef9f51 liblzma: Fix decoding of LZMA2 streams having no uncompressed data.
The decoder considered empty LZMA2 streams to be corrupt.
This shouldn't matter much with .xz files, because no encoder
creates empty LZMA2 streams in .xz. This bug is more likely
to cause problems in applications that use raw LZMA2 streams.
2011-03-31 13:08:05 +03:00
Lasse Collin df87249b26 Scripts: Better fix for xzgrep.
Now it uses "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:43:23 +02:00
Lasse Collin 68c453e1c7 Updated THANKS. 2011-03-24 01:24:16 +02:00
Lasse Collin b441d39855 Scripts: Fix xzgrep -l.
It didn't work at all. It tried to use the -q option
for grep, but it appended it after "--". This works
around it by redirecting to /dev/null. The downside
is that this can be slower with big files compared
to proper use of "grep -q".

Thanks to Gregory Margo.
2011-03-24 01:24:12 +02:00
Lasse Collin 82d5164839 xz: Clean up suffix.c.
struct suffix_pair isn't needed in compresed_name()
so get rid of it there.
2011-02-04 22:49:31 +02:00
Lasse Collin 6decc8b418 xz: Check if the file already has custom suffix when compressing.
Now "xz -S .test foo.test" refuses to compress the
file because it already has the suffix .test. The man
page had it documented this way already.
2011-02-04 11:29:47 +02:00
Lasse Collin ecda90061d Updated THANKS. 2011-02-02 23:01:51 +02:00
Lasse Collin 0fda1ae5b1 Translations: Add Polish translation.
Thanks to Jakub Bogusz.
2011-02-02 23:00:33 +02:00
Lasse Collin 00be32978f Updated THANKS. 2011-02-02 22:24:00 +02:00
Lasse Collin 7232fcf96b Bump package version and liblzma soname to 5.0.1. 2011-01-28 20:26:38 +02:00
103 changed files with 4300 additions and 904 deletions

View File

@ -16,11 +16,11 @@ Authors of XZ Utils
Some scripts have been adapted from gzip. The original versions Some scripts have been adapted from gzip. The original versions
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
Andrew Dudman helped adapting the script and their man pages for Andrew Dudman helped adapting the scripts and their man pages for
XZ Utils. XZ Utils.
The GNU Autotools based build system contains files from many authors, The GNU Autotools-based build system contains files from many authors,
which I'm not trying list here. which I'm not trying to list here.
Several people have contributed fixes or reported bugs. Most of them Several people have contributed fixes or reported bugs. Most of them
are mentioned in the file THANKS. are mentioned in the file THANKS.

96
INSTALL
View File

@ -6,12 +6,14 @@ XZ Utils Installation
1. Supported platforms 1. Supported platforms
1.1. Compilers 1.1. Compilers
1.2. Platform-specific notes 1.2. Platform-specific notes
1.2.1. IRIX 1.2.1. AIX
1.2.2. MINIX 3 1.2.2. IRIX
1.2.3. OpenVMS 1.2.3. MINIX 3
1.2.4. Tru64 1.2.4. OpenVMS
1.2.5. Windows 1.2.5. Solaris, OpenSolaris, and derivatives
1.2.6. DOS 1.2.6. Tru64
1.2.7. Windows
1.2.8. DOS
1.3. Adding support for new platforms 1.3. Adding support for new platforms
2. configure options 2. configure options
2.1. Static vs. dynamic linking of liblzma 2.1. Static vs. dynamic linking of liblzma
@ -24,6 +26,8 @@ XZ Utils Installation
4.2. "No POSIX conforming shell (sh) was found." 4.2. "No POSIX conforming shell (sh) was found."
4.3. configure works but build fails at crc32_x86.S 4.3. configure works but build fails at crc32_x86.S
4.4. Lots of warnings about symbol visibility 4.4. Lots of warnings about symbol visibility
4.5. "make check" fails
4.6. liblzma.so (or similar) not found when running xz
0. Preface 0. Preface
@ -62,23 +66,36 @@ XZ Utils Installation
1.2. Platform-specific notes 1.2. Platform-specific notes
1.2.1. IRIX 1.2.1. AIX
If you use IBM XL C compiler, pass CC=xlc_r to configure. If
you use CC=xlc instead, you must disable threading support
with --disable-threads (usually not recommended).
1.2.2. IRIX
MIPSpro 7.4.4m has been reported to produce broken code if using MIPSpro 7.4.4m has been reported to produce broken code if using
the -O2 optimization flag ("make check" fails). Using -O1 should the -O2 optimization flag ("make check" fails). Using -O1 should
work. work.
A problem has been reported when using shared liblzma. Passing
--disable-shared to configure works around this. Alternatively,
putting "-64" to CFLAGS to build a 64-bit version might help too.
1.2.2. MINIX 3
1.2.3. MINIX 3
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK), The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
which doesn't support C99. Install GCC to compile XZ Utils. which doesn't support C99. Install GCC to compile XZ Utils.
MINIX 3.1.8 (and possibly some other versions too) has bugs in MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
/usr/include/stdint.h, which has to be patched before XZ Utils to be patched before XZ Utils can be compiled correctly. See
can be compiled correctly. See
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>. <http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
MINIX 3.2.0 and later use a different libc and aren't affected by
the above bug.
XZ Utils doesn't have code to detect the amount of physical RAM and XZ Utils doesn't have code to detect the amount of physical RAM and
number of CPU cores on MINIX 3. number of CPU cores on MINIX 3.
@ -86,7 +103,7 @@ XZ Utils Installation
may want to pass gl_cv_cc_visibility=no to configure). may want to pass gl_cv_cc_visibility=no to configure).
1.2.3. OpenVMS 1.2.4. OpenVMS
XZ Utils can be built for OpenVMS, but the build system files XZ Utils can be built for OpenVMS, but the build system files
are not included in the XZ Utils source package. The required are not included in the XZ Utils source package. The required
@ -96,14 +113,24 @@ XZ Utils Installation
http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils http://nchrem.tnw.tudelft.nl/openvms/software2.html#xzutils
1.2.4. Tru64 1.2.5. Solaris, OpenSolaris, and derivatives
The following linker error has been reported on some x86 systems:
ld: fatal: relocation error: R_386_GOTOFF: ...
This can be worked around by passing gl_cv_cc_visibility=no
as an argument to the configure script.
1.2.6. Tru64
If you try to use the native C compiler on Tru64 (passing CC=cc to If you try to use the native C compiler on Tru64 (passing CC=cc to
configure), you may need the workaround mention in section 4.1 in configure), you may need the workaround mention in section 4.1 in
this file (pass also ac_cv_prog_cc_c99= to configure). this file (pass also ac_cv_prog_cc_c99= to configure).
1.2.5. Windows 1.2.7. Windows
Building XZ Utils on Windows is supported under MinGW + MSYS, Building XZ Utils on Windows is supported under MinGW + MSYS,
MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to MinGW-w64 + MSYS, and Cygwin. There is windows/build.bash to
@ -123,7 +150,7 @@ XZ Utils Installation
windows/README-Windows.txt for details. windows/README-Windows.txt for details.
1.2.6. DOS 1.2.8. DOS
There is an experimental Makefile in the "dos" directory to build There is an experimental Makefile in the "dos" directory to build
XZ Utils on DOS using DJGPP. Support for long file names (LFN) is XZ Utils on DOS using DJGPP. Support for long file names (LFN) is
@ -226,6 +253,12 @@ XZ Utils Installation
Don't install the scripts xzdiff, xzgrep, xzmore, xzless, Don't install the scripts xzdiff, xzgrep, xzmore, xzless,
and their symlinks. and their symlinks.
--disable-doc
Don't install the documentation files to $docdir
(often /usr/doc/xz or /usr/local/doc/xz). Man pages
will still be installed. The $docdir can be changed
with --docdir=DIR.
--disable-assembler --disable-assembler
liblzma includes some assembler optimizations. Currently liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for there is only assembler code for CRC32 and CRC64 for
@ -438,3 +471,36 @@ XZ Utils Installation
resulting binaries, but fewer warnings looks nicer and may allow resulting binaries, but fewer warnings looks nicer and may allow
using --enable-werror. using --enable-werror.
4.5. "make check" fails
If the other tests pass but test_scripts.sh fails, then the problem
is in the scripts in src/scripts. Comparing the contents of
tests/xzgrep_test_output to tests/xzgrep_expected_output might
give a good idea about problems in xzgrep. One possibility is that
some tools are missing from the current PATH or the tools lack
support for some POSIX features. This can happen at least on
Solaris where the tools in /bin may be ancient but good enough
tools are available in /usr/xpg4/bin or /usr/xpg6/bin. One fix
for this problem is described in section 3.2 of this file.
If tests other than test_scripts.sh fail, a likely reason is that
libtool links the test programs against an installed version of
liblzma instead of the version that was just built. This is
obviously a bug which seems to happen on some platforms.
A workaround is to uninstall the old liblzma versions first.
If the problem isn't any of those described above, then it's likely
a bug in XZ Utils or in the compiler. See the platform-specific
notes in this file for possible known problems. Please report
a bug if you cannot solve the problem. See README for contact
information.
4.6. liblzma.so (or similar) not found when running xz
If you installed the package with "make install" and get an error
about liblzma.so (or a similarly named file) being missing, try
running "ldconfig" to update the run-time linker cache (if your
operating system has such a command).

View File

@ -5,6 +5,9 @@
## You can do whatever you want with this file. ## You can do whatever you want with this file.
## ##
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
GZIP_ENV = -9n
DIST_SUBDIRS = lib src po tests debug DIST_SUBDIRS = lib src po tests debug
SUBDIRS = SUBDIRS =
@ -14,6 +17,7 @@ endif
SUBDIRS += src po tests SUBDIRS += src po tests
if COND_DOC
dist_doc_DATA = \ dist_doc_DATA = \
AUTHORS \ AUTHORS \
COPYING \ COPYING \
@ -29,13 +33,23 @@ dist_doc_DATA = \
examplesdir = $(docdir)/examples examplesdir = $(docdir)/examples
dist_examples_DATA = \ dist_examples_DATA = \
doc/examples/xz_pipe_comp.c \ doc/examples/00_README.txt \
doc/examples/xz_pipe_decomp.c doc/examples/01_compress_easy.c \
doc/examples/02_decompress.c \
doc/examples/03_compress_custom.c \
doc/examples/Makefile
examplesolddir = $(docdir)/examples_old
dist_examplesold_DATA = \
doc/examples_old/xz_pipe_comp.c \
doc/examples_old/xz_pipe_decomp.c
endif
EXTRA_DIST = \ EXTRA_DIST = \
extra \ extra \
dos \ dos \
windows \ windows \
macosx \
autogen.sh \ autogen.sh \
Doxyfile.in \ Doxyfile.in \
COPYING.GPLv2 \ COPYING.GPLv2 \

173
NEWS
View File

@ -1,6 +1,175 @@
XZ Utils User-Visible Changes XZ Utils Release Notes
============================= ======================
5.0.8 (2014-12-21)
* Fixed an old bug in xzgrep that affected OpenBSD and probably
a few other operating systems too.
* Updated French and German translations.
* Added support for detecting the amount of RAM on AmigaOS/AROS.
* Minor build system updates.
5.0.7 (2014-09-20)
* Fix regressions introduced in 5.0.6:
- Fix building with non-GNU make.
- Fix invalid Libs.private value in liblzma.pc which broke
static linking against liblzma if the linker flags were
taken from pkg-config.
5.0.6 (2014-09-14)
* xzgrep now exits with status 0 if at least one file matched.
* A few minor portability and build system fixes
5.0.5 (2013-06-30)
* lzmadec and liblzma's lzma_alone_decoder(): Support decompressing
.lzma files that have less common settings in the headers
(dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed
size greater than 256 GiB). The limitations existed to avoid false
positives when detecting .lzma files. The lc + lp <= 4 limitation
still remains since liblzma's LZMA decoder has that limitation.
NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT
affected by this change. They still consider uncommon .lzma headers
as not being in the .lzma format. Changing this would give way too
many false positives.
* xz:
- Interaction of preset and custom filter chain options was
made less illogical. This affects only certain less typical
uses cases so few people are expected to notice this change.
Now when a custom filter chain option (e.g. --lzma2) is
specified, all preset options (-0 ... -9, -e) earlier are on
the command line are completely forgotten. Similarly, when
a preset option is specified, all custom filter chain options
earlier on the command line are completely forgotten.
Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e"
which is equivalent to "xz -6e". Earlier -e didn't put xz back
into preset mode and thus the example command was equivalent
to "xz --lzma2=preset=5".
Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to
"xz -7". Earlier a custom filter chain option didn't make
xz forget the -e option so the example was equivalent to
"xz -7e".
- Fixes and improvements to error handling.
- Various fixes to the man page.
* xzless: Fixed to work with "less" versions 448 and later.
* xzgrep: Made -h an alias for --no-filename.
* Include the previously missing debug/translation.bash which can
be useful for translators.
* Include a build script for Mac OS X. This has been in the Git
repository since 2010 but due to a mistake in Makefile.am the
script hasn't been included in a release tarball before.
5.0.4 (2012-06-22)
* liblzma:
- Fix lzma_index_init(). It could crash if memory allocation
failed.
- Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ
filter is used and the application only provides exactly as
much output space as is the uncompressed size of the file.
- Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't
check if the last call to lzma_code() really returned
LZMA_STREAM_END, which made the program think that truncated
files are valid.
- New example programs in doc/examples (old programs are now in
doc/examples_old). These have more comments and more detailed
error handling.
* Fix "xz -lvv foo.xz". It could crash on some corrupted files.
* Fix output of "xz --robot -lv" and "xz --robot -lvv" which
incorrectly printed the filename also in the "foo (x/x)" format.
* Fix exit status of "xzdiff foo.xz bar.xz".
* Fix exit status of "xzgrep foo binary_file".
* Fix portability to EBCDIC systems.
* Fix a configure issue on AIX with the XL C compiler. See INSTALL
for details.
* Update French, German, Italian, and Polish translations.
5.0.3 (2011-05-21)
* liblzma fixes:
- A memory leak was fixed.
- lzma_stream_buffer_encode() no longer creates an empty .xz
Block if encoding an empty buffer. Such an empty Block with
LZMA2 data would trigger a bug in 5.0.1 and older (see the
first bullet point in 5.0.2 notes). When releasing 5.0.2,
I thought that no encoder creates this kind of files but
I was wrong.
- Validate function arguments better in a few functions. Most
importantly, specifying an unsupported integrity check to
lzma_stream_buffer_encode() no longer creates a corrupt .xz
file. Probably no application tries to do that, so this
shouldn't be a big problem in practice.
- Document that lzma_block_buffer_encode(),
lzma_easy_buffer_encode(), lzma_stream_encoder(), and
lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK.
- The return values of the _memusage() functions are now
documented better.
* Fix command name detection in xzgrep. xzegrep and xzfgrep now
correctly use egrep and fgrep instead of grep.
* French translation was added.
5.0.2 (2011-04-01)
* LZMA2 decompressor now correctly accepts LZMA2 streams with no
uncompressed data. Previously it considered them corrupt. The
bug can affect applications that use raw LZMA2 streams. It is
very unlikely to affect .xz files because no compressor creates
.xz files with empty LZMA2 streams. (Empty .xz files are a
different thing than empty LZMA2 streams.)
* "xz --suffix=.foo filename.foo" now refuses to compress the
file due to it already having the suffix .foo. It was already
documented on the man page, but the code lacked the test.
* "xzgrep -l foo bar.xz" works now.
* Polish translation was added.
5.0.1 (2011-01-29) 5.0.1 (2011-01-29)

58
README
View File

@ -5,7 +5,7 @@ XZ Utils
0. Overview 0. Overview
1. Documentation 1. Documentation
1.1. Overall documentation 1.1. Overall documentation
1.2. Documentation for command line tools 1.2. Documentation for command-line tools
1.3. Documentation for liblzma 1.3. Documentation for liblzma
2. Version numbering 2. Version numbering
3. Reporting bugs 3. Reporting bugs
@ -17,21 +17,21 @@ XZ Utils
0. Overview 0. Overview
----------- -----------
XZ Utils provide a general-purpose data compression library and XZ Utils provide a general-purpose data-compression library plus
command line tools. The native file format is the .xz format, but command-line tools. The native file format is the .xz format, but
also the legacy .lzma format is supported. The .xz format supports also the legacy .lzma format is supported. The .xz format supports
multiple compression algorithms, which are called "filters" in multiple compression algorithms, which are called "filters" in the
context of XZ Utils. The primary filter is currently LZMA2. With context of XZ Utils. The primary filter is currently LZMA2. With
typical files, XZ Utils create about 30 % smaller files than gzip. typical files, XZ Utils create about 30 % smaller files than gzip.
To ease adapting support for the .xz format into existing applications To ease adapting support for the .xz format into existing applications
and scripts, the API of liblzma is somewhat similar to the API of the and scripts, the API of liblzma is somewhat similar to the API of the
popular zlib library. For the same reason, the command line tool xz popular zlib library. For the same reason, the command-line tool xz
has similar command line syntax than that of gzip. has a command-line syntax similar to that of gzip.
When aiming for the highest compression ratio, LZMA2 encoder uses When aiming for the highest compression ratio, the LZMA2 encoder uses
a lot of CPU time and may use, depending on the settings, even a lot of CPU time and may use, depending on the settings, even
hundreds of megabytes of RAM. However, in fast modes, LZMA2 encoder hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
competes with bzip2 in compression speed, RAM usage, and compression competes with bzip2 in compression speed, RAM usage, and compression
ratio. ratio.
@ -44,8 +44,8 @@ XZ Utils
since that needs to be done only once to benefit many people. since that needs to be done only once to benefit many people.
With some file types, combining (or "chaining") LZMA2 with an With some file types, combining (or "chaining") LZMA2 with an
additional filter can improve compression ratio. A filter chain may additional filter can improve the compression ratio. A filter chain may
contain up to four filters, although usually only one two is used. contain up to four filters, although usually only one or two are used.
For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
in the filter chain can improve compression ratio of executable files. in the filter chain can improve compression ratio of executable files.
@ -88,9 +88,9 @@ XZ Utils
packages. packages.
1.2. Documentation for command line tools 1.2. Documentation for command-line tools
The command line tools are documented as man pages. In source code The command-line tools are documented as man pages. In source code
releases (and possibly also in some binary packages), the man pages releases (and possibly also in some binary packages), the man pages
are also provided in plain text (ASCII only) and PDF formats in the are also provided in plain text (ASCII only) and PDF formats in the
directory "doc/man" to make the man pages more accessible to those directory "doc/man" to make the man pages more accessible to those
@ -109,8 +109,8 @@ XZ Utils
written yet. written yet.
For now, if you have never used liblzma, libbzip2, or zlib, I For now, if you have never used liblzma, libbzip2, or zlib, I
recommend learning *basics* of zlib API. Once you know that, it recommend learning the *basics* of the zlib API. Once you know that,
should be easier to learn liblzma. it should be easier to learn liblzma.
http://zlib.net/manual.html http://zlib.net/manual.html
http://zlib.net/zlib_how.html http://zlib.net/zlib_how.html
@ -124,23 +124,27 @@ XZ Utils
- X is the major version. When this is incremented, the library - X is the major version. When this is incremented, the library
API and ABI break. API and ABI break.
- Y is the minor version. It is incremented when new features are - Y is the minor version. It is incremented when new features
added without breaking existing API or ABI. Even Y indicates are added without breaking the existing API or ABI. An even Y
stable release and odd Y indicates unstable (alpha or beta indicates a stable release and an odd Y indicates unstable
version). (alpha or beta version).
- Z is the revision. This has different meaning for stable and - Z is the revision. This has a different meaning for stable and
unstable releases: unstable releases:
* Stable: Z is incremented when bugs get fixed without adding * Stable: Z is incremented when bugs get fixed without adding
any new features. any new features. This is intended to be convenient for
downstream distributors that want bug fixes but don't want
any new features to minimize the risk of introducing new bugs.
* Unstable: Z is just a counter. API or ABI of features added * Unstable: Z is just a counter. API or ABI of features added
in earlier unstable releases having the same X.Y may break. in earlier unstable releases having the same X.Y may break.
- S indicates stability of the release. It is missing from the - S indicates stability of the release. It is missing from the
stable releases where Y is an even number. When Y is odd, S stable releases, where Y is an even number. When Y is odd, S
is either "alpha" or "beta" to make it very clear that such is either "alpha" or "beta" to make it very clear that such
versions are not stable releases. The same X.Y.Z combination is versions are not stable releases. The same X.Y.Z combination is
not used for more than one stability level i.e. after X.Y.Zalpha, not used for more than one stability level, i.e. after X.Y.Zalpha,
the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
@ -176,7 +180,7 @@ XZ Utils
Don't send core dump files or any executables. If you have a small Don't send core dump files or any executables. If you have a small
example file(s) (total size less than 256 KiB), please include example file(s) (total size less than 256 KiB), please include
it/them as an attachment. If you have bigger test files, put them it/them as an attachment. If you have bigger test files, put them
online somewhere and include an URL to the file(s) in the bug report. online somewhere and include a URL to the file(s) in the bug report.
Always include the exact version number of XZ Utils in the bug report. Always include the exact version number of XZ Utils in the bug report.
If you are using a snapshot from the git repository, use "git describe" If you are using a snapshot from the git repository, use "git describe"
@ -193,7 +197,7 @@ XZ Utils
The messages from the xz tool have been translated into a few The messages from the xz tool have been translated into a few
languages. Before starting to translate into a new language, ask languages. Before starting to translate into a new language, ask
the author that someone else hasn't already started working on it. the author whether someone else hasn't already started working on it.
Test your translation. Testing includes comparing the translated Test your translation. Testing includes comparing the translated
output to the original English version by running the same commands output to the original English version by running the same commands
@ -206,15 +210,15 @@ XZ Utils
# <Edit the .po file in the po directory.> # <Edit the .po file in the po directory.>
make -C po update-po make -C po update-po
make install make install
bash debug/translations.bash | less bash debug/translation.bash | less
bash debug/translations.bash | less -S # For --list outputs bash debug/translation.bash | less -S # For --list outputs
Repeat the above as needed (no need to re-run configure though). Repeat the above as needed (no need to re-run configure though).
Note especially the following: Note especially the following:
- The output of --help and --long-help must look nice on - The output of --help and --long-help must look nice on
a 80-column terminal. It's OK to add extra lines if needed. an 80-column terminal. It's OK to add extra lines if needed.
- In contrast, don't add extra lines to error messages and such. - In contrast, don't add extra lines to error messages and such.
They are often preceded with e.g. a filename on the same line, They are often preceded with e.g. a filename on the same line,

23
THANKS
View File

@ -6,22 +6,32 @@ Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order: has been important. :-) In alphabetical order:
- Mark Adler - Mark Adler
- H. Peter Anvin - H. Peter Anvin
- Jeff Bastian
- Nelson H. F. Beebe - Nelson H. F. Beebe
- Karl Berry - Karl Berry
- Anders F. Björklund - Anders F. Björklund
- Emmanuel Blot - Emmanuel Blot
- Martin Blumenstingl
- Jakub Bogusz
- Maarten Bosmans
- Trent W. Buck - Trent W. Buck
- James Buren
- David Burklund - David Burklund
- Daniel Mealha Cabrita - Daniel Mealha Cabrita
- Milo Casagrande - Milo Casagrande
- Marek Černocký - Marek Černocký
- Tomer Chachamu
- Chris Donawa
- Andrew Dudman - Andrew Dudman
- Markus Duft - Markus Duft
- İsmail Dönmez - İsmail Dönmez
- Robert Elz - Robert Elz
- Gilles Espinasse - Gilles Espinasse
- Denis Excoffier - Denis Excoffier
- Michael Felt
- Mike Frysinger - Mike Frysinger
- Daniel Richard G.
- Jason Gorski
- Juan Manuel Guerrero - Juan Manuel Guerrero
- Joachim Henke - Joachim Henke
- Peter Ivanov - Peter Ivanov
@ -34,33 +44,46 @@ has been important. :-) In alphabetical order:
- Peter Lawler - Peter Lawler
- Hin-Tak Leung - Hin-Tak Leung
- Andraž 'ruskie' Levstik - Andraž 'ruskie' Levstik
- Cary Lewis
- Wim Lewis
- Lorenzo De Liso - Lorenzo De Liso
- Bela Lubkin
- Gregory Margo
- Jim Meyering - Jim Meyering
- Conley Moorhous
- Rafał Mużyło - Rafał Mużyło
- Adrien Nader - Adrien Nader
- Hongbo Ni - Hongbo Ni
- Jonathan Nieder - Jonathan Nieder
- Andre Noll - Andre Noll
- Peter O'Gorman - Peter O'Gorman
- Peter Pallinger
- Igor Pavlov - Igor Pavlov
- Diego Elio Pettenò
- Elbert Pol - Elbert Pol
- Mikko Pouru - Mikko Pouru
- Pavel Raiskup
- Robert Readman - Robert Readman
- Bernhard Reutner-Fischer - Bernhard Reutner-Fischer
- Eric S. Raymond
- Cristian Rodríguez - Cristian Rodríguez
- Christian von Roques - Christian von Roques
- Jukka Salmi - Jukka Salmi
- Alexandre Sauvé - Alexandre Sauvé
- Benno Schulenberg
- Andreas Schwab - Andreas Schwab
- Dan Shechter - Dan Shechter
- Stuart Shelton - Stuart Shelton
- Jonathan Stott - Jonathan Stott
- Dan Stromberg
- Paul Townsend - Paul Townsend
- Mohammed Adnène Trojette - Mohammed Adnène Trojette
- Alexey Tourbin - Alexey Tourbin
- Patrick J. Volkerding - Patrick J. Volkerding
- Martin Väth
- Christian Weisgerber - Christian Weisgerber
- Bert Wesarg - Bert Wesarg
- Fredrik Wikstrom
- Ralf Wildenhues - Ralf Wildenhues
- Charles Wilson - Charles Wilson
- Lars Wirzenius - Lars Wirzenius

4
TODO
View File

@ -12,10 +12,6 @@ Known bugs
it would be possible by switching from BT2/BT3/BT4 match finder to it would be possible by switching from BT2/BT3/BT4 match finder to
HC3/HC4. HC3/HC4.
The code to detect number of CPU cores doesn't count hyperthreading
as multiple cores. In context of xz, it probably should.
Hyperthreading is good at least with p7zip.
XZ Utils compress some files significantly worse than LZMA Utils. XZ Utils compress some files significantly worse than LZMA Utils.
This is due to faster compression presets used by XZ Utils, and This is due to faster compression presets used by XZ Utils, and
can often be worked around by using "xz --extreme". With some files can often be worked around by using "xz --extreme". With some files

View File

@ -59,7 +59,7 @@ AM_CFLAGS=
############# #############
AC_MSG_CHECKING([if debugging code should be compiled]) AC_MSG_CHECKING([if debugging code should be compiled])
AC_ARG_ENABLE([debug], AC_HELP_STRING([--enable-debug], [Enable debugging code.]), AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debugging code.]),
[], enable_debug=no) [], enable_debug=no)
if test "x$enable_debug" = xyes; then if test "x$enable_debug" = xyes; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
@ -84,7 +84,7 @@ enable_decoder_[]NAME=no
])dnl ])dnl
AC_MSG_CHECKING([which encoders to build]) AC_MSG_CHECKING([which encoders to build])
AC_ARG_ENABLE([encoders], AC_HELP_STRING([--enable-encoders=LIST], AC_ARG_ENABLE([encoders], AS_HELP_STRING([--enable-encoders=LIST],
[Comma-separated list of encoders to build. Default=all. [Comma-separated list of encoders to build. Default=all.
Available encoders:] Available encoders:]
m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])), m4_translit(m4_defn([SUPPORTED_FILTERS]), [,], [ ])),
@ -112,7 +112,7 @@ else
fi fi
AC_MSG_CHECKING([which decoders to build]) AC_MSG_CHECKING([which decoders to build])
AC_ARG_ENABLE([decoders], AC_HELP_STRING([--enable-decoders=LIST], AC_ARG_ENABLE([decoders], AS_HELP_STRING([--enable-decoders=LIST],
[Comma-separated list of decoders to build. Default=all. [Comma-separated list of decoders to build. Default=all.
Available decoders are the same as available encoders.]), Available decoders are the same as available encoders.]),
[], [enable_decoders=SUPPORTED_FILTERS]) [], [enable_decoders=SUPPORTED_FILTERS])
@ -195,7 +195,7 @@ m4_foreach([NAME], [SUPPORTED_MATCH_FINDERS],
]) ])
AC_MSG_CHECKING([which match finders to build]) AC_MSG_CHECKING([which match finders to build])
AC_ARG_ENABLE([match-finders], AC_HELP_STRING([--enable-match-finders=LIST], AC_ARG_ENABLE([match-finders], AS_HELP_STRING([--enable-match-finders=LIST],
[Comma-separated list of match finders to build. Default=all. [Comma-separated list of match finders to build. Default=all.
At least one match finder is required for encoding with At least one match finder is required for encoding with
the LZMA1 and LZMA2 filters. Available match finders:] the LZMA1 and LZMA2 filters. Available match finders:]
@ -229,12 +229,12 @@ fi
m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256]) m4_define([SUPPORTED_CHECKS], [crc32,crc64,sha256])
m4_foreach([NAME], [SUPPORTED_FILTERS], m4_foreach([NAME], [SUPPORTED_CHECKS],
[enable_check_[]NAME=no [enable_check_[]NAME=no
])dnl ])dnl
AC_MSG_CHECKING([which integrity checks to build]) AC_MSG_CHECKING([which integrity checks to build])
AC_ARG_ENABLE([checks], AC_HELP_STRING([--enable-checks=LIST], AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks=LIST],
[Comma-separated list of integrity checks to build. [Comma-separated list of integrity checks to build.
Default=all. Available integrity checks:] Default=all. Available integrity checks:]
m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])), m4_translit(m4_defn([SUPPORTED_CHECKS]), [,], [ ])),
@ -260,7 +260,7 @@ else
done done
AC_MSG_RESULT([$enable_checks]) AC_MSG_RESULT([$enable_checks])
fi fi
if test "x$enable_checks_crc32" = xno ; then if test "x$enable_check_crc32" = xno ; then
AC_MSG_ERROR([For now, the CRC32 check must always be enabled.]) AC_MSG_ERROR([For now, the CRC32 check must always be enabled.])
fi fi
@ -274,7 +274,7 @@ m4_foreach([NAME], [SUPPORTED_CHECKS],
########################### ###########################
AC_MSG_CHECKING([if assembler optimizations should be used]) AC_MSG_CHECKING([if assembler optimizations should be used])
AC_ARG_ENABLE([assembler], AC_HELP_STRING([--disable-assembler], AC_ARG_ENABLE([assembler], AS_HELP_STRING([--disable-assembler],
[Do not use assembler optimizations even if such exist [Do not use assembler optimizations even if such exist
for the architecture.]), for the architecture.]),
[], [enable_assembler=yes]) [], [enable_assembler=yes])
@ -297,7 +297,7 @@ case $enable_assembler in
;; ;;
*) *)
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-assembler accepts only \`yes', \`no', \`x86', or \`x86_64'.]) AC_MSG_ERROR([--enable-assembler accepts only `yes', `no', `x86', or `x86_64'.])
;; ;;
esac esac
AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86) AM_CONDITIONAL(COND_ASM_X86, test "x$enable_assembler" = xx86)
@ -309,7 +309,7 @@ AM_CONDITIONAL(COND_ASM_X86_64, test "x$enable_assembler" = xx86_64)
##################### #####################
AC_MSG_CHECKING([if small size is preferred over speed]) AC_MSG_CHECKING([if small size is preferred over speed])
AC_ARG_ENABLE([small], AC_HELP_STRING([--enable-small], AC_ARG_ENABLE([small], AS_HELP_STRING([--enable-small],
[Make liblzma smaller and a little slower. [Make liblzma smaller and a little slower.
This is disabled by default to optimize for speed.]), This is disabled by default to optimize for speed.]),
[], [enable_small=no]) [], [enable_small=no])
@ -317,7 +317,7 @@ if test "x$enable_small" = xyes; then
AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.]) AC_DEFINE([HAVE_SMALL], [1], [Define to 1 if optimizing for size.])
elif test "x$enable_small" != xno; then elif test "x$enable_small" != xno; then
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-small accepts only \`yes' or \`no']) AC_MSG_ERROR([--enable-small accepts only `yes' or `no'])
fi fi
AC_MSG_RESULT([$enable_small]) AC_MSG_RESULT([$enable_small])
AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes) AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
@ -328,13 +328,13 @@ AM_CONDITIONAL(COND_SMALL, test "x$enable_small" = xyes)
############# #############
AC_MSG_CHECKING([if threading support is wanted]) AC_MSG_CHECKING([if threading support is wanted])
AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads], AC_ARG_ENABLE([threads], AS_HELP_STRING([--disable-threads],
[Disable threading support. [Disable threading support.
This makes some things thread-unsafe.]), This makes some things thread-unsafe.]),
[], [enable_threads=yes]) [], [enable_threads=yes])
if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then if test "x$enable_threads" != xyes && test "x$enable_threads" != xno; then
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-threads accepts only \`yes' or \`no']) AC_MSG_ERROR([--enable-threads accepts only `yes' or `no'])
fi fi
AC_MSG_RESULT([$enable_threads]) AC_MSG_RESULT([$enable_threads])
# We use the actual result a little later. # We use the actual result a little later.
@ -349,7 +349,7 @@ AC_MSG_RESULT([$enable_threads])
# but most systems, on which we don't have any way to determine the amount # but most systems, on which we don't have any way to determine the amount
# of RAM, will probably have at least 128 MiB of RAM. # of RAM, will probably have at least 128 MiB of RAM.
AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown]) AC_MSG_CHECKING([how much RAM to assume if the real amount is unknown])
AC_ARG_ENABLE([assume-ram], AC_HELP_STRING([--enable-assume-ram=SIZE], AC_ARG_ENABLE([assume-ram], AS_HELP_STRING([--enable-assume-ram=SIZE],
[If and only if the real amount of RAM cannot be determined, [If and only if the real amount of RAM cannot be determined,
assume SIZE MiB. The default is 128 MiB. This affects the assume SIZE MiB. The default is 128 MiB. This affects the
default memory usage limit.]), default memory usage limit.]),
@ -369,39 +369,45 @@ AC_DEFINE_UNQUOTED([ASSUME_RAM], [$enable_assume_ram],
# Components to install # # Components to install #
######################### #########################
AC_ARG_ENABLE([xz], [AC_HELP_STRING([--disable-xz], AC_ARG_ENABLE([xz], [AS_HELP_STRING([--disable-xz],
[do not build the xz tool])], [do not build the xz tool])],
[], [enable_xz=yes]) [], [enable_xz=yes])
AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno]) AM_CONDITIONAL([COND_XZ], [test x$enable_xz != xno])
AC_ARG_ENABLE([xzdec], [AC_HELP_STRING([--disable-xzdec], AC_ARG_ENABLE([xzdec], [AS_HELP_STRING([--disable-xzdec],
[do not build xzdec])], [do not build xzdec])],
[], [enable_xzdec=yes]) [], [enable_xzdec=yes])
AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno]) AM_CONDITIONAL([COND_XZDEC], [test x$enable_xzdec != xno])
AC_ARG_ENABLE([lzmadec], [AC_HELP_STRING([--disable-lzmadec], AC_ARG_ENABLE([lzmadec], [AS_HELP_STRING([--disable-lzmadec],
[do not build lzmadec [do not build lzmadec
(it exists primarily for LZMA Utils compatibility)])], (it exists primarily for LZMA Utils compatibility)])],
[], [enable_lzmadec=yes]) [], [enable_lzmadec=yes])
AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno]) AM_CONDITIONAL([COND_LZMADEC], [test x$enable_lzmadec != xno])
AC_ARG_ENABLE([lzmainfo], [AC_HELP_STRING([--disable-lzmainfo], AC_ARG_ENABLE([lzmainfo], [AS_HELP_STRING([--disable-lzmainfo],
[do not build lzmainfo [do not build lzmainfo
(it exists primarily for LZMA Utils compatibility)])], (it exists primarily for LZMA Utils compatibility)])],
[], [enable_lzmainfo=yes]) [], [enable_lzmainfo=yes])
AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno]) AM_CONDITIONAL([COND_LZMAINFO], [test x$enable_lzmainfo != xno])
AC_ARG_ENABLE([lzma-links], [AC_HELP_STRING([--disable-lzma-links], AC_ARG_ENABLE([lzma-links], [AS_HELP_STRING([--disable-lzma-links],
[do not create symlinks for LZMA Utils compatibility])], [do not create symlinks for LZMA Utils compatibility])],
[], [enable_lzma_links=yes]) [], [enable_lzma_links=yes])
AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno]) AM_CONDITIONAL([COND_LZMALINKS], [test x$enable_lzma_links != xno])
AC_ARG_ENABLE([scripts], [AC_HELP_STRING([--disable-scripts], AC_ARG_ENABLE([scripts], [AS_HELP_STRING([--disable-scripts],
[do not install the scripts xzdiff, xzgrep, xzless, xzmore, [do not install the scripts xzdiff, xzgrep, xzless, xzmore,
and their symlinks])], and their symlinks])],
[], [enable_scripts=yes]) [], [enable_scripts=yes])
AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno]) AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
[do not install documentation files to docdir
(man pages will still be installed)])],
[], [enable_doc=yes])
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
############################################################################### ###############################################################################
# Checks for programs. # Checks for programs.
@ -416,7 +422,7 @@ fi
echo echo
echo "Initializing Automake:" echo "Initializing Automake:"
AM_INIT_AUTOMAKE([1.10 foreign tar-v7 filename-length-max=99]) AM_INIT_AUTOMAKE([1.12 foreign tar-v7 filename-length-max=99 serial-tests])
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_CC_C99 AC_PROG_CC_C99
@ -431,10 +437,14 @@ AC_USE_SYSTEM_EXTENSIONS
if test "x$enable_threads" = xyes; then if test "x$enable_threads" = xyes; then
echo echo
echo "Threading support:" echo "Threading support:"
ACX_PTHREAD AX_PTHREAD
LIBS="$LIBS $PTHREAD_LIBS" LIBS="$LIBS $PTHREAD_LIBS"
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS" AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX, but
dnl it's tricky to get it right together with AC_PROG_CC_C99.
dnl Thus, this is handled by telling the user in INSTALL to set
dnl the correct CC manually.
fi fi
echo echo
@ -456,7 +466,7 @@ AM_CONDITIONAL([COND_SHARED], [test "x$enable_shared" != xno])
echo echo
echo "Initializing gettext:" echo "Initializing gettext:"
AM_GNU_GETTEXT_VERSION([0.16.1]) AM_GNU_GETTEXT_VERSION([0.18])
AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT([external])
############################################################################### ###############################################################################
@ -494,7 +504,7 @@ AC_TYPE_UINTPTR_T
AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([size_t])
# The command line tool can copy high resolution timestamps if such # The command line tool can copy high resolution timestamps if such
# information is availabe in struct stat. Otherwise one second accuracy # information is available in struct stat. Otherwise one second accuracy
# is used. # is used.
AC_CHECK_MEMBERS([ AC_CHECK_MEMBERS([
struct stat.st_atim.tv_nsec, struct stat.st_atim.tv_nsec,
@ -556,6 +566,7 @@ if test "$GCC" = yes ; then
for NEW_FLAG in \ for NEW_FLAG in \
-Wall \ -Wall \
-Wextra \ -Wextra \
-Wvla \
-Wformat=2 \ -Wformat=2 \
-Winit-self \ -Winit-self \
-Wmissing-include-dirs \ -Wmissing-include-dirs \
@ -577,8 +588,9 @@ if test "$GCC" = yes ; then
do do
AC_MSG_CHECKING([if $CC accepts $NEW_FLAG]) AC_MSG_CHECKING([if $CC accepts $NEW_FLAG])
OLD_CFLAGS="$CFLAGS" OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $NEW_FLAG" CFLAGS="$CFLAGS $NEW_FLAG -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void) { }])], [ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
[void foo(void); void foo(void) { }])], [
AM_CFLAGS="$AM_CFLAGS $NEW_FLAG" AM_CFLAGS="$AM_CFLAGS $NEW_FLAG"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
], [ ], [
@ -588,7 +600,7 @@ if test "$GCC" = yes ; then
done done
AC_ARG_ENABLE([werror], AC_ARG_ENABLE([werror],
AC_HELP_STRING([--enable-werror], [Enable -Werror to abort AS_HELP_STRING([--enable-werror], [Enable -Werror to abort
compilation on all compiler warnings.]), compilation on all compiler warnings.]),
[], [enable_werror=no]) [], [enable_werror=no])
if test "x$enable_werror" = "xyes"; then if test "x$enable_werror" = "xyes"; then
@ -620,20 +632,19 @@ AC_CONFIG_FILES([
po/Makefile.in po/Makefile.in
lib/Makefile lib/Makefile
src/Makefile src/Makefile
src/liblzma/liblzma.pc
src/liblzma/Makefile src/liblzma/Makefile
src/liblzma/api/Makefile src/liblzma/api/Makefile
src/xz/Makefile src/xz/Makefile
src/xzdec/Makefile src/xzdec/Makefile
src/lzmainfo/Makefile src/lzmainfo/Makefile
src/scripts/Makefile src/scripts/Makefile
src/scripts/xzdiff
src/scripts/xzgrep
src/scripts/xzmore
src/scripts/xzless
tests/Makefile tests/Makefile
debug/Makefile debug/Makefile
]) ])
AC_CONFIG_FILES([src/scripts/xzdiff], [chmod +x src/scripts/xzdiff])
AC_CONFIG_FILES([src/scripts/xzgrep], [chmod +x src/scripts/xzgrep])
AC_CONFIG_FILES([src/scripts/xzmore], [chmod +x src/scripts/xzmore])
AC_CONFIG_FILES([src/scripts/xzless], [chmod +x src/scripts/xzless])
AC_OUTPUT AC_OUTPUT

View File

@ -5,6 +5,9 @@
## You can do whatever you want with this file. ## You can do whatever you want with this file.
## ##
EXTRA_DIST = \
translation.bash
noinst_PROGRAMS = \ noinst_PROGRAMS = \
repeat \ repeat \
sync_flush \ sync_flush \

View File

@ -3,7 +3,7 @@ Debug tools
----------- -----------
This directory contains a few tiny programs that may be helpful when This directory contains a few tiny programs that may be helpful when
debugging LZMA Utils. debugging XZ Utils.
These tools are not meant to be installed. Often one needs to edit These tools are not meant to be installed. Often one needs to edit
the source code a little to make the programs do the wanted things. the source code a little to make the programs do the wanted things.

View File

@ -0,0 +1,27 @@
liblzma example programs
========================
Introduction
The examples are written so that the same comments aren't
repeated (much) in later files.
On POSIX systems, the examples should build by just typing "make".
The examples that use stdin or stdout don't set stdin and stdout
to binary mode. On systems where it matters (e.g. Windows) it is
possible that the examples won't work without modification.
List of examples
01_compress_easy.c Multi-call compression using
a compression preset
02_decompress.c Multi-call decompression
03_compress_custom.c Like 01_compress_easy.c but using
a custom filter chain
(x86 BCJ + LZMA2)

View File

@ -0,0 +1,297 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file 01_compress_easy.c
/// \brief Compress from stdin to stdout in multi-call mode
///
/// Usage: ./01_compress_easy PRESET < INFILE > OUTFILE
///
/// Example: ./01_compress_easy 6 < foo > foo.xz
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lzma.h>
static void
show_usage_and_exit(const char *argv0)
{
fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n"
"PRESET is a number 0-9 and can optionally be "
"followed by `e' to indicate extreme preset\n",
argv0);
exit(EXIT_FAILURE);
}
static uint32_t
get_preset(int argc, char **argv)
{
// One argument whose first char must be 0-9.
if (argc != 2 || argv[1][0] < '0' || argv[1][0] > '9')
show_usage_and_exit(argv[0]);
// Calculate the preste level 0-9.
uint32_t preset = argv[1][0] - '0';
// If there is a second char, it must be 'e'. It will set
// the LZMA_PRESET_EXTREME flag.
if (argv[1][1] != '\0') {
if (argv[1][1] != 'e' || argv[1][2] != '\0')
show_usage_and_exit(argv[0]);
preset |= LZMA_PRESET_EXTREME;
}
return preset;
}
static bool
init_encoder(lzma_stream *strm, uint32_t preset)
{
// Initialize the encoder using a preset. Set the integrity to check
// to CRC64, which is the default in the xz command line tool. If
// the .xz file needs to be decompressed with XZ Embedded, use
// LZMA_CHECK_CRC32 instead.
lzma_ret ret = lzma_easy_encoder(strm, preset, LZMA_CHECK_CRC64);
// Return successfully if the initialization went fine.
if (ret == LZMA_OK)
return true;
// Something went wrong. The possible errors are documented in
// lzma/container.h (src/liblzma/api/lzma/container.h in the source
// package or e.g. /usr/include/lzma/container.h depending on the
// install prefix).
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_OPTIONS_ERROR:
msg = "Specified preset is not supported";
break;
case LZMA_UNSUPPORTED_CHECK:
msg = "Specified integrity check is not supported";
break;
default:
// This is most likely LZMA_PROG_ERROR indicating a bug in
// this program or in liblzma. It is inconvenient to have a
// separate error message for errors that should be impossible
// to occur, but knowing the error code is important for
// debugging. That's why it is good to print the error code
// at least when there is no good error message to show.
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
msg, ret);
return false;
}
static bool
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
{
// This will be LZMA_RUN until the end of the input file is reached.
// This tells lzma_code() when there will be no more input.
lzma_action action = LZMA_RUN;
// Buffers to temporarily hold uncompressed input
// and compressed output.
uint8_t inbuf[BUFSIZ];
uint8_t outbuf[BUFSIZ];
// Initialize the input and output pointers. Initializing next_in
// and avail_in isn't really necessary when we are going to encode
// just one file since LZMA_STREAM_INIT takes care of initializing
// those already. But it doesn't hurt much and it will be needed
// if encoding more than one file like we will in 02_decompress.c.
//
// While we don't care about strm->total_in or strm->total_out in this
// example, it is worth noting that initializing the encoder will
// always reset total_in and total_out to zero. But the encoder
// initialization doesn't touch next_in, avail_in, next_out, or
// avail_out.
strm->next_in = NULL;
strm->avail_in = 0;
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
// Loop until the file has been successfully compressed or until
// an error occurs.
while (true) {
// Fill the input buffer if it is empty.
if (strm->avail_in == 0 && !feof(infile)) {
strm->next_in = inbuf;
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
infile);
if (ferror(infile)) {
fprintf(stderr, "Read error: %s\n",
strerror(errno));
return false;
}
// Once the end of the input file has been reached,
// we need to tell lzma_code() that no more input
// will be coming and that it should finish the
// encoding.
if (feof(infile))
action = LZMA_FINISH;
}
// Tell liblzma do the actual encoding.
//
// This reads up to strm->avail_in bytes of input starting
// from strm->next_in. avail_in will be decremented and
// next_in incremented by an equal amount to match the
// number of input bytes consumed.
//
// Up to strm->avail_out bytes of compressed output will be
// written starting from strm->next_out. avail_out and next_out
// will be incremented by an equal amount to match the number
// of output bytes written.
//
// The encoder has to do internal buffering, which means that
// it may take quite a bit of input before the same data is
// available in compressed form in the output buffer.
lzma_ret ret = lzma_code(strm, action);
// If the output buffer is full or if the compression finished
// successfully, write the data from the output bufffer to
// the output file.
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
// When lzma_code() has returned LZMA_STREAM_END,
// the output buffer is likely to be only partially
// full. Calculate how much new data there is to
// be written to the output file.
size_t write_size = sizeof(outbuf) - strm->avail_out;
if (fwrite(outbuf, 1, write_size, outfile)
!= write_size) {
fprintf(stderr, "Write error: %s\n",
strerror(errno));
return false;
}
// Reset next_out and avail_out.
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
}
// Normally the return value of lzma_code() will be LZMA_OK
// until everything has been encoded.
if (ret != LZMA_OK) {
// Once everything has been encoded successfully, the
// return value of lzma_code() will be LZMA_STREAM_END.
//
// It is important to check for LZMA_STREAM_END. Do not
// assume that getting ret != LZMA_OK would mean that
// everything has gone well.
if (ret == LZMA_STREAM_END)
return true;
// It's not LZMA_OK nor LZMA_STREAM_END,
// so it must be an error code. See lzma/base.h
// (src/liblzma/api/lzma/base.h in the source package
// or e.g. /usr/include/lzma/base.h depending on the
// install prefix) for the list and documentation of
// possible values. Most values listen in lzma_ret
// enumeration aren't possible in this example.
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_DATA_ERROR:
// This error is returned if the compressed
// or uncompressed size get near 8 EiB
// (2^63 bytes) because that's where the .xz
// file format size limits currently are.
// That is, the possibility of this error
// is mostly theoretical unless you are doing
// something very unusual.
//
// Note that strm->total_in and strm->total_out
// have nothing to do with this error. Changing
// those variables won't increase or decrease
// the chance of getting this error.
msg = "File size limits exceeded";
break;
default:
// This is most likely LZMA_PROG_ERROR, but
// if this program is buggy (or liblzma has
// a bug), it may be e.g. LZMA_BUF_ERROR or
// LZMA_OPTIONS_ERROR too.
//
// It is inconvenient to have a separate
// error message for errors that should be
// impossible to occur, but knowing the error
// code is important for debugging. That's why
// it is good to print the error code at least
// when there is no good error message to show.
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Encoder error: %s (error code %u)\n",
msg, ret);
return false;
}
}
}
extern int
main(int argc, char **argv)
{
// Get the preset number from the command line.
uint32_t preset = get_preset(argc, argv);
// Initialize a lzma_stream structure. When it is allocated on stack,
// it is simplest to use LZMA_STREAM_INIT macro like below. When it
// is allocated on heap, using memset(strmptr, 0, sizeof(*strmptr))
// works (as long as NULL pointers are represented with zero bits
// as they are on practically all computers today).
lzma_stream strm = LZMA_STREAM_INIT;
// Initialize the encoder. If it succeeds, compress from
// stdin to stdout.
bool success = init_encoder(&strm, preset);
if (success)
success = compress(&strm, stdin, stdout);
// Free the memory allocated for the encoder. If we were encoding
// multiple files, this would only need to be done after the last
// file. See 02_decompress.c for handling of multiple files.
//
// It is OK to call lzma_end() multiple times or when it hasn't been
// actually used except initialized with LZMA_STREAM_INIT.
lzma_end(&strm);
// Close stdout to catch possible write errors that can occur
// when pending data is flushed from the stdio buffers.
if (fclose(stdout)) {
fprintf(stderr, "Write error: %s\n", strerror(errno));
success = false;
}
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -0,0 +1,287 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file 02_decompress.c
/// \brief Decompress .xz files to stdout
///
/// Usage: ./02_decompress INPUT_FILES... > OUTFILE
///
/// Example: ./02_decompress foo.xz bar.xz > foobar
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lzma.h>
static bool
init_decoder(lzma_stream *strm)
{
// Initialize a .xz decoder. The decoder supports a memory usage limit
// and a set of flags.
//
// The memory usage of the decompressor depends on the settings used
// to compress a .xz file. It can vary from less than a megabyte to
// a few gigabytes, but in practice (at least for now) it rarely
// exceeds 65 MiB because that's how much memory is required to
// decompress files created with "xz -9". Settings requiring more
// memory take extra effort to use and don't (at least for now)
// provide significantly better compression in most cases.
//
// Memory usage limit is useful if it is important that the
// decompressor won't consume gigabytes of memory. The need
// for limiting depends on the application. In this example,
// no memory usage limiting is used. This is done by setting
// the limit to UINT64_MAX.
//
// The .xz format allows concatenating compressed files as is:
//
// echo foo | xz > foobar.xz
// echo bar | xz >> foobar.xz
//
// When decompressing normal standalone .xz files, LZMA_CONCATENATED
// should always be used to support decompression of concatenated
// .xz files. If LZMA_CONCATENATED isn't used, the decoder will stop
// after the first .xz stream. This can be useful when .xz data has
// been embedded inside another file format.
//
// Flags other than LZMA_CONCATENATED are supported too, and can
// be combined with bitwise-or. See lzma/container.h
// (src/liblzma/api/lzma/container.h in the source package or e.g.
// /usr/include/lzma/container.h depending on the install prefix)
// for details.
lzma_ret ret = lzma_stream_decoder(
strm, UINT64_MAX, LZMA_CONCATENATED);
// Return successfully if the initialization went fine.
if (ret == LZMA_OK)
return true;
// Something went wrong. The possible errors are documented in
// lzma/container.h (src/liblzma/api/lzma/container.h in the source
// package or e.g. /usr/include/lzma/container.h depending on the
// install prefix).
//
// Note that LZMA_MEMLIMIT_ERROR is never possible here. If you
// specify a very tiny limit, the error will be delayed until
// the first headers have been parsed by a call to lzma_code().
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_OPTIONS_ERROR:
msg = "Unsupported decompressor flags";
break;
default:
// This is most likely LZMA_PROG_ERROR indicating a bug in
// this program or in liblzma. It is inconvenient to have a
// separate error message for errors that should be impossible
// to occur, but knowing the error code is important for
// debugging. That's why it is good to print the error code
// at least when there is no good error message to show.
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Error initializing the decoder: %s (error code %u)\n",
msg, ret);
return false;
}
static bool
decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile)
{
// When LZMA_CONCATENATED flag was used when initializing the decoder,
// we need to tell lzma_code() when there will be no more input.
// This is done by setting action to LZMA_FINISH instead of LZMA_RUN
// in the same way as it is done when encoding.
//
// When LZMA_CONCATENATED isn't used, there is no need to use
// LZMA_FINISH to tell when all the input has been read, but it
// is still OK to use it if you want. When LZMA_CONCATENATED isn't
// used, the decoder will stop after the first .xz stream. In that
// case some unused data may be left in strm->next_in.
lzma_action action = LZMA_RUN;
uint8_t inbuf[BUFSIZ];
uint8_t outbuf[BUFSIZ];
strm->next_in = NULL;
strm->avail_in = 0;
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
while (true) {
if (strm->avail_in == 0 && !feof(infile)) {
strm->next_in = inbuf;
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
infile);
if (ferror(infile)) {
fprintf(stderr, "%s: Read error: %s\n",
inname, strerror(errno));
return false;
}
// Once the end of the input file has been reached,
// we need to tell lzma_code() that no more input
// will be coming. As said before, this isn't required
// if the LZMA_CONATENATED flag isn't used when
// initializing the decoder.
if (feof(infile))
action = LZMA_FINISH;
}
lzma_ret ret = lzma_code(strm, action);
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
size_t write_size = sizeof(outbuf) - strm->avail_out;
if (fwrite(outbuf, 1, write_size, outfile)
!= write_size) {
fprintf(stderr, "Write error: %s\n",
strerror(errno));
return false;
}
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
}
if (ret != LZMA_OK) {
// Once everything has been decoded successfully, the
// return value of lzma_code() will be LZMA_STREAM_END.
//
// It is important to check for LZMA_STREAM_END. Do not
// assume that getting ret != LZMA_OK would mean that
// everything has gone well or that when you aren't
// getting more output it must have successfully
// decoded everything.
if (ret == LZMA_STREAM_END)
return true;
// It's not LZMA_OK nor LZMA_STREAM_END,
// so it must be an error code. See lzma/base.h
// (src/liblzma/api/lzma/base.h in the source package
// or e.g. /usr/include/lzma/base.h depending on the
// install prefix) for the list and documentation of
// possible values. Many values listen in lzma_ret
// enumeration aren't possible in this example, but
// can be made possible by enabling memory usage limit
// or adding flags to the decoder initialization.
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_FORMAT_ERROR:
// .xz magic bytes weren't found.
msg = "The input is not in the .xz format";
break;
case LZMA_OPTIONS_ERROR:
// For example, the headers specify a filter
// that isn't supported by this liblzma
// version (or it hasn't been enabled when
// building liblzma, but no-one sane does
// that unless building liblzma for an
// embedded system). Upgrading to a newer
// liblzma might help.
//
// Note that it is unlikely that the file has
// accidentally became corrupt if you get this
// error. The integrity of the .xz headers is
// always verified with a CRC32, so
// unintentionally corrupt files can be
// distinguished from unsupported files.
msg = "Unsupported compression options";
break;
case LZMA_DATA_ERROR:
msg = "Compressed file is corrupt";
break;
case LZMA_BUF_ERROR:
// Typically this error means that a valid
// file has got truncated, but it might also
// be a damaged part in the file that makes
// the decoder think the file is truncated.
// If you prefer, you can use the same error
// message for this as for LZMA_DATA_ERROR.
msg = "Compressed file is truncated or "
"otherwise corrupt";
break;
default:
// This is most likely LZMA_PROG_ERROR.
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "%s: Decoder error: "
"%s (error code %u)\n",
inname, msg, ret);
return false;
}
}
}
extern int
main(int argc, char **argv)
{
if (argc <= 1) {
fprintf(stderr, "Usage: %s FILES...\n", argv[0]);
return EXIT_FAILURE;
}
lzma_stream strm = LZMA_STREAM_INIT;
bool success = true;
// Try to decompress all files.
for (int i = 1; i < argc; ++i) {
if (!init_decoder(&strm)) {
// Decoder initialization failed. There's no point
// to retry it so we need to exit.
success = false;
break;
}
FILE *infile = fopen(argv[i], "rb");
if (infile == NULL) {
fprintf(stderr, "%s: Error opening the "
"input file: %s\n",
argv[i], strerror(errno));
success = false;
} else {
success &= decompress(&strm, argv[i], infile, stdout);
fclose(infile);
}
}
// Free the memory allocated for the decoder. This only needs to be
// done after the last file.
lzma_end(&strm);
if (fclose(stdout)) {
fprintf(stderr, "Write error: %s\n", strerror(errno));
success = false;
}
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@ -0,0 +1,193 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file 03_compress_custom.c
/// \brief Compress in multi-call mode using x86 BCJ and LZMA2
///
/// Usage: ./03_compress_custom < INFILE > OUTFILE
///
/// Example: ./03_compress_custom < foo > foo.xz
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lzma.h>
static bool
init_encoder(lzma_stream *strm)
{
// Use the default preset (6) for LZMA2.
//
// The lzma_options_lzma structure and the lzma_lzma_preset() function
// are declared in lzma/lzma.h (src/liblzma/api/lzma/lzma.h in the
// source package or e.g. /usr/include/lzma/lzma.h depending on
// the install prefix).
lzma_options_lzma opt_lzma2;
if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) {
// It should never fail because the default preset
// (and presets 0-9 optionally with LZMA_PRESET_EXTREME)
// are supported by all stable liblzma versions.
//
// (The encoder initialization later in this function may
// still fail due to unsupported preset *if* the features
// required by the preset have been disabled at build time,
// but no-one does such things except on embedded systems.)
fprintf(stderr, "Unsupported preset, possibly a bug\n");
return false;
}
// Now we could customize the LZMA2 options if we wanted. For example,
// we could set the the dictionary size (opt_lzma2.dict_size) to
// something else than the default (8 MiB) of the default preset.
// See lzma/lzma.h for details of all LZMA2 options.
//
// The x86 BCJ filter will try to modify the x86 instruction stream so
// that LZMA2 can compress it better. The x86 BCJ filter doesn't need
// any options so it will be set to NULL below.
//
// Construct the filter chain. The uncompressed data goes first to
// the first filter in the array, in this case the x86 BCJ filter.
// The array is always terminated by setting .id = LZMA_VLI_UNKNOWN.
//
// See lzma/filter.h for more information about the lzma_filter
// structure.
lzma_filter filters[] = {
{ .id = LZMA_FILTER_X86, .options = NULL },
{ .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 },
{ .id = LZMA_VLI_UNKNOWN, .options = NULL },
};
// Initialize the encoder using the custom filter chain.
lzma_ret ret = lzma_stream_encoder(strm, filters, LZMA_CHECK_CRC64);
if (ret == LZMA_OK)
return true;
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_OPTIONS_ERROR:
// We are no longer using a plain preset so this error
// message has been edited accordingly compared to
// 01_compress_easy.c.
msg = "Specified filter chain is not supported";
break;
case LZMA_UNSUPPORTED_CHECK:
msg = "Specified integrity check is not supported";
break;
default:
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n",
msg, ret);
return false;
}
// This function is identical to the one in 01_compress_easy.c.
static bool
compress(lzma_stream *strm, FILE *infile, FILE *outfile)
{
lzma_action action = LZMA_RUN;
uint8_t inbuf[BUFSIZ];
uint8_t outbuf[BUFSIZ];
strm->next_in = NULL;
strm->avail_in = 0;
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
while (true) {
if (strm->avail_in == 0 && !feof(infile)) {
strm->next_in = inbuf;
strm->avail_in = fread(inbuf, 1, sizeof(inbuf),
infile);
if (ferror(infile)) {
fprintf(stderr, "Read error: %s\n",
strerror(errno));
return false;
}
if (feof(infile))
action = LZMA_FINISH;
}
lzma_ret ret = lzma_code(strm, action);
if (strm->avail_out == 0 || ret == LZMA_STREAM_END) {
size_t write_size = sizeof(outbuf) - strm->avail_out;
if (fwrite(outbuf, 1, write_size, outfile)
!= write_size) {
fprintf(stderr, "Write error: %s\n",
strerror(errno));
return false;
}
strm->next_out = outbuf;
strm->avail_out = sizeof(outbuf);
}
if (ret != LZMA_OK) {
if (ret == LZMA_STREAM_END)
return true;
const char *msg;
switch (ret) {
case LZMA_MEM_ERROR:
msg = "Memory allocation failed";
break;
case LZMA_DATA_ERROR:
msg = "File size limits exceeded";
break;
default:
msg = "Unknown error, possibly a bug";
break;
}
fprintf(stderr, "Encoder error: %s (error code %u)\n",
msg, ret);
return false;
}
}
}
extern int
main(void)
{
lzma_stream strm = LZMA_STREAM_INIT;
bool success = init_encoder(&strm);
if (success)
success = compress(&strm, stdin, stdout);
lzma_end(&strm);
if (fclose(stdout)) {
fprintf(stderr, "Write error: %s\n", strerror(errno));
success = false;
}
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}

23
doc/examples/Makefile Normal file
View File

@ -0,0 +1,23 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
CC = c99
CFLAGS = -g
LDFLAGS = -llzma
PROGS = \
01_compress_easy \
02_decompress \
03_compress_custom
all: $(PROGS)
.c:
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
clean:
-rm -f $(PROGS)

View File

@ -1,7 +1,7 @@
/* /*
* xz_pipe_decomp.c * xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation. * A simple example of pipe-only xz decompressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita * version: 2012-06-14 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain. * Not copyrighted -- provided to the public domain.
* *
* Compiling: * Compiling:
@ -101,6 +101,14 @@ int xz_decompress (FILE *in_file, FILE *out_file)
} while (strm.avail_out == 0); } while (strm.avail_out == 0);
} }
/* Bug fix (2012-06-14): If no errors were detected, check
that the last lzma_code() call returned LZMA_STREAM_END.
If not, the file is probably truncated. */
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "Input truncated or corrupt\n");
ret = RET_ERROR_DECOMPRESSION;
}
lzma_end (&strm); lzma_end (&strm);
return ret; return ret;
} }

View File

@ -26,7 +26,7 @@ Q: There are many LZMA related projects. How does XZ Utils relate to them?
A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly
a subset of the 7-Zip source tree. a subset of the 7-Zip source tree.
p7zip is 7-Zip's command line tools ported to POSIX-like systems. p7zip is 7-Zip's command-line tools ported to POSIX-like systems.
LZMA Utils provide a gzip-like lzma tool for POSIX-like systems. LZMA Utils provide a gzip-like lzma tool for POSIX-like systems.
LZMA Utils are based on LZMA SDK. XZ Utils are the successor to LZMA Utils are based on LZMA SDK. XZ Utils are the successor to
@ -42,7 +42,7 @@ Q: Why is liblzma named liblzma if its primary file format is .xz?
A: When the designing of the .xz format began, the idea was to replace A: When the designing of the .xz format began, the idea was to replace
the .lzma format and use the same .lzma suffix. It would have been the .lzma format and use the same .lzma suffix. It would have been
quite OK to reuse the suffix when there were very few .lzma files quite OK to reuse the suffix when there were very few .lzma files
around. However, the old .lzma format become popular before the around. However, the old .lzma format became popular before the
new format was finished. The new format was renamed to .xz but the new format was finished. The new format was renamed to .xz but the
name of liblzma wasn't changed. name of liblzma wasn't changed.
@ -73,7 +73,7 @@ A: For now, no. Since XZ Utils supports the .lzma format, it's usually
Technically, there is a way to make the conversion relatively fast Technically, there is a way to make the conversion relatively fast
(roughly twice the time that normal decompression takes). Writing (roughly twice the time that normal decompression takes). Writing
such a tool would take quite a bit time though, and would probably such a tool would take quite a bit of time though, and would probably
be useful to only a few people. If you really want such a conversion be useful to only a few people. If you really want such a conversion
tool, contact Lasse Collin and offer some money. tool, contact Lasse Collin and offer some money.
@ -84,7 +84,7 @@ Q: I have installed xz, but my tar doesn't recognize .tar.xz files.
A: xz -dc foo.tar.xz | tar xf - A: xz -dc foo.tar.xz | tar xf -
Q: Can I recover parts of a broken .xz file (e.g. corrupted CD-R)? Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)?
A: It may be possible if the file consists of multiple blocks, which A: It may be possible if the file consists of multiple blocks, which
typically is not the case if the file was created in single-threaded typically is not the case if the file was created in single-threaded
@ -94,7 +94,7 @@ A: It may be possible if the file consists of multiple blocks, which
Q: Is (some part of) XZ Utils patented? Q: Is (some part of) XZ Utils patented?
A: Lasse Collin is not aware of any patents that could affect XZ Utils. A: Lasse Collin is not aware of any patents that could affect XZ Utils.
However, due to nature of software patents, it's not possible to However, due to the nature of software patents, it's not possible to
guarantee that XZ Utils isn't affected by any third party patent(s). guarantee that XZ Utils isn't affected by any third party patent(s).
@ -105,8 +105,8 @@ A: The .xz format is documented in xz-file-format.txt. It is a container
filters. filters.
Documenting LZMA and LZMA2 is planned, but for now, there is no other Documenting LZMA and LZMA2 is planned, but for now, there is no other
documentation that the source code. Before you begin, you should know documentation than the source code. Before you begin, you should know
the basics of LZ77 and range coding algorithms. LZMA is based on LZ77, the basics of LZ77 and range-coding algorithms. LZMA is based on LZ77,
but LZMA is a lot more complex. Range coding is used to compress but LZMA is a lot more complex. Range coding is used to compress
the final bitstream like Huffman coding is used in Deflate. the final bitstream like Huffman coding is used in Deflate.
@ -148,7 +148,7 @@ A: See the documentation in XZ Embedded. In short, something like
xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB
Adjust dictionary size to get a good compromise between Adjust the dictionary size to get a good compromise between
compression ratio and decompressor memory usage. Note that compression ratio and decompressor memory usage. Note that
in single-call decompression mode of XZ Embedded, a big in single-call decompression mode of XZ Embedded, a big
dictionary doesn't increase memory usage. dictionary doesn't increase memory usage.
@ -184,10 +184,10 @@ A: It is planned and has been taken into account when designing
The third method is pigz-style threading (I use that name, because The third method is pigz-style threading (I use that name, because
pigz <http://www.zlib.net/pigz/> uses that method). It doesn't pigz <http://www.zlib.net/pigz/> uses that method). It doesn't
affect compression ratio significantly and scales to many cores. affect compression ratio significantly and scales to many cores.
The memory usage scales linearly when threads are added. It isn't The memory usage scales linearly when threads are added. This isn't
significant with pigz, because Deflate uses only 32 KiB dictionary, significant with pigz, because Deflate uses only a 32 KiB dictionary,
but with LZMA2 the memory usage will increase dramatically just like but with LZMA2 the memory usage will increase dramatically just like
with the independent blocks method. There is also a constant with the independent-blocks method. There is also a constant
computational overhead, which may make pigz-method a bit dull on computational overhead, which may make pigz-method a bit dull on
dual-core compared to the parallel match finder method, but with more dual-core compared to the parallel match finder method, but with more
cores the overhead is not a big deal anymore. cores the overhead is not a big deal anymore.
@ -197,7 +197,7 @@ A: It is planned and has been taken into account when designing
can cut the memory usage by 50 %. can cut the memory usage by 50 %.
It is possible that the single-threaded method will be modified to It is possible that the single-threaded method will be modified to
create files indentical to the pigz-style method. We'll see once create files identical to the pigz-style method. We'll see once
pigz-style threading has been implemented in liblzma. pigz-style threading has been implemented in liblzma.

View File

@ -4,12 +4,12 @@ History of LZMA Utils and XZ Utils
Tukaani distribution Tukaani distribution
In 2005, there was a small group working on Tukaani distribution, which In 2005, there was a small group working on the Tukaani distribution,
was a Slackware fork. One of the project goals was to fit the distro on which was a Slackware fork. One of the project's goals was to fit the
a single 700 MiB ISO-9660 image. Using LZMA instead of gzip helped a distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip
lot. Roughly speaking, one could fit data that took 1000 MiB in gzipped helped a lot. Roughly speaking, one could fit data that took 1000 MiB
form into 700 MiB with LZMA. Naturally compression ratio varied across in gzipped form into 700 MiB with LZMA. Naturally, the compression
packages, but this was what we got on average. ratio varied across packages, but this was what we got on average.
Slackware packages have traditionally had .tgz as the filename suffix, Slackware packages have traditionally had .tgz as the filename suffix,
which is an abbreviation of .tar.gz. A logical naming for LZMA which is an abbreviation of .tar.gz. A logical naming for LZMA
@ -30,13 +30,13 @@ Tukaani distribution
First steps of LZMA Utils First steps of LZMA Utils
The first version of LZMA Utils (4.22.0) included a shell script called The first version of LZMA Utils (4.22.0) included a shell script called
lzmash. It was wrapper that had gzip-like command line interface. It lzmash. It was a wrapper that had a gzip-like command-line interface. It
used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep, used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep,
zdiff, and related scripts from gzip were adapted work with LZMA and zdiff, and related scripts from gzip were adapted to work with LZMA and
were part of the first LZMA Utils release too. were part of the first LZMA Utils release too.
LZMA Utils 4.22.0 included also lzmadec, which was a small (less than LZMA Utils 4.22.0 included also lzmadec, which was a small (less than
10 KiB) decoder-only command line tool. It was written on top of the 10 KiB) decoder-only command-line tool. It was written on top of the
decoder-only C code found from the LZMA SDK. lzmadec was convenient in decoder-only C code found from the LZMA SDK. lzmadec was convenient in
situations where LZMA_Alone (a few hundred KiB) would be too big. situations where LZMA_Alone (a few hundred KiB) would be too big.
@ -48,33 +48,34 @@ Second generation
The lzmash script was an ugly and not very secure hack. The last The lzmash script was an ugly and not very secure hack. The last
version of LZMA Utils to use lzmash was 4.27.1. version of LZMA Utils to use lzmash was 4.27.1.
LZMA Utils 4.32.0beta1 introduced a new lzma command line tool written LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written
by Ville Koskinen. It was written in C++, and used the encoder and by Ville Koskinen. It was written in C++, and used the encoder and
decoder from C++ LZMA SDK with little modifications. This tool replaced decoder from C++ LZMA SDK with some little modifications. This tool
both the lzmash script and the LZMA_Alone command line tool in LZMA replaced both the lzmash script and the LZMA_Alone command-line tool
Utils. in LZMA Utils.
Introducing this new tool caused some temporary incompatibilities, Introducing this new tool caused some temporary incompatibilities,
because LZMA_Alone executable was simply named lzma like the new because the LZMA_Alone executable was simply named lzma like the new
command line tool, but they had completely different command line command-line tool, but they had a completely different command-line
interface. The file format was still the same. interface. The file format was still the same.
Lasse wrote liblzmadec, which was a small decoder-only library based Lasse wrote liblzmadec, which was a small decoder-only library based
on the C code found from LZMA SDK. liblzmadec had API similar to zlib, on the C code found from LZMA SDK. liblzmadec had an API similar to
although there were some significant differences, which made it zlib, although there were some significant differences, which made it
non-trivial to use it in some applications designed for zlib and non-trivial to use it in some applications designed for zlib and
libbzip2. libbzip2.
The lzmadec command line tool was converted to use liblzmadec. The lzmadec command-line tool was converted to use liblzmadec.
Alexandre Sauvé helped converting build system to use GNU Autotools. Alexandre Sauvé helped converting the build system to use GNU
This made is easier to test for certain less portable features needed Autotools. This made it easier to test for certain less portable
by the new command line tool. features needed by the new command-line tool.
Since the new command line tool never got completely finished (for Since the new command-line tool never got completely finished (for
example, it didn't support LZMA_OPT environment variable), the intent example, it didn't support the LZMA_OPT environment variable), the
was to not call 4.32.x stable. Similarly, liblzmadec wasn't polished, intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't
but appeared to work well enough, so some people started using it too. polished, but appeared to work well enough, so some people started
using it too.
Because the development of the third generation of LZMA Utils was Because the development of the third generation of LZMA Utils was
delayed considerably (3-4 years), the 4.32.x branch had to be kept delayed considerably (3-4 years), the 4.32.x branch had to be kept
@ -85,16 +86,16 @@ Second generation
File format problems File format problems
The file format used by LZMA_Alone was primitive. It was designed for The file format used by LZMA_Alone was primitive. It was designed with
embedded systems in mind, and thus provided only minimal set of embedded systems in mind, and thus provided only a minimal set of
features. The two biggest problems for non-embedded use were lack of features. The two biggest problems for non-embedded use were the lack
magic bytes and integrity check. of magic bytes and an integrity check.
Igor and Lasse started developing a new file format with some help Igor and Lasse started developing a new file format with some help
from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin, from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin,
and Lars Wirzenius helped with some minor things at some point of the and Lars Wirzenius helped with some minor things at some point of the
development. Designing the new format took quite a long time (actually, development. Designing the new format took quite a long time (actually,
too long time would be more appropriate expression). It was mostly too long a time would be a more appropriate expression). It was mostly
because Lasse was quite slow at getting things done due to personal because Lasse was quite slow at getting things done due to personal
reasons. reasons.
@ -102,7 +103,7 @@ File format problems
that was already used by the old file format. Switching to the new that was already used by the old file format. Switching to the new
format wouldn't have caused much trouble when the old format wasn't format wouldn't have caused much trouble when the old format wasn't
used by many people. But since the development of the new format took used by many people. But since the development of the new format took
so long time, the old format got quite popular, and it was decided such a long time, the old format got quite popular, and it was decided
that the new file format must use a different suffix. that the new file format must use a different suffix.
It was decided to use .xz as the suffix of the new file format. The It was decided to use .xz as the suffix of the new file format. The
@ -125,13 +126,13 @@ Transition to XZ Utils
The early versions of XZ Utils were called LZMA Utils. The first The early versions of XZ Utils were called LZMA Utils. The first
releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK. releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK.
The code was still directly based on LZMA SDK but ported to C and The code was still directly based on LZMA SDK but ported to C and
converted from callback API to stateful API. Later, Igor Pavlov made converted from a callback API to a stateful API. Later, Igor Pavlov
C version of the LZMA encoder too; these ports from C++ to C were made a C version of the LZMA encoder too; these ports from C++ to C
independent in LZMA SDK and LZMA Utils. were independent in LZMA SDK and LZMA Utils.
The core of the new LZMA Utils was liblzma, a compression library with The core of the new LZMA Utils was liblzma, a compression library with
zlib-like API. liblzma supported both the old and new file format. The a zlib-like API. liblzma supported both the old and new file format.
gzip-like lzma command line tool was rewritten to use liblzma. The gzip-like lzma command-line tool was rewritten to use liblzma.
The new LZMA Utils code base was renamed to XZ Utils when the name The new LZMA Utils code base was renamed to XZ Utils when the name
of the new file format had been decided. The liblzma compression of the new file format had been decided. The liblzma compression
@ -139,7 +140,7 @@ Transition to XZ Utils
caused unnecessary breakage in applications already using the early caused unnecessary breakage in applications already using the early
liblzma snapshots. liblzma snapshots.
The xz command line tool can emulate the gzip-like lzma tool by The xz command-line tool can emulate the gzip-like lzma tool by
creating appropriate symlinks (e.g. lzma -> xz). Thus, practically creating appropriate symlinks (e.g. lzma -> xz). Thus, practically
all scripts using the lzma tool from LZMA Utils will work as is with all scripts using the lzma tool from LZMA Utils will work as is with
XZ Utils (and will keep using the old .lzma format). Still, the .lzma XZ Utils (and will keep using the old .lzma format). Still, the .lzma

View File

@ -40,7 +40,7 @@ The .lzma File Format
0.2. Changes 0.2. Changes
Last modified: 2009-05-01 11:15+0300 Last modified: 2011-04-12 11:55+0300
1. File Format 1. File Format
@ -161,6 +161,6 @@ The .lzma File Format
XZ Utils - The next generation of LZMA Utils XZ Utils - The next generation of LZMA Utils
http://tukaani.org/xz/ http://tukaani.org/xz/
The .xz file format - The successor of the the .lzma format The .xz file format - The successor of the .lzma format
http://tukaani.org/xz/xz-file-format.txt http://tukaani.org/xz/xz-file-format.txt

View File

@ -16,7 +16,7 @@ CC = gcc
STRIP = strip STRIP = strip
CPPFLAGS = CPPFLAGS =
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2 CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
LDFLAGS = LDFLAGS = -lemu
# NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0 # NOTE: -fgnu89-inline is needed on DJGPP 2.04 beta and GCC >= 4.3.0
# because time.h uses GNU-style "extern inline". # because time.h uses GNU-style "extern inline".

View File

@ -1,279 +0,0 @@
##### http://autoconf-archive.cryp.to/acx_pthread.html
#
# SYNOPSIS
#
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads.
# It sets the PTHREAD_LIBS output variable to the threads library and
# linker flags, and the PTHREAD_CFLAGS output variable to any special
# C compiler flags that are needed. (The user can also force certain
# compiler flags/libs to be tested by setting these environment
# variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise).
# (This is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these
# flags, but also link it with them as well. e.g. you should link
# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
# $LIBS
#
# If you are only building threads programs, you may wish to use
# these variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads
# library is found, and ACTION-IF-NOT-FOUND is a list of commands to
# run it if it is not found. If ACTION-IF-FOUND is not specified, the
# default action will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or
# if you have any other suggestions or comments. This macro was based
# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/)
# (with help from M. Frigo), as well as ac_pthread and hb_pthread
# macros posted by Alejandro Forero Cuervo to the autoconf macro
# repository. We are also grateful for the helpful feedback of
# numerous users.
#
# LAST MODIFICATION
#
# 2007-07-29
#
# COPYLEFT
#
# Copyright (c) 2007 Steven G. Johnson <stevenj@alum.mit.edu>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright
# owner gives unlimited permission to copy, distribute and modify the
# configure scripts that are the output of Autoconf when processing
# the Macro. You need not follow the terms of the GNU General Public
# License when using or distributing such scripts, even though
# portions of the text of the Macro appear in them. The GNU General
# Public License (GPL) does govern all other use of the material that
# constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the
# Autoconf Macro released by the Autoconf Macro Archive. When you
# make and distribute a modified version of the Autoconf Macro, you
# may extend this special exception to the GPL to apply to your
# modified version as well.
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
if test x"$acx_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
[attr_name=$attr; break])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD

332
m4/ax_pthread.m4 Normal file
View File

@ -0,0 +1,332 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 21
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case ${host_os} in
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
esac
# Clang doesn't consider unrecognized options an error unless we specify
# -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
CFLAGS="$save_CFLAGS"
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done
AC_MSG_RESULT([$attr_name])
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case ${host_os} in
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
# TODO: What about Clang on Solaris?
flag="-mt -D_REENTRANT"
fi
;;
esac
AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != xyes; then
case $host_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@ -53,7 +53,8 @@ AC_CACHE_CHECK([how to detect the amount of physical memory],
# a non-compilable text instead of #error to generate an error. # a non-compilable text instead of #error to generate an error.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \ #if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|| defined(__DJGPP__) || defined(__VMS) || defined(__DJGPP__) || defined(__VMS) \
|| defined(AMIGA) || defined(__AROS__)
int main(void) { return 0; } int main(void) { return 0; }
#else #else
compile error compile error

113
macosx/build.sh Executable file
View File

@ -0,0 +1,113 @@
#!/bin/sh
###############################################################################
# Author: Anders F Björklund <afb@users.sourceforge.net>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
###############################################################################
mkdir -p Root
mkdir -p Resources
# Abort immediately if something goes wrong.
set -e
GCC="gcc-4.2"
SDK="/Developer/SDKs/MacOSX10.5.sdk"
MDT="10.5"
GTT=i686-apple-darwin9
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
ARCHES2="-arch ppc -arch i386"
PKGFORMAT="10.5" # xar
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
# Clean up if it was already configured.
[ -f Makefile ] && make distclean
# Build the regular fat program
CC="$GCC" \
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
make
make check
make DESTDIR=`pwd`/Root install
make distclean
# Build the size-optimized program
CC="$GCC" \
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
make -C src/liblzma
make -C src/xzdec
make -C src/xzdec DESTDIR=`pwd`/Root install
cp -a ../extra Root/usr/local/share/doc/xz
make distclean
# Move development files to different package
test -d liblzma && rm -r liblzma
mkdir -p liblzma/usr/local
mv Root/usr/local/include liblzma/usr/local
mv Root/usr/local/lib liblzma/usr/local
mkdir -p Root/usr/local/lib
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
mkdir -p liblzma/usr/local/share/doc/xz
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
# Strip debugging symbols and make relocatable
for bin in xz lzmainfo xzdec lzmadec; do
strip -S Root/usr/local/bin/$bin
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
done
for lib in liblzma.5.dylib; do
strip -S Root/usr/local/lib/$lib
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
done
# Create tarball, but without the HFS+ attrib
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
# Include documentation files for package
cp -p ../README Resources/ReadMe.txt
cp -p ../COPYING Resources/License.txt
# Make an Installer.app package
ID="org.tukaani.xz"
VERSION=`cd ..; sh build-aux/version.sh`
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
# Put the package in a disk image
if [ "$PKGFORMAT" != "10.5" ]; then
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
hdiutil internet-enable -yes -quiet XZ.dmg
fi
echo
echo "Build completed successfully."
echo

View File

@ -1,3 +1,5 @@
cs cs
de de
fr
it it
pl

178
po/de.po
View File

@ -1,14 +1,14 @@
# XZ Utils German translation # XZ Utils German translation
# This file is put in the public domain. # This file is put in the public domain.
# Andre Noll <maan@systemlinux.org>, 2010. # Andre Noll <maan@tuebingen.mpg.de>, 2010.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: XZ Utils 4.999.9beta\n" "Project-Id-Version: XZ Utils 4.999.9beta\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2010-09-11 17:07+0200\n" "POT-Creation-Date: 2012-05-29 17:20+0200\n"
"PO-Revision-Date: 2010-09-07 20:27+0200\n" "PO-Revision-Date: 2010-09-07 20:27+0200\n"
"Last-Translator: <maan@systemlinux.org>\n" "Last-Translator: <maan@tuebingen.mpg.de>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -96,7 +96,7 @@ msgid "%s: File seems to have been moved, not removing"
msgstr "" msgstr ""
"%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht" "%s: Datei scheint umbenannt worden zu sein, daher wird sie nicht gelöscht"
#: src/xz/file_io.c:144 src/xz/file_io.c:590 #: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format #, c-format
msgid "%s: Cannot remove: %s" msgid "%s: Cannot remove: %s"
msgstr "%s: Kann nicht löschen: %s" msgstr "%s: Kann nicht löschen: %s"
@ -126,59 +126,59 @@ msgstr "%s: Überspringe symbolischen Verweis"
msgid "%s: Is a directory, skipping" msgid "%s: Is a directory, skipping"
msgstr "%s: Überspringe Verzeichnis" msgstr "%s: Überspringe Verzeichnis"
#: src/xz/file_io.c:462 #: src/xz/file_io.c:461
#, c-format #, c-format
msgid "%s: Not a regular file, skipping" msgid "%s: Not a regular file, skipping"
msgstr "%s: Keine reguläre Datei, überspringe" msgstr "%s: Keine reguläre Datei, überspringe"
#: src/xz/file_io.c:479 #: src/xz/file_io.c:478
#, c-format #, c-format
msgid "%s: File has setuid or setgid bit set, skipping" msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Datei hat das setuid oder setgid Bit gesetzt, überspringe" msgstr "%s: Datei hat das setuid oder setgid Bit gesetzt, überspringe"
#: src/xz/file_io.c:486 #: src/xz/file_io.c:485
#, c-format #, c-format
msgid "%s: File has sticky bit set, skipping" msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Datei hat sticky Bit gesetzt, überspringe" msgstr "%s: Datei hat sticky Bit gesetzt, überspringe"
#: src/xz/file_io.c:493 #: src/xz/file_io.c:492
#, c-format #, c-format
msgid "%s: Input file has more than one hard link, skipping" msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Eingabedatei hat mehr als einen hard link, überspringe" msgstr "%s: Eingabedatei hat mehr als einen hard link, überspringe"
#: src/xz/file_io.c:714 #: src/xz/file_io.c:713
#, c-format #, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s" msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "" msgstr ""
"Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s" "Fehler beim Wiederherstellen des O_APPEND flags bei Standard Output: %s"
#: src/xz/file_io.c:726 #: src/xz/file_io.c:725
#, c-format #, c-format
msgid "%s: Closing the file failed: %s" msgid "%s: Closing the file failed: %s"
msgstr "%s: Fehler beim Schießen der Datei: %s" msgstr "%s: Fehler beim Schließen der Datei: %s"
#: src/xz/file_io.c:762 src/xz/file_io.c:946 #: src/xz/file_io.c:761 src/xz/file_io.c:945
#, c-format #, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s" msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "" msgstr ""
"%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s" "%s: Positionierungsfehler beim Versuch eine sparse Datei zu erzeugen: %s"
#: src/xz/file_io.c:821 #: src/xz/file_io.c:820
#, c-format #, c-format
msgid "%s: Read error: %s" msgid "%s: Read error: %s"
msgstr "%s: Lesefehler: %s" msgstr "%s: Lesefehler: %s"
#: src/xz/file_io.c:844 #: src/xz/file_io.c:843
#, c-format #, c-format
msgid "%s: Error seeking the file: %s" msgid "%s: Error seeking the file: %s"
msgstr "%s: Fehler beim Lesen der Dateinamen: %s" msgstr "%s: Fehler beim Lesen der Dateinamen: %s"
#: src/xz/file_io.c:854 #: src/xz/file_io.c:853
#, c-format #, c-format
msgid "%s: Unexpected end of file" msgid "%s: Unexpected end of file"
msgstr "%s: Unerwartetes Ende der Datei" msgstr "%s: Unerwartetes Ende der Datei"
#: src/xz/file_io.c:904 #: src/xz/file_io.c:903
#, c-format #, c-format
msgid "%s: Write error: %s" msgid "%s: Write error: %s"
msgstr "%s: Schreibfehler: %s" msgstr "%s: Schreibfehler: %s"
@ -212,7 +212,7 @@ msgstr "Kein"
#. but the Check ID is known (here 2). This and other "Unknown-N" #. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten #. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if #. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter. #. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69 #: src/xz/list.c:69
msgid "Unknown-2" msgid "Unknown-2"
msgstr "Unbek.2" msgstr "Unbek.2"
@ -275,41 +275,41 @@ msgstr "%s: Zu klein um ein gültiges .xz file zu sein"
#. to Ratio, the columns are right aligned. Check and Filename #. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to #. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz". #. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612 #: src/xz/list.c:603
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname" msgstr " Str. Blöcke Kompr. Unkompr. Verh. Check Dateiname"
#: src/xz/list.c:652 #: src/xz/list.c:643
#, c-format #, c-format
msgid " Streams: %s\n" msgid " Streams: %s\n"
msgstr " Ströme: %s\n" msgstr " Ströme: %s\n"
#: src/xz/list.c:654 #: src/xz/list.c:645
#, c-format #, c-format
msgid " Blocks: %s\n" msgid " Blocks: %s\n"
msgstr " Blöcke: %s\n" msgstr " Blöcke: %s\n"
#: src/xz/list.c:656 #: src/xz/list.c:647
#, c-format #, c-format
msgid " Compressed size: %s\n" msgid " Compressed size: %s\n"
msgstr " Größe komprimiert: %s\n" msgstr " Größe komprimiert: %s\n"
#: src/xz/list.c:659 #: src/xz/list.c:650
#, c-format #, c-format
msgid " Uncompressed size: %s\n" msgid " Uncompressed size: %s\n"
msgstr " Größe unkomprimiert: %s\n" msgstr " Größe unkomprimiert: %s\n"
#: src/xz/list.c:662 #: src/xz/list.c:653
#, c-format #, c-format
msgid " Ratio: %s\n" msgid " Ratio: %s\n"
msgstr " Verhältnis: %s\n" msgstr " Verhältnis: %s\n"
#: src/xz/list.c:664 #: src/xz/list.c:655
#, c-format #, c-format
msgid " Check: %s\n" msgid " Check: %s\n"
msgstr " Check: %s\n" msgstr " Check: %s\n"
#: src/xz/list.c:665 #: src/xz/list.c:656
#, c-format #, c-format
msgid " Stream padding: %s\n" msgid " Stream padding: %s\n"
msgstr " Strom Auffüllung: %s\n" msgstr " Strom Auffüllung: %s\n"
@ -317,7 +317,7 @@ msgstr " Strom Auffüllung: %s\n"
#. TRANSLATORS: The second line is column headings. All except #. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with #. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz". #. "xz -lv foo.xz".
#: src/xz/list.c:693 #: src/xz/list.c:684
msgid "" msgid ""
" Streams:\n" " Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize " " Stream Blocks CompOffset UncompOffset CompSize "
@ -329,7 +329,7 @@ msgstr ""
#. TRANSLATORS: The second line is column headings. All #. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned. #. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748 #: src/xz/list.c:739
#, c-format #, c-format
msgid "" msgid ""
" Blocks:\n" " Blocks:\n"
@ -347,53 +347,53 @@ msgstr ""
#. are right aligned. %*s is replaced with 0-120 #. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough. #. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz". #. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760 #: src/xz/list.c:751
#, c-format #, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter" msgstr " CheckWert %*s Kopf Schalter KompGröße Speicher Filter"
#: src/xz/list.c:838 src/xz/list.c:1007 #: src/xz/list.c:829 src/xz/list.c:998
#, c-format #, c-format
msgid " Memory needed: %s MiB\n" msgid " Memory needed: %s MiB\n"
msgstr " Benötigter Speicher: %s MiB\n" msgstr " Benötigter Speicher: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009 #: src/xz/list.c:831 src/xz/list.c:1000
#, c-format #, c-format
msgid " Sizes in headers: %s\n" msgid " Sizes in headers: %s\n"
msgstr " Größe in Köpfen: %s\n" msgstr " Größe in Köpfen: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010 #: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes" msgid "Yes"
msgstr "Ja" msgstr "Ja"
#: src/xz/list.c:841 src/xz/list.c:1010 #: src/xz/list.c:832 src/xz/list.c:1001
msgid "No" msgid "No"
msgstr "Nein" msgstr "Nein"
#. TRANSLATORS: %s is an integer. Only the plural form of this #. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". #. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:986 #: src/xz/list.c:977
#, c-format #, c-format
msgid "%s file\n" msgid "%s file\n"
msgid_plural "%s files\n" msgid_plural "%s files\n"
msgstr[0] "%s Datei\n" msgstr[0] "%s Datei\n"
msgstr[1] "%s Dateien\n" msgstr[1] "%s Dateien\n"
#: src/xz/list.c:999 #: src/xz/list.c:990
msgid "Totals:" msgid "Totals:"
msgstr "Gesamt:" msgstr "Gesamt:"
#: src/xz/list.c:1000 #: src/xz/list.c:991
#, c-format #, c-format
msgid " Number of files: %s\n" msgid " Number of files: %s\n"
msgstr " Anzahl Dateien: %s\n" msgstr " Anzahl Dateien: %s\n"
#: src/xz/list.c:1072 #: src/xz/list.c:1063
msgid "--list works only on .xz files (--format=xz or --format=auto)" msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "" msgstr ""
"--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)" "--list funktioniert nur mit .xz Dateien (--format=xz oder --format=auto)"
#: src/xz/list.c:1078 #: src/xz/list.c:1069
msgid "--list does not support reading from standard input" msgid "--list does not support reading from standard input"
msgstr "--list unterstützt kein Lesen der Standardeingabe" msgstr "--list unterstützt kein Lesen der Standardeingabe"
@ -428,60 +428,73 @@ msgstr ""
"Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von " "Lesen der Standardeingabe ist nicht möglich, wenn die Dateinamen auch von "
"der Standardeingabe gelesen werden" "der Standardeingabe gelesen werden"
#: src/xz/message.c:800 src/xz/message.c:844 #. TRANSLATORS: This is the program name in the beginning
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:733
#, c-format
msgid "%s: "
msgstr ""
#: src/xz/message.c:796 src/xz/message.c:846
msgid "Internal error (bug)" msgid "Internal error (bug)"
msgstr "Interner Fehler (Bug)" msgstr "Interner Fehler (Bug)"
#: src/xz/message.c:807 #: src/xz/message.c:803
msgid "Cannot establish signal handlers" msgid "Cannot establish signal handlers"
msgstr "Kann Signal Routine nicht setzen" msgstr "Kann Signal Routine nicht setzen"
#: src/xz/message.c:816 #: src/xz/message.c:812
msgid "No integrity check; not verifying file integrity" msgid "No integrity check; not verifying file integrity"
msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen" msgstr "Kein Integritäts-Check; werde Datei-Integrität nicht überprüfen"
#: src/xz/message.c:819 #: src/xz/message.c:815
msgid "Unsupported type of integrity check; not verifying file integrity" msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "" msgstr ""
"Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht " "Typ des Integritäts-Checks nicht unterstützt; werde Datei-Integrität nicht "
"überprüfen" "überprüfen"
#: src/xz/message.c:826 #: src/xz/message.c:822
msgid "Memory usage limit reached" msgid "Memory usage limit reached"
msgstr "Speicher-Limit erreicht" msgstr "Speicher-Limit erreicht"
#: src/xz/message.c:829 #: src/xz/message.c:825
msgid "File format not recognized" msgid "File format not recognized"
msgstr "Datei Format nicht erkannt" msgstr "Datei Format nicht erkannt"
#: src/xz/message.c:832 #: src/xz/message.c:828
msgid "Unsupported options" msgid "Unsupported options"
msgstr "Optionen nicht unterstützt" msgstr "Optionen nicht unterstützt"
#: src/xz/message.c:835 #: src/xz/message.c:831
msgid "Compressed data is corrupt" msgid "Compressed data is corrupt"
msgstr "Komprimierte Daten sind korrupt" msgstr "Komprimierte Daten sind korrupt"
#: src/xz/message.c:838 #: src/xz/message.c:834
msgid "Unexpected end of input" msgid "Unexpected end of input"
msgstr "Unerwartetes Eingabe Ende" msgstr "Unerwartetes Eingabe Ende"
#: src/xz/message.c:886 #: src/xz/message.c:867
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "%s MiB Speicher wird benötigt. Der Begrenzer ist deaktiviert."
#: src/xz/message.c:895
#, c-format #, c-format
msgid "%s MiB of memory is required. The limit is %s." msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB Speicher wird benötigt. Limit ist %s." msgstr "%s MiB Speicher wird benötigt. Limit ist %s."
#: src/xz/message.c:1053 #: src/xz/message.c:1062
#, c-format #, c-format
msgid "%s: Filter chain: %s\n" msgid "%s: Filter chain: %s\n"
msgstr "%s: Filter Kette: %s\n" msgstr "%s: Filter Kette: %s\n"
#: src/xz/message.c:1063 #: src/xz/message.c:1072
#, c-format #, c-format
msgid "Try `%s --help' for more information." msgid "Try `%s --help' for more information."
msgstr "Versuchen Sie `%s --help' für mehr Informationen." msgstr "Versuchen Sie `%s --help' für mehr Informationen."
#: src/xz/message.c:1089 #: src/xz/message.c:1098
#, c-format #, c-format
msgid "" msgid ""
"Usage: %s [OPTION]... [FILE]...\n" "Usage: %s [OPTION]... [FILE]...\n"
@ -492,18 +505,18 @@ msgstr ""
"Komprimiert oder dekomprimiert .xz DATEI(EN).\n" "Komprimiert oder dekomprimiert .xz DATEI(EN).\n"
"\n" "\n"
#: src/xz/message.c:1096 #: src/xz/message.c:1105
msgid "" msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n" "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr "" msgstr ""
"Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n" "Obligatorische Argumente für lange Optionen sind auch für kurze Optionen\n"
"zwingend.\n" "zwingend.\n"
#: src/xz/message.c:1100 #: src/xz/message.c:1109
msgid " Operation mode:\n" msgid " Operation mode:\n"
msgstr " Operationsmodus:\n" msgstr " Operationsmodus:\n"
#: src/xz/message.c:1103 #: src/xz/message.c:1112
msgid "" msgid ""
" -z, --compress force compression\n" " -z, --compress force compression\n"
" -d, --decompress force decompression\n" " -d, --decompress force decompression\n"
@ -515,7 +528,7 @@ msgstr ""
" -t, --test überprüfe Datei Integrität\n" " -t, --test überprüfe Datei Integrität\n"
" -l, --list liste Datei Informationen" " -l, --list liste Datei Informationen"
#: src/xz/message.c:1109 #: src/xz/message.c:1118
msgid "" msgid ""
"\n" "\n"
" Operation modifiers:\n" " Operation modifiers:\n"
@ -523,7 +536,7 @@ msgstr ""
"\n" "\n"
" Operationsmodifikatoren:\n" " Operationsmodifikatoren:\n"
#: src/xz/message.c:1112 #: src/xz/message.c:1121
msgid "" msgid ""
" -k, --keep keep (don't delete) input files\n" " -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n" " -f, --force force overwrite of output file and (de)compress links\n"
@ -535,7 +548,7 @@ msgstr ""
" -c, --stdout schreibe nach Standard Output und lösche nicht die\n" " -c, --stdout schreibe nach Standard Output und lösche nicht die\n"
" Eingabedateien" " Eingabedateien"
#: src/xz/message.c:1118 #: src/xz/message.c:1127
msgid "" msgid ""
" --no-sparse do not create sparse files when decompressing\n" " --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
@ -554,7 +567,7 @@ msgstr ""
" --files0=[DATEI] wie --files, aber benutze den Null Charakter als " " --files0=[DATEI] wie --files, aber benutze den Null Charakter als "
"Trenner" "Trenner"
#: src/xz/message.c:1126 #: src/xz/message.c:1135
msgid "" msgid ""
"\n" "\n"
" Basic file format and compression options:\n" " Basic file format and compression options:\n"
@ -562,7 +575,7 @@ msgstr ""
"\n" "\n"
" Grundlegende Optionen für Dateiformat und Kompression:\n" " Grundlegende Optionen für Dateiformat und Kompression:\n"
#: src/xz/message.c:1128 #: src/xz/message.c:1137
msgid "" msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n" " -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n" " `auto' (default), `xz', `lzma', and `raw'\n"
@ -578,7 +591,7 @@ msgstr ""
"`crc32',\n" "`crc32',\n"
" `crc64' (Voreinstellung), oder `sha256'" " `crc64' (Voreinstellung), oder `sha256'"
#: src/xz/message.c:1135 #: src/xz/message.c:1144
msgid "" msgid ""
" -0 ... -9 compression preset; default is 6; take compressor " " -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n" "*and*\n"
@ -591,7 +604,7 @@ msgstr ""
"des\n" "des\n"
" Dekomprimierers, wenn Sie 7-9 benutzen!" " Dekomprimierers, wenn Sie 7-9 benutzen!"
#: src/xz/message.c:1139 #: src/xz/message.c:1148
msgid "" msgid ""
" -e, --extreme try to improve compression ratio by using more CPU " " -e, --extreme try to improve compression ratio by using more CPU "
"time;\n" "time;\n"
@ -602,7 +615,7 @@ msgstr ""
" verhältnis zu verbessern. Das beeinflusst nicht den\n" " verhältnis zu verbessern. Das beeinflusst nicht den\n"
" Speicherbedarf des Dekomprimierers." " Speicherbedarf des Dekomprimierers."
#: src/xz/message.c:1144 #: src/xz/message.c:1153
#, no-c-format #, no-c-format
msgid "" msgid ""
" --memlimit-compress=LIMIT\n" " --memlimit-compress=LIMIT\n"
@ -619,7 +632,7 @@ msgstr ""
"RAM,\n" "RAM,\n"
" oder 0 für Grundeinstellungen." " oder 0 für Grundeinstellungen."
#: src/xz/message.c:1151 #: src/xz/message.c:1160
msgid "" msgid ""
" --no-adjust if compression settings exceed the memory usage " " --no-adjust if compression settings exceed the memory usage "
"limit,\n" "limit,\n"
@ -631,7 +644,7 @@ msgstr ""
"statt\n" "statt\n"
" die Einstellungen nach unten anzupassen." " die Einstellungen nach unten anzupassen."
#: src/xz/message.c:1157 #: src/xz/message.c:1166
msgid "" msgid ""
"\n" "\n"
" Custom filter chain for compression (alternative for using presets):" " Custom filter chain for compression (alternative for using presets):"
@ -639,7 +652,7 @@ msgstr ""
"\n" "\n"
" User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):" " User-definierte Filter Kette für Kompression (alternativ zu Voreinstellung):"
#: src/xz/message.c:1166 #: src/xz/message.c:1175
msgid "" msgid ""
"\n" "\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero " " --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
@ -683,7 +696,7 @@ msgstr ""
" depth=NUM Maximale Suchtiefe; 0=automatisch\n" " depth=NUM Maximale Suchtiefe; 0=automatisch\n"
" (Voreinstellung)" " (Voreinstellung)"
#: src/xz/message.c:1181 #: src/xz/message.c:1190
msgid "" msgid ""
"\n" "\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@ -706,7 +719,7 @@ msgstr ""
" start=NUM Start-Offset für Konversion\n" " start=NUM Start-Offset für Konversion\n"
" (Voreinstellung=0)" " (Voreinstellung=0)"
#: src/xz/message.c:1193 #: src/xz/message.c:1202
msgid "" msgid ""
"\n" "\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" " --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@ -720,7 +733,7 @@ msgstr ""
"voneinander\n" "voneinander\n"
" subtrahiert werden (1-256; 1)" " subtrahiert werden (1-256; 1)"
#: src/xz/message.c:1201 #: src/xz/message.c:1210
msgid "" msgid ""
"\n" "\n"
" Other options:\n" " Other options:\n"
@ -728,7 +741,7 @@ msgstr ""
"\n" "\n"
" Andere Optionen:\n" " Andere Optionen:\n"
#: src/xz/message.c:1204 #: src/xz/message.c:1213
msgid "" msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors " " -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n" "too\n"
@ -740,25 +753,25 @@ msgstr ""
"noch\n" "noch\n"
" gesprächiger zu sein" " gesprächiger zu sein"
#: src/xz/message.c:1209 #: src/xz/message.c:1218
msgid " -Q, --no-warn make warnings not affect the exit status" msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn Warnungen verändern nicht den exit status" msgstr " -Q, --no-warn Warnungen verändern nicht den exit status"
#: src/xz/message.c:1211 #: src/xz/message.c:1220
msgid "" msgid ""
" --robot use machine-parsable messages (useful for scripts)" " --robot use machine-parsable messages (useful for scripts)"
msgstr "" msgstr ""
" --robot benutze Maschinen-lesbare Meldungen (nützlich für\n" " --robot benutze Maschinen-lesbare Meldungen (nützlich für\n"
" Skripte)" " Skripte)"
#: src/xz/message.c:1214 #: src/xz/message.c:1223
msgid "" msgid ""
" --info-memory display the total amount of RAM and the currently " " --info-memory display the total amount of RAM and the currently "
"active\n" "active\n"
" memory usage limits, and exit" " memory usage limits, and exit"
msgstr " --info-memory zeige Speicherlimit an und terminiere" msgstr " --info-memory zeige Speicherlimit an und terminiere"
#: src/xz/message.c:1217 #: src/xz/message.c:1226
msgid "" msgid ""
" -h, --help display the short help (lists only the basic options)\n" " -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit" " -H, --long-help display this long help and exit"
@ -767,7 +780,7 @@ msgstr ""
" Optionen)\n" " Optionen)\n"
" -H, --long-help zeige diese lange Hilfe an und terminiere" " -H, --long-help zeige diese lange Hilfe an und terminiere"
#: src/xz/message.c:1221 #: src/xz/message.c:1230
msgid "" msgid ""
" -h, --help display this short help and exit\n" " -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)" " -H, --long-help display the long help (lists also the advanced options)"
@ -777,11 +790,11 @@ msgstr ""
"fortgeschrittene\n" "fortgeschrittene\n"
" Optionen an)" " Optionen an)"
#: src/xz/message.c:1226 #: src/xz/message.c:1235
msgid " -V, --version display the version number and exit" msgid " -V, --version display the version number and exit"
msgstr " -V, --version zeige Versionsnummer an und terminiere" msgstr " -V, --version zeige Versionsnummer an und terminiere"
#: src/xz/message.c:1228 #: src/xz/message.c:1237
msgid "" msgid ""
"\n" "\n"
"With no FILE, or when FILE is -, read standard input.\n" "With no FILE, or when FILE is -, read standard input.\n"
@ -794,15 +807,14 @@ msgstr ""
#. for this package. Please add _another line_ saying #. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW #. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks. #. address for translation bugs. Thanks.
#: src/xz/message.c:1234 #: src/xz/message.c:1243
#, c-format #, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n" msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr "" msgstr ""
"Melde Bugs an <%s> (in englisch oder finnisch).\n" "Melde Bugs an <%s> (in englisch oder finnisch).\n"
"Melde Übersetzungsfehler an <maan@systemlinux.org> (in englisch oder " "Melde Übersetzungsfehler an <maan@tuebingen.mpg.de> (in englisch oder deutsch).\n"
"deutsch).\n"
#: src/xz/message.c:1236 #: src/xz/message.c:1245
#, c-format #, c-format
msgid "%s home page: <%s>\n" msgid "%s home page: <%s>\n"
msgstr "%s Homepage: <%s>\n" msgstr "%s Homepage: <%s>\n"
@ -840,7 +852,7 @@ msgstr ""
"Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht " "Der ausgewählte Algorithmus zum Auffinden von Übereinstimmungen braucht "
"mindestens nice=%<PRIu32>" "mindestens nice=%<PRIu32>"
#: src/xz/suffix.c:79 src/xz/suffix.c:164 #: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format #, c-format
msgid "" msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
@ -848,17 +860,17 @@ msgstr ""
"%s: Mit --format=raw ist --sufix=.SUF notwendig, falls nicht nach stdout " "%s: Mit --format=raw ist --sufix=.SUF notwendig, falls nicht nach stdout "
"geschrieben wird" "geschrieben wird"
#: src/xz/suffix.c:99 #: src/xz/suffix.c:121
#, c-format #, c-format
msgid "%s: Filename has an unknown suffix, skipping" msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Dateiname hat unbekannte Endung, überspringe" msgstr "%s: Dateiname hat unbekannte Endung, überspringe"
#: src/xz/suffix.c:154 #: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format #, c-format
msgid "%s: File already has `%s' suffix, skipping" msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Datei hat bereits `%s' Endung, überspringe" msgstr "%s: Datei hat bereits `%s' Endung, überspringe"
#: src/xz/suffix.c:205 #: src/xz/suffix.c:235
#, c-format #, c-format
msgid "%s: Invalid filename suffix" msgid "%s: Invalid filename suffix"
msgstr "%s: Ungültige Datei Endung" msgstr "%s: Ungültige Datei Endung"

841
po/fr.po Normal file
View File

@ -0,0 +1,841 @@
# XZ Utils French Translation
# This file is put in the public domain.
# Adrien Nader <adrien@notk.org>, 2011-2014.
#
msgid ""
msgstr ""
"Project-Id-Version: xz-utils\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2014-12-20 20:45+0200\n"
"PO-Revision-Date: 2010-09-24 21;12+0200\n"
"Last-Translator: Adrien Nader <adrien@notk.org>\n"
"Language-Team: None\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n==1) ? 0 : 1;\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s : Format de fichier inconnu"
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s : Type de vérification d'intégrité inconnu"
#: src/xz/args.c:382
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "Un seul fichier peut être spécifié avec `--files' ou `--files0'."
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "La variable d'environnement %s contient trop d'arguments"
#: src/xz/coder.c:99
msgid "Maximum number of filters is four"
msgstr "Le nombre maximal de filtres est quatre"
#: src/xz/coder.c:118
msgid "Memory usage limit is too low for the given filter setup."
msgstr "La limite d'utilisation mémoire est trop basse pour la configuration de filtres donnée."
#: src/xz/coder.c:139
msgid "Using a preset in raw mode is discouraged."
msgstr "Utiliser un préréglage en mode `raw' est déconseillé."
#: src/xz/coder.c:141
msgid "The exact options of the presets may vary between software versions."
msgstr "Le détail des préréglages peut varier entre différentes versions du logiciel."
#: src/xz/coder.c:164
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Le format .lzma ne prend en charge que le filtre LZMA1"
#: src/xz/coder.c:172
msgid "LZMA1 cannot be used with the .xz format"
msgstr "Le filtre LZMA1 ne peut être utilisé avec le format .xz"
#: src/xz/coder.c:189
msgid "Unsupported filter chain or filter options"
msgstr "Enchaînement ou options de filtres non pris en charge"
#: src/xz/coder.c:197
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "La décompression nécessitera %s MiB de mémoire."
#: src/xz/coder.c:254
#, c-format
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "Taille du dictionnaire LZMA%c réduite de %s MiB à %s MiB pour ne pas dépasser la limite d'utilisation mémoire de %s MiB"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:138
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s : Le fichier a apparemment été déplacé, suppression annulée"
#: src/xz/file_io.c:145 src/xz/file_io.c:586
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s : Impossible de supprimer : %s"
#: src/xz/file_io.c:170
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s : Impossible de modifier le propriétaire du fichier : %s"
#: src/xz/file_io.c:176
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s : Impossible de modifier le groupe propriétaire du fichier : %s"
#: src/xz/file_io.c:195
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s : Impossible de modifier les permissions du fichier : %s"
#: src/xz/file_io.c:338 src/xz/file_io.c:417
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s est un lien symbolique : ignoré"
#: src/xz/file_io.c:452
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s est un répertoire : ignoré"
#: src/xz/file_io.c:458
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s n'est pas un fichier régulier : ignoré"
#: src/xz/file_io.c:475
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s : Le fichier possède les bits `setuid' ou `setgid' : ignoré"
#: src/xz/file_io.c:482
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s : Le fichier possède le bit `sticky' : ignoré"
#: src/xz/file_io.c:489
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s : Le fichier d'entrée a plus d'un lien matériel : ignoré"
#: src/xz/file_io.c:711
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Impossible de rétablir le drapeau O_APPEND sur la sortie standard : %s"
#: src/xz/file_io.c:723
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s : Impossible de fermer le fichier : %s"
#: src/xz/file_io.c:759 src/xz/file_io.c:943
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s : Impossible de se déplacer dans le fichier pour créer un 'sparse file' : %s"
#: src/xz/file_io.c:818
#, c-format
msgid "%s: Read error: %s"
msgstr "%s : Erreur d'écriture : %s"
#: src/xz/file_io.c:841
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s : Impossible de se déplacer dans le fichier : %s"
#: src/xz/file_io.c:851
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s : Fin de fichier inattendue"
#: src/xz/file_io.c:901
#, c-format
msgid "%s: Write error: %s"
msgstr "%s : Erreur d'écriture : %s"
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Désactivé"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Quantité totale de mémoire physique (RAM) : "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limite d'utilisation pour la compression : "
#: src/xz/hardware.c:123
msgid "Memory usage limit for decompression: "
msgstr "Limite d'utilisation pour la décompression : "
#. TRANSLATORS: Indicates that there is no integrity check.
#. This string is used in tables, so the width must not
#. exceed ten columns with a fixed-width font.
#: src/xz/list.c:62
msgid "None"
msgstr "Aucune"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Inconnue-2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Inconnue-3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Inconnue-5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Inconnue-6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Inconnue-7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Inconnue-8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Inconnue-9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Inconnue-11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Inconnue-12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Inconnue-13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Inconnue-14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Inconnue-15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s : Le fichier est vide"
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s : Trop petit pour être un fichier xz valide."
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:629
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr "Flux Blocs Compressé Décompressé Ratio Vérif. Nom de fichier"
#: src/xz/list.c:669
#, c-format
msgid " Streams: %s\n"
msgstr " Flux : %s\n"
#: src/xz/list.c:671
#, c-format
msgid " Blocks: %s\n"
msgstr " Blocs : %s\n"
#: src/xz/list.c:673
#, c-format
msgid " Compressed size: %s\n"
msgstr " Taille données avec compression : %s\n"
#: src/xz/list.c:676
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Taille données sans compression : %s\n"
#: src/xz/list.c:679
#, c-format
msgid " Ratio: %s\n"
msgstr " Ratio : %s\n"
#: src/xz/list.c:681
#, c-format
msgid " Check: %s\n"
msgstr " Vérification : %s\n"
#: src/xz/list.c:682
#, c-format
msgid " Stream padding: %s\n"
msgstr " Octets de rembourrage du flux : %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:710
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
msgstr ""
" Flux :\n"
" Flux Blocs PositionComp PositionDécomp TailleComp TailleDécomp Ratio Vérif. Bourrage"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:765
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
msgstr ""
" Blocs :\n"
" Flux Bloc PositionComp PositionDécomp TailleTot TailleDécomp Ratio Vérif."
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:777
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " ValVérif %*sEn-tête Drapeaux TailleComp UtilMém Filtres"
#: src/xz/list.c:855 src/xz/list.c:1024
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Mémoire nécessaire : %s MiB\n"
#: src/xz/list.c:857 src/xz/list.c:1026
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Tailles stockées dans l'en-tête : %s\n"
#: src/xz/list.c:858 src/xz/list.c:1027
msgid "Yes"
msgstr "Oui"
#: src/xz/list.c:858 src/xz/list.c:1027
msgid "No"
msgstr "Non"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:1003
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s fichier\n"
msgstr[1] "%s fichiers\n"
#: src/xz/list.c:1016
msgid "Totals:"
msgstr "Totaux :"
#: src/xz/list.c:1017
#, c-format
msgid " Number of files: %s\n"
msgstr " Nombre de fichiers : %s\n"
#: src/xz/list.c:1089
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list ne marche que sur les fichiers .xz (--format=xz ou --format=auto)"
#: src/xz/list.c:1095
msgid "--list does not support reading from standard input"
msgstr "--list est incompatible avec la lecture sur l'entrée standard"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s : Erreur lors de la lecture des noms de fichiers : %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s : Fin des données inattendue lors de la lecture des noms de fichiers"
#: src/xz/main.c:120
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr "%s : Caractère NULL détecté lors de la lecture des noms de fichiers ; peut-être pensiez-vous à `--files0' plutot qu'a `--files' ?"
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "La compression et la décompression ne marchent pas encore avec --robot."
#: src/xz/main.c:231
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "Impossible de lire à la fois les données et les noms de fichiers depuis l'entrée standard"
#. TRANSLATORS: This is the program name in the beginning
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:733
#, c-format
msgid "%s: "
msgstr "%s : "
#: src/xz/message.c:796 src/xz/message.c:846
msgid "Internal error (bug)"
msgstr "Erreur interne (bug)"
#: src/xz/message.c:803
msgid "Cannot establish signal handlers"
msgstr "Impossible d'installer le gestionnaire de signaux"
#: src/xz/message.c:812
msgid "No integrity check; not verifying file integrity"
msgstr "Pas de données de vérification d'intégrité ; vérification non effectuée"
#: src/xz/message.c:815
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "Méthode de vérification d'intégrité non prise en charge ; vérification non effectuée"
#: src/xz/message.c:822
msgid "Memory usage limit reached"
msgstr "Limite d'utilisation mémoire atteinte"
#: src/xz/message.c:825
msgid "File format not recognized"
msgstr "Format de fichier inconnu"
#: src/xz/message.c:828
msgid "Unsupported options"
msgstr "Options non prises en charge"
#: src/xz/message.c:831
msgid "Compressed data is corrupt"
msgstr "Les données compressées sont corrompues"
#: src/xz/message.c:834
msgid "Unexpected end of input"
msgstr "Fin des données inattendue "
#: src/xz/message.c:867
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "%s MiB de mémoire sont nécessaires. La limite est désactivée."
#: src/xz/message.c:895
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB de mémoire sont nécessaires, la limite étant %s."
#: src/xz/message.c:1062
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s : Enchaînement de filtres : %s\n"
#: src/xz/message.c:1072
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Éxécutez `%s --help' pour obtenir davantage d'informations."
#: src/xz/message.c:1098
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Utilisation : %s [OPTION]... [FICHIER]...\n"
"Compresse ou decompresse FICHIER(s) au format .xz.\n"
"\n"
#: src/xz/message.c:1105
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Les arguments obligatoires pour les options longues le sont aussi pour les\n"
"options courtes.\n"
#: src/xz/message.c:1109
msgid " Operation mode:\n"
msgstr " Mode d'opération :\n"
#: src/xz/message.c:1112
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress forcer le mode compression\n"
" -d, --decompress forcer le mode décompression\n"
" -t, --test tester l'intégrité du fichier compressé\n"
" -l, --list lister les informations sur les fichiers .xz"
#: src/xz/message.c:1118
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
" Modificateurs :\n"
#: src/xz/message.c:1121
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep ne pas supprimer les fichiers d'entrée\n"
" -f, --force forcer l'écrasement éventuel du fichier de sortie et\n"
" (dé)compresser les liens symboliques\n"
" -c, --stdout écrire sur la sortie standard et ne pas supprimer les\n"
" fichiers d'entrée"
#: src/xz/message.c:1127
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse ne pas créer de 'sparse file' lors de la décompression\n"
" -S, --suffix=.SUF utiliser le suffixe `.SUF' pour les fichiers compressés\n"
" --files[=FILE] lire les fichiers sur lesquels opérer depuis FILE ; si\n"
" FILE est omis, ceux-ci sont lus depuis l'entrée standard\n"
" et doivent être suivis d'un caractère retour à la ligne\n"
" --files0[=FILE] comme --files mais avec un caractère null comme séparateur"
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
" Options basiques de format de fichier et de compression :\n"
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FMT format du fichier à encoder ou décoder ; sont acceptés :\n"
" `auto' (par défaut), `xz', `lzma' et `raw'\n"
" -C, --check=CHECK type de vérification d'intégrité : `none' (à utiliser avec\n"
" précaution), `crc32', `crc64' (par défaut) ou `sha256'"
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
msgstr ""
" -0 ... -9 préréglage de compression : 6 par défaut ; pensez à\n"
" l'utilisation mémoire du compresseur *et* du décompresseur\n"
" avant d'utiliser 7, 8 ou 9 !"
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme essayer d'améliorer la compression en utilisant davantage\n"
" de temps processeur ;\n"
" n'affecte pas les besoins mémoire du décompresseur"
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" règle la limite d'utilisation mémoire pour la compression,\n"
" décompression ou les deux ; LIMIT est en octets,\n"
" pourcentage de RAM, ou 0 pour la valeur par défaut"
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr ""
" --no-adjust si les réglages de compression dépassent la limite\n"
" d'utilisation mémoire, renvoyer une erreur plutôt que de\n"
" diminuer les réglages"
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
" Chaîne de filtres de compression personnalisée (en lieu des préréglages) :"
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM maximum search depth; 0=automatic (default)"
msgstr ""
"\n"
" --lzma1[=OPTS] LZMA1/2 ; OPTS est une liste d'options parmi les suivantes\n"
" --lzma2[=OPTS] (entre parenthèses : valeurs valides et par défaut) :\n"
" preset=PRE remettre les options à un préréglage (0-9[e])\n"
" dict=NUM taille dictionnaire (4KiB - 1536MiB ; 8MiB)\n"
" lc=NUM nombre de 'literal context bits' (0-4 ; 3)\n"
" lp=NUM nombre de 'literal position bits' (0-4 ; 0)\n"
" pb=NUM nombre de 'position bits' (0-4 ; 2)\n"
" mode=MODE mode de compression (fast, normal ; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME 'match finder' (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM profondeur de recherche maximale ;\n"
" 0=automatique (par défaut)"
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=OPTS] filtre BCJ x86 (32-bit et 64-bit)\n"
" --powerpc[=OPTS] filtre BCJ PowerPC ('big endian' uniquement)\n"
" --ia64[=OPTS] filtre BCJ IA-64 (Itanium)\n"
" --arm[=OPTS] filtre BCJ ARM ('little endian' uniquement)\n"
" --armthumb[=OPTS] filtre BCJ ARM-Thumb ('little endian' uniquement)\n"
" --sparc[=OPTS] filtre BCJ SPARC\n"
" OPTS valides pour tous les filtres BCJ :\n"
" start=NUM position de début de la conversion (défaut=0)"
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=OPTS] Filtre delta ; OPTS valides (vals. valides ; par défaut) :\n"
" dist=NUM distance entre les octets soustraits les\n"
" uns aux autres (1-256 ; 1)"
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Autres options :\n"
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet masquer les avertissements ; spécifier deux fois pour\n"
" aussi masquer les erreurs\n"
" -v, --verbose être bavard ; spécifier deux fois pour l'être davantage"
#: src/xz/message.c:1218
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn les avertissements ne modifient pas le code de sortie"
#: src/xz/message.c:1220
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr ""
" --robot utiliser des messages lisibles par un programme\n"
" (utile pour les scripts)"
#: src/xz/message.c:1223
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr ""
" --info-memory afficher la quantité totale de RAM ainsi que la limite\n"
" actuelle d'utilisation mémoire puis quitter"
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help afficher l'aide courte (ne liste que les options de base)\n"
" -H, --long-help afficher l'aide longue (ceci) puis quitter"
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help afficher l'aide courte (ceci) puis quitter\n"
" -H, --long-help afficher l'aide longue (liste aussi les options avancées)"
#: src/xz/message.c:1235
msgid " -V, --version display the version number and exit"
msgstr " -V, --version afficher le numéro de version puis quitter"
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Sans FILE ou quand FILE est -, lire l'entrée standard.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1243
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Signaler les bogues à <%s> (en anglais ou en finlandais).\n"
"Signaler les bogues de traduction à <adrien@notk.org>.\n"
#: src/xz/message.c:1245
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Page du projet %s : <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Les options doivent être des paires `nom=valeur' séparées par des virgules"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s : Nom d'option invalide"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s : Valeur d'option invalide"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "Préréglage LZMA1/LZMA2 non reconnu : %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "La somme de lc et lp ne doit pas dépasser 4"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "Le `match finder' choisi nécessite au moins nice=%<PRIu32>"
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "%s : Avec --format=raw, --suffix=.SUF est nécessaire sauf lors de l'écriture vers stdout"
#: src/xz/suffix.c:121
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s : Le fichier a un suffixe inconnu, ignoré"
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s : Le fichier a déjà le suffixe '%s', ignoré"
#: src/xz/suffix.c:235
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Suffixe de nom de fichier invalide"
#: src/xz/util.c:71
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s : La valeur n'est pas un entier décimal non négatif"
#: src/xz/util.c:113
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s : Suffixe multiplicateur invalide"
#: src/xz/util.c:115
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "Les suffixes valides sont 'KiB' (2^10), 'MiB' (2^20) et 'GiB' (2^30)."
#: src/xz/util.c:132
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "La valeur de l'option '%s' doit être inclue entre %<PRIu64> et %<PRIu64>"
#: src/xz/util.c:257
msgid "Empty filename, skipping"
msgstr "Nom de fichier vide, ignoré"
#: src/xz/util.c:271
msgid "Compressed data cannot be read from a terminal"
msgstr "Les données compressées ne peuvent pas être lues depuis un terminal"
#: src/xz/util.c:284
msgid "Compressed data cannot be written to a terminal"
msgstr "Les données compressées ne peuvent pas être écrites dans un terminal"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Impossible d'écrire vers la sortie standard"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Erreur inconnue"

196
po/it.po
View File

@ -2,18 +2,20 @@
# This file is in the public domain # This file is in the public domain
# Gruppo traduzione italiano di Ubuntu-it <gruppo-traduzione@ubuntu-it.org>, 2009, 2010 # Gruppo traduzione italiano di Ubuntu-it <gruppo-traduzione@ubuntu-it.org>, 2009, 2010
# Lorenzo De Liso <blackz@ubuntu.com>, 2010. # Lorenzo De Liso <blackz@ubuntu.com>, 2010.
# Milo Casagrande <milo@ubuntu.com>, 2009, 2010. # Milo Casagrande <milo@ubuntu.com>, 2009, 2010, 2011, 2012.
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-utils\n" "Project-Id-Version: xz-utils\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n" "Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2010-09-10 14:50+0300\n" "POT-Creation-Date: 2012-05-29 13:50+0300\n"
"PO-Revision-Date: 2010-09-16 21:32+0200\n" "PO-Revision-Date: 2012-05-31 09:57+0800\n"
"Last-Translator: Milo Casagrande <milo@ubuntu.com>\n" "Last-Translator: Milo Casagrande <milo@ubuntu.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n" "Language-Team: Italian <tp@lists.linux.it>\n"
"Language: it\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8-bit\n"
"X-Launchpad-Export-Date: 2010-08-16 19:16+0000\n" "X-Launchpad-Export-Date: 2010-08-16 19:16+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n"
@ -21,7 +23,7 @@ msgstr ""
#: src/xz/args.c:333 #: src/xz/args.c:333
#, c-format #, c-format
msgid "%s: Unknown file format type" msgid "%s: Unknown file format type"
msgstr "%s: tipo di formato del file sconosciutoN" msgstr "%s: tipo di formato del file sconosciuto"
#: src/xz/args.c:356 src/xz/args.c:364 #: src/xz/args.c:356 src/xz/args.c:364
#, c-format #, c-format
@ -97,7 +99,7 @@ msgstr ""
msgid "%s: File seems to have been moved, not removing" msgid "%s: File seems to have been moved, not removing"
msgstr "%s: sembra che il file sia stato spostato, non viene rimosso" msgstr "%s: sembra che il file sia stato spostato, non viene rimosso"
#: src/xz/file_io.c:144 src/xz/file_io.c:590 #: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format #, c-format
msgid "%s: Cannot remove: %s" msgid "%s: Cannot remove: %s"
msgstr "%s: impossibile rimuovere: %s" msgstr "%s: impossibile rimuovere: %s"
@ -127,58 +129,58 @@ msgstr "%s: è un collegamento simbolico, viene saltato"
msgid "%s: Is a directory, skipping" msgid "%s: Is a directory, skipping"
msgstr "%s: è una directory, viene saltata" msgstr "%s: è una directory, viene saltata"
#: src/xz/file_io.c:462 #: src/xz/file_io.c:461
#, c-format #, c-format
msgid "%s: Not a regular file, skipping" msgid "%s: Not a regular file, skipping"
msgstr "%s: non è un file regolare, viene saltato" msgstr "%s: non è un file regolare, viene saltato"
#: src/xz/file_io.c:479 #: src/xz/file_io.c:478
#, c-format #, c-format
msgid "%s: File has setuid or setgid bit set, skipping" msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: il file ha il bit setuid o setgid impostato, viene saltato" msgstr "%s: il file ha il bit setuid o setgid impostato, viene saltato"
#: src/xz/file_io.c:486 #: src/xz/file_io.c:485
#, c-format #, c-format
msgid "%s: File has sticky bit set, skipping" msgid "%s: File has sticky bit set, skipping"
msgstr "%s: il file ha lo sticky bit impostato, viene saltato" msgstr "%s: il file ha lo sticky bit impostato, viene saltato"
#: src/xz/file_io.c:493 #: src/xz/file_io.c:492
#, c-format #, c-format
msgid "%s: Input file has more than one hard link, skipping" msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: il file di input ha più di un collegamento fisico, viene saltato" msgstr "%s: il file di input ha più di un collegamento fisico, viene saltato"
#: src/xz/file_io.c:714 #: src/xz/file_io.c:713
#, c-format #, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s" msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Errore nel ripristinare la flag O_APPEND sullo standard output: %s" msgstr "Errore nel ripristinare la flag O_APPEND sullo standard output: %s"
#: src/xz/file_io.c:726 #: src/xz/file_io.c:725
#, c-format #, c-format
msgid "%s: Closing the file failed: %s" msgid "%s: Closing the file failed: %s"
msgstr "%s: chiusura del file non riuscita: %s" msgstr "%s: chiusura del file non riuscita: %s"
#: src/xz/file_io.c:762 src/xz/file_io.c:946 #: src/xz/file_io.c:761 src/xz/file_io.c:945
#, c-format #, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s" msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "" msgstr ""
"%s: posizionamento non riuscito nel tentativo di creare un file sparso: %s" "%s: posizionamento non riuscito nel tentativo di creare un file sparso: %s"
#: src/xz/file_io.c:821 #: src/xz/file_io.c:820
#, c-format #, c-format
msgid "%s: Read error: %s" msgid "%s: Read error: %s"
msgstr "%s: errore di lettura: %s" msgstr "%s: errore di lettura: %s"
#: src/xz/file_io.c:844 #: src/xz/file_io.c:843
#, c-format #, c-format
msgid "%s: Error seeking the file: %s" msgid "%s: Error seeking the file: %s"
msgstr "%s: errore nel cercare il file: %s" msgstr "%s: errore nel cercare il file: %s"
#: src/xz/file_io.c:854 #: src/xz/file_io.c:853
#, c-format #, c-format
msgid "%s: Unexpected end of file" msgid "%s: Unexpected end of file"
msgstr "%s: fine del file inaspettata" msgstr "%s: fine del file inaspettata"
#: src/xz/file_io.c:904 #: src/xz/file_io.c:903
#, c-format #, c-format
msgid "%s: Write error: %s" msgid "%s: Write error: %s"
msgstr "%s: errore di scrittura: %s" msgstr "%s: errore di scrittura: %s"
@ -212,7 +214,7 @@ msgstr "Nessuno"
#. but the Check ID is known (here 2). This and other "Unknown-N" #. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten #. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if #. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter. #. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69 #: src/xz/list.c:69
msgid "Unknown-2" msgid "Unknown-2"
msgstr "Sconosc2" msgstr "Sconosc2"
@ -275,41 +277,41 @@ msgstr "%s: troppo piccolo per essere un file .xz valido"
#. to Ratio, the columns are right aligned. Check and Filename #. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to #. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz". #. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:612 #: src/xz/list.c:603
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename" msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " Strm Blocc. Compresso Estratto Rapp. Contr Nome file" msgstr " Strm Blocc. Compresso Estratto Rapp. Contr Nome file"
#: src/xz/list.c:652 #: src/xz/list.c:643
#, c-format #, c-format
msgid " Streams: %s\n" msgid " Streams: %s\n"
msgstr " Stream: %s\n" msgstr " Stream: %s\n"
#: src/xz/list.c:654 #: src/xz/list.c:645
#, c-format #, c-format
msgid " Blocks: %s\n" msgid " Blocks: %s\n"
msgstr " Blocchi: %s\n" msgstr " Blocchi: %s\n"
#: src/xz/list.c:656 #: src/xz/list.c:647
#, c-format #, c-format
msgid " Compressed size: %s\n" msgid " Compressed size: %s\n"
msgstr " Dim. compresso: %s\n" msgstr " Dim. compresso: %s\n"
#: src/xz/list.c:659 #: src/xz/list.c:650
#, c-format #, c-format
msgid " Uncompressed size: %s\n" msgid " Uncompressed size: %s\n"
msgstr " Dim. estratto: %s\n" msgstr " Dim. estratto: %s\n"
#: src/xz/list.c:662 #: src/xz/list.c:653
#, c-format #, c-format
msgid " Ratio: %s\n" msgid " Ratio: %s\n"
msgstr " Rapporto: %s\n" msgstr " Rapporto: %s\n"
#: src/xz/list.c:664 #: src/xz/list.c:655
#, c-format #, c-format
msgid " Check: %s\n" msgid " Check: %s\n"
msgstr " Controllo: %s\n" msgstr " Controllo: %s\n"
#: src/xz/list.c:665 #: src/xz/list.c:656
#, c-format #, c-format
msgid " Stream padding: %s\n" msgid " Stream padding: %s\n"
msgstr " Padding dello stream: %s\n" msgstr " Padding dello stream: %s\n"
@ -317,7 +319,7 @@ msgstr " Padding dello stream: %s\n"
#. TRANSLATORS: The second line is column headings. All except #. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with #. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz". #. "xz -lv foo.xz".
#: src/xz/list.c:693 #: src/xz/list.c:684
msgid "" msgid ""
" Streams:\n" " Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize " " Stream Blocks CompOffset UncompOffset CompSize "
@ -329,7 +331,7 @@ msgstr ""
#. TRANSLATORS: The second line is column headings. All #. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned. #. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:748 #: src/xz/list.c:739
#, c-format #, c-format
msgid "" msgid ""
" Blocks:\n" " Blocks:\n"
@ -347,52 +349,52 @@ msgstr ""
#. are right aligned. %*s is replaced with 0-120 #. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough. #. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz". #. Test with "xz -lvv foo.xz".
#: src/xz/list.c:760 #: src/xz/list.c:751
#, c-format #, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters" msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " Val.cont %*s Header Flag Dim.compr. Uso mem. Filtri" msgstr " Val.cont %*s Header Flag Dim.compr. Uso mem. Filtri"
#: src/xz/list.c:838 src/xz/list.c:1007 #: src/xz/list.c:829 src/xz/list.c:998
#, c-format #, c-format
msgid " Memory needed: %s MiB\n" msgid " Memory needed: %s MiB\n"
msgstr " Memoria necessaria: %s MiB\n" msgstr " Memoria necessaria: %s MiB\n"
#: src/xz/list.c:840 src/xz/list.c:1009 #: src/xz/list.c:831 src/xz/list.c:1000
#, c-format #, c-format
msgid " Sizes in headers: %s\n" msgid " Sizes in headers: %s\n"
msgstr " Dim. negli header: %s\n" msgstr " Dim. negli header: %s\n"
#: src/xz/list.c:841 src/xz/list.c:1010 #: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes" msgid "Yes"
msgstr "Sì" msgstr "Sì"
#: src/xz/list.c:841 src/xz/list.c:1010 #: src/xz/list.c:832 src/xz/list.c:1001
msgid "No" msgid "No"
msgstr "No" msgstr "No"
#. TRANSLATORS: %s is an integer. Only the plural form of this #. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz". #. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:986 #: src/xz/list.c:977
#, c-format #, c-format
msgid "%s file\n" msgid "%s file\n"
msgid_plural "%s files\n" msgid_plural "%s files\n"
msgstr[0] "%s file\n" msgstr[0] "%s file\n"
msgstr[1] "%s file\n" msgstr[1] "%s file\n"
#: src/xz/list.c:999 #: src/xz/list.c:990
msgid "Totals:" msgid "Totals:"
msgstr "Totali:" msgstr "Totali:"
#: src/xz/list.c:1000 #: src/xz/list.c:991
#, c-format #, c-format
msgid " Number of files: %s\n" msgid " Number of files: %s\n"
msgstr " Numero di file: %s\n" msgstr " Numero di file: %s\n"
#: src/xz/list.c:1072 #: src/xz/list.c:1063
msgid "--list works only on .xz files (--format=xz or --format=auto)" msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list funziona solamente con file .xz (--format=xz o --format=auto)" msgstr "--list funziona solamente con file .xz (--format=xz o --format=auto)"
#: src/xz/list.c:1078 #: src/xz/list.c:1069
msgid "--list does not support reading from standard input" msgid "--list does not support reading from standard input"
msgstr "--list non è in grado di leggere dallo standard input" msgstr "--list non è in grado di leggere dallo standard input"
@ -427,61 +429,75 @@ msgstr ""
"Impossibile leggere i dati dallo standard input durante la lettura dei nomi " "Impossibile leggere i dati dallo standard input durante la lettura dei nomi "
"dei file dallo standard input" "dei file dallo standard input"
#: src/xz/message.c:800 src/xz/message.c:844 #. TRANSLATORS: This is the program name in the beginning
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:733
#, c-format
msgid "%s: "
msgstr "%s: "
#: src/xz/message.c:796 src/xz/message.c:846
msgid "Internal error (bug)" msgid "Internal error (bug)"
msgstr "Errore interno (bug)" msgstr "Errore interno (bug)"
#: src/xz/message.c:807 #: src/xz/message.c:803
msgid "Cannot establish signal handlers" msgid "Cannot establish signal handlers"
msgstr "Impossibile stabilire i gestori dei segnali" msgstr "Impossibile stabilire i gestori dei segnali"
#: src/xz/message.c:816 #: src/xz/message.c:812
msgid "No integrity check; not verifying file integrity" msgid "No integrity check; not verifying file integrity"
msgstr "" msgstr ""
"Nessun controllo d'integrità; l'integrità del file non viene verificata" "Nessun controllo d'integrità; l'integrità del file non viene verificata"
#: src/xz/message.c:819 #: src/xz/message.c:815
msgid "Unsupported type of integrity check; not verifying file integrity" msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "" msgstr ""
"Tipo di controllo di integrità non supportato; l'integrità del file non " "Tipo di controllo di integrità non supportato; l'integrità del file non "
"viene verificata" "viene verificata"
#: src/xz/message.c:826 #: src/xz/message.c:822
msgid "Memory usage limit reached" msgid "Memory usage limit reached"
msgstr "Limite di utilizzo della memoria raggiunto" msgstr "Limite di utilizzo della memoria raggiunto"
#: src/xz/message.c:829 #: src/xz/message.c:825
msgid "File format not recognized" msgid "File format not recognized"
msgstr "Formato di file non riconosciuto" msgstr "Formato di file non riconosciuto"
#: src/xz/message.c:832 #: src/xz/message.c:828
msgid "Unsupported options" msgid "Unsupported options"
msgstr "Opzioni non supportate" msgstr "Opzioni non supportate"
#: src/xz/message.c:835 #: src/xz/message.c:831
msgid "Compressed data is corrupt" msgid "Compressed data is corrupt"
msgstr "I dati compressi sono danneggiati" msgstr "I dati compressi sono danneggiati"
#: src/xz/message.c:838 #: src/xz/message.c:834
msgid "Unexpected end of input" msgid "Unexpected end of input"
msgstr "Fine dell'input non attesa" msgstr "Fine dell'input non attesa"
#: src/xz/message.c:886 #: src/xz/message.c:867
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "%s MiB di memoria sono richiesti. Alcun limite impostato."
#: src/xz/message.c:895
#, c-format #, c-format
msgid "%s MiB of memory is required. The limit is %s." msgid "%s MiB of memory is required. The limit is %s."
msgstr "%s MiB di memoria sono richiesti. Il limite è %s." msgstr "%s MiB di memoria sono richiesti. Il limite è %s."
#: src/xz/message.c:1053 #: src/xz/message.c:1062
#, c-format #, c-format
msgid "%s: Filter chain: %s\n" msgid "%s: Filter chain: %s\n"
msgstr "%s: catena di filtri: %s\n" msgstr "%s: catena di filtri: %s\n"
#: src/xz/message.c:1063 #: src/xz/message.c:1072
#, c-format #, c-format
msgid "Try `%s --help' for more information." msgid "Try `%s --help' for more information."
msgstr "Provare \"%s --help\" per maggiori informazioni." msgstr "Provare \"%s --help\" per maggiori informazioni."
#: src/xz/message.c:1089 #: src/xz/message.c:1098
#, c-format #, c-format
msgid "" msgid ""
"Usage: %s [OPTION]... [FILE]...\n" "Usage: %s [OPTION]... [FILE]...\n"
@ -492,18 +508,18 @@ msgstr ""
"Comprime o estrae i FILE nel formato .xz.\n" "Comprime o estrae i FILE nel formato .xz.\n"
"\n" "\n"
#: src/xz/message.c:1096 #: src/xz/message.c:1105
msgid "" msgid ""
"Mandatory arguments to long options are mandatory for short options too.\n" "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr "" msgstr ""
"Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle " "Gli argomenti obbligatori per le opzioni lunghe lo sono anche per quelle "
"brevi.\n" "brevi.\n"
#: src/xz/message.c:1100 #: src/xz/message.c:1109
msgid " Operation mode:\n" msgid " Operation mode:\n"
msgstr " Modalità di operazione:\n" msgstr " Modalità di operazione:\n"
#: src/xz/message.c:1103 #: src/xz/message.c:1112
msgid "" msgid ""
" -z, --compress force compression\n" " -z, --compress force compression\n"
" -d, --decompress force decompression\n" " -d, --decompress force decompression\n"
@ -515,7 +531,7 @@ msgstr ""
" -t, --test Verifica l'integrità dei file compressi\n" " -t, --test Verifica l'integrità dei file compressi\n"
" -l, --list Elenca informazioni sui file .xz" " -l, --list Elenca informazioni sui file .xz"
#: src/xz/message.c:1109 #: src/xz/message.c:1118
msgid "" msgid ""
"\n" "\n"
" Operation modifiers:\n" " Operation modifiers:\n"
@ -523,7 +539,7 @@ msgstr ""
"\n" "\n"
" Modificatori di operazioni:\n" " Modificatori di operazioni:\n"
#: src/xz/message.c:1112 #: src/xz/message.c:1121
msgid "" msgid ""
" -k, --keep keep (don't delete) input files\n" " -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n" " -f, --force force overwrite of output file and (de)compress links\n"
@ -536,7 +552,7 @@ msgstr ""
" -c, --stdout Scrive sullo standard output e non elimina i file di " " -c, --stdout Scrive sullo standard output e non elimina i file di "
"input" "input"
#: src/xz/message.c:1118 #: src/xz/message.c:1127
msgid "" msgid ""
" --no-sparse do not create sparse files when decompressing\n" " --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n" " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
@ -556,7 +572,7 @@ msgstr ""
" di newline\n" " di newline\n"
" --files0=[FILE] Come --files ma usa il carattere null come terminatore" " --files0=[FILE] Come --files ma usa il carattere null come terminatore"
#: src/xz/message.c:1126 #: src/xz/message.c:1135
msgid "" msgid ""
"\n" "\n"
" Basic file format and compression options:\n" " Basic file format and compression options:\n"
@ -564,7 +580,7 @@ msgstr ""
"\n" "\n"
" Formato file di base e opzioni di compressione:\n" " Formato file di base e opzioni di compressione:\n"
#: src/xz/message.c:1128 #: src/xz/message.c:1137
msgid "" msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n" " -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n" " `auto' (default), `xz', `lzma', and `raw'\n"
@ -579,12 +595,12 @@ msgstr ""
"attenzione),\n" "attenzione),\n"
" \"crc32\", \"crc64\" (predefinito) o \"sha256\"" " \"crc32\", \"crc64\" (predefinito) o \"sha256\""
#: src/xz/message.c:1135 #: src/xz/message.c:1144
msgid "" msgid ""
" -0 ... -9 compression preset; default is 6; take compressor " " -0 ... -9 compression preset; default is 6; take compressor "
"*and*\n" "*and*\n"
" decompressor memory usage into account before using 7-" " decompressor memory usage into account before using "
"9!" "7-9!"
msgstr "" msgstr ""
" -0 ... -9 Preset di compressione; predefinito è 6; tenere a " " -0 ... -9 Preset di compressione; predefinito è 6; tenere a "
"mente\n" "mente\n"
@ -592,7 +608,7 @@ msgstr ""
"prima\n" "prima\n"
" di usare 7-9" " di usare 7-9"
#: src/xz/message.c:1139 #: src/xz/message.c:1148
msgid "" msgid ""
" -e, --extreme try to improve compression ratio by using more CPU " " -e, --extreme try to improve compression ratio by using more CPU "
"time;\n" "time;\n"
@ -603,7 +619,7 @@ msgstr ""
"di\n" "di\n"
" memoria in fase di estrazione" " memoria in fase di estrazione"
#: src/xz/message.c:1144 #: src/xz/message.c:1153
#, no-c-format #, no-c-format
msgid "" msgid ""
" --memlimit-compress=LIMIT\n" " --memlimit-compress=LIMIT\n"
@ -621,7 +637,7 @@ msgstr ""
"byte,\n" "byte,\n"
" % della memoria RAM oppure 0 per il valore predefinito" " % della memoria RAM oppure 0 per il valore predefinito"
#: src/xz/message.c:1151 #: src/xz/message.c:1160
msgid "" msgid ""
" --no-adjust if compression settings exceed the memory usage " " --no-adjust if compression settings exceed the memory usage "
"limit,\n" "limit,\n"
@ -633,7 +649,7 @@ msgstr ""
" utilizzo della memoria, lancia un errore invece di\n" " utilizzo della memoria, lancia un errore invece di\n"
" utilizzare valori più piccoli" " utilizzare valori più piccoli"
#: src/xz/message.c:1157 #: src/xz/message.c:1166
msgid "" msgid ""
"\n" "\n"
" Custom filter chain for compression (alternative for using presets):" " Custom filter chain for compression (alternative for using presets):"
@ -642,7 +658,7 @@ msgstr ""
" Catena di filtri personalizzati per la compressione (alternative per\n" " Catena di filtri personalizzati per la compressione (alternative per\n"
" l'utilizzo di preset):" " l'utilizzo di preset):"
#: src/xz/message.c:1166 #: src/xz/message.c:1175
msgid "" msgid ""
"\n" "\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero " " --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero "
@ -672,8 +688,8 @@ msgstr ""
" (4KiB - 1536MiB; 8MiB)\n" " (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM Numero di bit letterali di contesto (0-4; " " lc=NUM Numero di bit letterali di contesto (0-4; "
"3)\n" "3)\n"
" lp=NUM Numero di bit letterali di posizione (0-" " lp=NUM Numero di bit letterali di posizione "
"4; 0)\n" "(0-4; 0)\n"
" pb=NUM Numero di bit di posizione (0-4; 2)\n" " pb=NUM Numero di bit di posizione (0-4; 2)\n"
" mode=MODE Modalità di compressione\n" " mode=MODE Modalità di compressione\n"
" (fast, normal; normal)\n" " (fast, normal; normal)\n"
@ -685,7 +701,7 @@ msgstr ""
"0=automatica\n" "0=automatica\n"
" (predefinito)" " (predefinito)"
#: src/xz/message.c:1181 #: src/xz/message.c:1190
msgid "" msgid ""
"\n" "\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n" " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@ -708,7 +724,7 @@ msgstr ""
" start=NUM Offset iniziale per le conversioni\n" " start=NUM Offset iniziale per le conversioni\n"
" (predefinito=0)" " (predefinito=0)"
#: src/xz/message.c:1193 #: src/xz/message.c:1202
msgid "" msgid ""
"\n" "\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n" " --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@ -720,7 +736,7 @@ msgstr ""
" dist=NUM Distanza tra byte sottratti\n" " dist=NUM Distanza tra byte sottratti\n"
" gli uni dagli altri (1-256; 1)" " gli uni dagli altri (1-256; 1)"
#: src/xz/message.c:1201 #: src/xz/message.c:1210
msgid "" msgid ""
"\n" "\n"
" Other options:\n" " Other options:\n"
@ -728,7 +744,7 @@ msgstr ""
"\n" "\n"
" Altre opzioni:\n" " Altre opzioni:\n"
#: src/xz/message.c:1204 #: src/xz/message.c:1213
msgid "" msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors " " -q, --quiet suppress warnings; specify twice to suppress errors "
"too\n" "too\n"
@ -741,16 +757,16 @@ msgstr ""
"ancora\n" "ancora\n"
" più prolisso" " più prolisso"
#: src/xz/message.c:1209 #: src/xz/message.c:1218
msgid " -Q, --no-warn make warnings not affect the exit status" msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn Gli avvisi non influenzano lo stato d'uscita" msgstr " -Q, --no-warn Gli avvisi non influenzano lo stato d'uscita"
#: src/xz/message.c:1211 #: src/xz/message.c:1220
msgid "" msgid ""
" --robot use machine-parsable messages (useful for scripts)" " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot Usa messaggi analizzabili (utile per gli script)" msgstr " --robot Usa messaggi analizzabili (utile per gli script)"
#: src/xz/message.c:1214 #: src/xz/message.c:1223
msgid "" msgid ""
" --info-memory display the total amount of RAM and the currently " " --info-memory display the total amount of RAM and the currently "
"active\n" "active\n"
@ -760,7 +776,7 @@ msgstr ""
"attuale\n" "attuale\n"
" attivo di utilizzo della memore ed esce" " attivo di utilizzo della memore ed esce"
#: src/xz/message.c:1217 #: src/xz/message.c:1226
msgid "" msgid ""
" -h, --help display the short help (lists only the basic options)\n" " -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit" " -H, --long-help display this long help and exit"
@ -768,7 +784,7 @@ msgstr ""
" -h, --help Stampa l'aiuto breve (elenca solo le opzioni di base)\n" " -h, --help Stampa l'aiuto breve (elenca solo le opzioni di base)\n"
" -H, --long-help Stampa questo lungo aiuto ed esce" " -H, --long-help Stampa questo lungo aiuto ed esce"
#: src/xz/message.c:1221 #: src/xz/message.c:1230
msgid "" msgid ""
" -h, --help display this short help and exit\n" " -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)" " -H, --long-help display the long help (lists also the advanced options)"
@ -776,11 +792,11 @@ msgstr ""
" -h, --help Stampa questo breve aiuto ed esce\n" " -h, --help Stampa questo breve aiuto ed esce\n"
" -H, --long-help Stampa l'aiuto lungo (elenca anche le opzioni avanzate)" " -H, --long-help Stampa l'aiuto lungo (elenca anche le opzioni avanzate)"
#: src/xz/message.c:1226 #: src/xz/message.c:1235
msgid " -V, --version display the version number and exit" msgid " -V, --version display the version number and exit"
msgstr " -V, --version Stampa il numero della versione ed esce" msgstr " -V, --version Stampa il numero della versione ed esce"
#: src/xz/message.c:1228 #: src/xz/message.c:1237
msgid "" msgid ""
"\n" "\n"
"With no FILE, or when FILE is -, read standard input.\n" "With no FILE, or when FILE is -, read standard input.\n"
@ -792,14 +808,14 @@ msgstr ""
#. for this package. Please add _another line_ saying #. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW #. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks. #. address for translation bugs. Thanks.
#: src/xz/message.c:1234 #: src/xz/message.c:1243
#, c-format #, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n" msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr "" msgstr ""
"Segnalare i bug a <%s> (in inglese o finlandese).\n" "Segnalare i bug a <%s> (in inglese o finlandese).\n"
"Segnalare i bug di traduzione a <tp@lists.linux.it>.\n" "Segnalare i bug di traduzione a <tp@lists.linux.it>.\n"
#: src/xz/message.c:1236 #: src/xz/message.c:1245
#, c-format #, c-format
msgid "%s home page: <%s>\n" msgid "%s home page: <%s>\n"
msgstr "Sito web di %s: <%s>\n" msgstr "Sito web di %s: <%s>\n"
@ -833,10 +849,10 @@ msgstr "La somma di lc e lp non deve superare 4"
#, c-format #, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>" msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "" msgstr ""
"Lo strumento per cercare corrispondenze selezionato richiede almeno nice=%" "Lo strumento per cercare corrispondenze selezionato richiede almeno nice="
"<PRIu32>" "%<PRIu32>"
#: src/xz/suffix.c:79 src/xz/suffix.c:164 #: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format #, c-format
msgid "" msgid ""
"%s: With --format=raw, --suffix=.SUF is required unless writing to stdout" "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
@ -844,17 +860,17 @@ msgstr ""
"%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva " "%s: con --format=raw, --suffix=.SUF è richiesto a meno che non si scriva "
"sullo stdout" "sullo stdout"
#: src/xz/suffix.c:99 #: src/xz/suffix.c:121
#, c-format #, c-format
msgid "%s: Filename has an unknown suffix, skipping" msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: il nome del file ha un suffisso sconosciuto, viene saltato" msgstr "%s: il nome del file ha un suffisso sconosciuto, viene saltato"
#: src/xz/suffix.c:154 #: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format #, c-format
msgid "%s: File already has `%s' suffix, skipping" msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: il file ha già il suffisso \"%s\", viene saltato" msgstr "%s: il file ha già il suffisso \"%s\", viene saltato"
#: src/xz/suffix.c:205 #: src/xz/suffix.c:235
#, c-format #, c-format
msgid "%s: Invalid filename suffix" msgid "%s: Invalid filename suffix"
msgstr "%s: suffisso del nome del file non valido" msgstr "%s: suffisso del nome del file non valido"
@ -878,8 +894,8 @@ msgstr ""
#, c-format #, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]" msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "" msgstr ""
"Il valore dell'opzione \"%s\" deve essere nell'intervallo [%<PRIu64>, %" "Il valore dell'opzione \"%s\" deve essere nell'intervallo [%<PRIu64>, "
"<PRIu64>]" "%<PRIu64>]"
#: src/xz/util.c:247 #: src/xz/util.c:247
msgid "Empty filename, skipping" msgid "Empty filename, skipping"

839
po/pl.po Normal file
View File

@ -0,0 +1,839 @@
# Polish translation for xz.
# This file is in the public domain.
# Jakub Bogusz <qboosh@pld-linux.org>, 2011-2012.
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.0.2\n"
"Report-Msgid-Bugs-To: lasse.collin@tukaani.org\n"
"POT-Creation-Date: 2012-05-29 13:50+0300\n"
"PO-Revision-Date: 2012-05-29 18:15+0200\n"
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#: src/xz/args.c:333
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s: Nieznany typ formatu pliku"
#: src/xz/args.c:356 src/xz/args.c:364
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s: Nieobsługiwany typ kontroli spójności"
#: src/xz/args.c:382
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "Wraz z opcją `--files' lub `--files0' można podać tylko jeden plik."
#: src/xz/args.c:445
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "Zmienna środowiskowa %s zawiera zbyt dużo argumentów"
#: src/xz/coder.c:95
msgid "Maximum number of filters is four"
msgstr "Maksymalna liczba filtrów to cztery"
#: src/xz/coder.c:108
msgid "Memory usage limit is too low for the given filter setup."
msgstr "Limit użycia pamięci jest zbyt mały dla podanej konfiguracji filtra."
#: src/xz/coder.c:129
msgid "Using a preset in raw mode is discouraged."
msgstr "Użycie ustawień predefiniowanych w trybie surowym jest odradzane."
#: src/xz/coder.c:131
msgid "The exact options of the presets may vary between software versions."
msgstr "Dokładne opcje ustawień predefiniowanych mogą różnić się między wersjami oprogramowania."
#: src/xz/coder.c:157
msgid "The .lzma format supports only the LZMA1 filter"
msgstr "Format .lzma obsługuje tylko filtr LZMA1"
#: src/xz/coder.c:165
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 nie może być używany z formatem .xz"
#: src/xz/coder.c:182
msgid "Unsupported filter chain or filter options"
msgstr "Nieobsługiwany łańcuch filtrów lub opcje filtra"
#: src/xz/coder.c:190
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "Dekompresja będzie wymagała %s MiB pamięci."
#: src/xz/coder.c:247
#, c-format
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "Skorygowano rozmiar słownika LZMA%c z %s MiB do %s MiB aby nie przekroczyć limitu użycia pamięci %s MiB"
#. TRANSLATORS: When compression or decompression finishes,
#. and xz is going to remove the source file, xz first checks
#. if the source file still exists, and if it does, does its
#. device and inode numbers match what xz saw when it opened
#. the source file. If these checks fail, this message is
#. shown, %s being the filename, and the file is not deleted.
#. The check for device and inode numbers is there, because
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:137
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s: Plik wygląda na przeniesiony, nie zostanie usunięty"
#: src/xz/file_io.c:144 src/xz/file_io.c:589
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s: Nie można usunąć: %s"
#: src/xz/file_io.c:169
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s: Nie można ustawić właściciela pliku: %s"
#: src/xz/file_io.c:175
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s: Nie można ustawić grupy pliku: %s"
#: src/xz/file_io.c:194
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s: Nie można ustawić uprawnień pliku: %s"
#: src/xz/file_io.c:337 src/xz/file_io.c:420
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s: Jest dowiązaniem symbolicznym, pominięto"
#: src/xz/file_io.c:455
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s: Jest katalogiem, pominięto"
#: src/xz/file_io.c:461
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s: Nie jest zwykłym plikiem, pominięto"
#: src/xz/file_io.c:478
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s: Plik ma ustawiony bit setuid lub setgid, pominięto"
#: src/xz/file_io.c:485
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s: Plik ma ustawiony bit sticky, pominięto"
#: src/xz/file_io.c:492
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s: Plik wejściowy ma więcej niż jedno dowiązanie zwykłe, pominięto"
#: src/xz/file_io.c:713
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "Błąd podczas odtwarzania flagi O_APPEND dla standardowego wyjścia: %s"
#: src/xz/file_io.c:725
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s: Zamknięcie pliku nie powiodło się: %s"
#: src/xz/file_io.c:761 src/xz/file_io.c:945
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s: Zmiana pozycji nie powiodła się podczas próby utworzenia pliku rzadkiego: %s"
#: src/xz/file_io.c:820
#, c-format
msgid "%s: Read error: %s"
msgstr "%s: Błąd odczytu: %s"
#: src/xz/file_io.c:843
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%s: Błąd podczas zmiany pozycji w pliku: %s"
#: src/xz/file_io.c:853
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s: Nieoczekiwany koniec pliku"
#: src/xz/file_io.c:903
#, c-format
msgid "%s: Write error: %s"
msgstr "%s: Błąd zapisu: %s"
#: src/xz/hardware.c:100
msgid "Disabled"
msgstr "Wyłączony"
#. TRANSLATORS: Test with "xz --info-memory" to see if
#. the alignment looks nice.
#: src/xz/hardware.c:119
msgid "Total amount of physical memory (RAM): "
msgstr "Całkowita ilość pamięci fizycznej (RAM): "
#: src/xz/hardware.c:121
msgid "Memory usage limit for compression: "
msgstr "Limit użycia pamięci dla kompresji: "
#: src/xz/hardware.c:123
msgid "Memory usage limit for decompression: "
msgstr "Limit użycia pamięci dla dekompresji: "
#. TRANSLATORS: Indicates that there is no integrity check.
#. This string is used in tables, so the width must not
#. exceed ten columns with a fixed-width font.
#: src/xz/list.c:62
msgid "None"
msgstr "Brak"
#. TRANSLATORS: Indicates that integrity check name is not known,
#. but the Check ID is known (here 2). This and other "Unknown-N"
#. strings are used in tables, so the width must not exceed ten
#. columns with a fixed-width font. It's OK to omit the dash if
#. you need space for one extra letter, but don't use spaces.
#: src/xz/list.c:69
msgid "Unknown-2"
msgstr "Nieznany-2"
#: src/xz/list.c:70
msgid "Unknown-3"
msgstr "Nieznany-3"
#: src/xz/list.c:72
msgid "Unknown-5"
msgstr "Nieznany-5"
#: src/xz/list.c:73
msgid "Unknown-6"
msgstr "Nieznany-6"
#: src/xz/list.c:74
msgid "Unknown-7"
msgstr "Nieznany-7"
#: src/xz/list.c:75
msgid "Unknown-8"
msgstr "Nieznany-8"
#: src/xz/list.c:76
msgid "Unknown-9"
msgstr "Nieznany-9"
#: src/xz/list.c:78
msgid "Unknown-11"
msgstr "Nieznany11"
#: src/xz/list.c:79
msgid "Unknown-12"
msgstr "Nieznany12"
#: src/xz/list.c:80
msgid "Unknown-13"
msgstr "Nieznany13"
#: src/xz/list.c:81
msgid "Unknown-14"
msgstr "Nieznany14"
#: src/xz/list.c:82
msgid "Unknown-15"
msgstr "Nieznany15"
#: src/xz/list.c:126
#, c-format
msgid "%s: File is empty"
msgstr "%s: Plik jest pusty"
#: src/xz/list.c:131
#, c-format
msgid "%s: Too small to be a valid .xz file"
msgstr "%s: Za mały na poprawny plik .xz"
#. TRANSLATORS: These are column headings. From Strms (Streams)
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:603
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr "Strum. Bloki Spakowany Rozpakowany Wsp. Kontrola Nazwa pliku"
#: src/xz/list.c:643
#, c-format
msgid " Streams: %s\n"
msgstr " Strumienie: %s\n"
#: src/xz/list.c:645
#, c-format
msgid " Blocks: %s\n"
msgstr " Bloki: %s\n"
#: src/xz/list.c:647
#, c-format
msgid " Compressed size: %s\n"
msgstr " Rozmiar spakowany: %s\n"
#: src/xz/list.c:650
#, c-format
msgid " Uncompressed size: %s\n"
msgstr " Rozmiar rozpakowany: %s\n"
#: src/xz/list.c:653
#, c-format
msgid " Ratio: %s\n"
msgstr " Współczynnik: %s\n"
#: src/xz/list.c:655
#, c-format
msgid " Check: %s\n"
msgstr " Kontrola spójności: %s\n"
#: src/xz/list.c:656
#, c-format
msgid " Stream padding: %s\n"
msgstr " Wyrównanie strumienia: %s\n"
#. TRANSLATORS: The second line is column headings. All except
#. Check are right aligned; Check is left aligned. Test with
#. "xz -lv foo.xz".
#: src/xz/list.c:684
msgid ""
" Streams:\n"
" Stream Blocks CompOffset UncompOffset CompSize UncompSize Ratio Check Padding"
msgstr ""
" Strumienie:\n"
" Strumień Bloki Offset spak. Offset rozp. Rozm.spak. Rozm.rozp. Wsp. Kontrola Wyrównanie"
#. TRANSLATORS: The second line is column headings. All
#. except Check are right aligned; Check is left aligned.
#: src/xz/list.c:739
#, c-format
msgid ""
" Blocks:\n"
" Stream Block CompOffset UncompOffset TotalSize UncompSize Ratio Check"
msgstr ""
" Bloki:\n"
" Strumień Blok Offset spak. Offset rozp. Rozm.całkowity Rozm.rozp. Wsp. Kontrola"
#. TRANSLATORS: These are additional column headings
#. for the most verbose listing mode. CheckVal
#. (Check value), Flags, and Filters are left aligned.
#. Header (Block Header Size), CompSize, and MemUsage
#. are right aligned. %*s is replaced with 0-120
#. spaces to make the CheckVal column wide enough.
#. Test with "xz -lvv foo.xz".
#: src/xz/list.c:751
#, c-format
msgid " CheckVal %*s Header Flags CompSize MemUsage Filters"
msgstr " S.kontr. %*sNagłówek Flagi Rozm. spak. Uż.pamięci Filtry"
#: src/xz/list.c:829 src/xz/list.c:998
#, c-format
msgid " Memory needed: %s MiB\n"
msgstr " Wymagana pamięć: %s MiB\n"
#: src/xz/list.c:831 src/xz/list.c:1000
#, c-format
msgid " Sizes in headers: %s\n"
msgstr " Rozmiar w nagłówkach: %s\n"
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "Yes"
msgstr "Tak"
#: src/xz/list.c:832 src/xz/list.c:1001
msgid "No"
msgstr "Nie"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:977
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s plik\n"
msgstr[1] "%s pliki\n"
msgstr[2] "%s plików\n"
#: src/xz/list.c:990
msgid "Totals:"
msgstr "Sumarycznie:"
#: src/xz/list.c:991
#, c-format
msgid " Number of files: %s\n"
msgstr " Liczba plików: %s\n"
#: src/xz/list.c:1063
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list działa tylko z plikami .xz (--format=xz lub --format=auto)"
#: src/xz/list.c:1069
msgid "--list does not support reading from standard input"
msgstr "--list nie obsługuje odczytu ze standardowego wejścia"
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s: Błąd odczytu nazw plików: %s"
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s: Nieoczekiwany koniec wejścia podczas odczytu nazw plików"
#: src/xz/main.c:120
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr "%s: Napotkano znak NUL podczas odczytu nazw plików; może miało być `--files0' zamiast `--files'?"
#: src/xz/main.c:174
msgid "Compression and decompression with --robot are not supported yet."
msgstr "Kompresja i dekompresja z opcją --robot nie jest jeszcze obsługiwana."
#: src/xz/main.c:231
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "Nie można odczytać danych ze standardowego wejścia przy czytaniu nazw plików ze standardowego wejścia"
#. TRANSLATORS: This is the program name in the beginning
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:733
#, c-format
msgid "%s: "
msgstr "%s: "
#: src/xz/message.c:796 src/xz/message.c:846
msgid "Internal error (bug)"
msgstr "Błąd wewnętrzny"
#: src/xz/message.c:803
msgid "Cannot establish signal handlers"
msgstr "Nie można ustawić obsługi sygnałów"
#: src/xz/message.c:812
msgid "No integrity check; not verifying file integrity"
msgstr "Brak kontroli spójności; poprawność plików nie będzie weryfikowana"
#: src/xz/message.c:815
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "Nieobsługiwany typ kontroli spójności; poprawność plików nie będzie weryfikowana"
#: src/xz/message.c:822
msgid "Memory usage limit reached"
msgstr "Osiągnięto limit użycia pamięci"
#: src/xz/message.c:825
msgid "File format not recognized"
msgstr "Nie rozpoznany format pliku"
#: src/xz/message.c:828
msgid "Unsupported options"
msgstr "Nieobsługiwane opcje"
#: src/xz/message.c:831
msgid "Compressed data is corrupt"
msgstr "Dane skompresowane są uszkodzone"
#: src/xz/message.c:834
msgid "Unexpected end of input"
msgstr "Nieoczekiwany koniec wejścia"
#: src/xz/message.c:867
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "Wymagane jest %s MiB pamięci. Limit jest wyłączony."
#: src/xz/message.c:895
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "Wymagane jest %s MiB pamięci. Limit to %s."
#: src/xz/message.c:1062
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s: Łańcuch filtrów: %s\n"
#: src/xz/message.c:1072
#, c-format
msgid "Try `%s --help' for more information."
msgstr "Polecenie `%s --help' pokaże więcej informacji."
#: src/xz/message.c:1098
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
"Compress or decompress FILEs in the .xz format.\n"
"\n"
msgstr ""
"Składnia: %s [OPCJA]... [PLIK]...\n"
"Kompresja lub dekompresja PLIKÓW w formacie .xz.\n"
"\n"
#: src/xz/message.c:1105
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr ""
"Argumenty obowiązkowe dla opcji długich są obowiązkowe również dla opcji\n"
"krótkich.\n"
#: src/xz/message.c:1109
msgid " Operation mode:\n"
msgstr " Tryb pracy:\n"
#: src/xz/message.c:1112
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
" -t, --test test compressed file integrity\n"
" -l, --list list information about .xz files"
msgstr ""
" -z, --compress wymuszenie kompresji\n"
" -d, --decompress wymuszenie dekompresji\n"
" -t, --test sprawdzenie spójności plików skompresowanych\n"
" -l, --list wypisanie informacji o plikach .xz"
#: src/xz/message.c:1118
msgid ""
"\n"
" Operation modifiers:\n"
msgstr ""
"\n"
" Modyfikatory operacji:\n"
#: src/xz/message.c:1121
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
" -c, --stdout write to standard output and don't delete input files"
msgstr ""
" -k, --keep zachowanie (nieusuwanie) plików wejściowych\n"
" -f, --force nadpisywanie plików wyjściowych i (de)kompresja dowiązań\n"
" -c, --stdout zapis na standardowe wyjście, nieusuwanie plików wej."
#: src/xz/message.c:1127
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
" --files0[=FILE] like --files but use the null character as terminator"
msgstr ""
" --no-sparse nietworzenie plików rzadkich podczas dekompresji\n"
" -S, --suffix=.ROZ użycie rozszerzenia `.ROZ' dla plików skompresowanych\n"
" --files[=PLIK] odczyt nazw plików do przetworzenia z PLIKU; jeśli PLIK\n"
" nie został podany, nazwy są czytane ze standardowego\n"
" wejścia; muszą być zakończone znakiem nowej linii\n"
" --files0[=PLIK] podobnie do --files, ale znakiem kończącym musi być NUL"
#: src/xz/message.c:1135
msgid ""
"\n"
" Basic file format and compression options:\n"
msgstr ""
"\n"
" Podstawowe opcje formatu pliku i kompresji:\n"
#: src/xz/message.c:1137
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=FORM format pliki do kodowania lub dekodowania; możliwe to\n"
" `auto' (domyślny), `xz', 'lzma' i `raw'\n"
" -C, --check=TEST typ kontroli spójności: `none' (ostrożnie!),\n"
" `crc32', `crc64' (domyślny) lub `sha256'"
#: src/xz/message.c:1144
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
msgstr ""
" -0 ... -9 predefiniowane opcje kompresji; domyślna to 6; przed\n"
" użyciem wartości 7-9 należy wziąć pod uwagę wykorzystanie\n"
" pamięci przy kompresji *oraz* dekompresji!"
#: src/xz/message.c:1148
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
msgstr ""
" -e, --extreme próba poprawy współczynnika kompresji z użyciem większej\n"
" ilości czasu procesora; nie wpływa na wymagania\n"
" pamięciowe dekompresora"
#: src/xz/message.c:1153
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" set memory usage limit for compression, decompression,\n"
" or both; LIMIT is in bytes, % of RAM, or 0 for defaults"
msgstr ""
" --memlimit-compress=LIMIT\n"
" --memlimit-decompress=LIMIT\n"
" -M, --memlimit=LIMIT\n"
" ustawienie limitu użycia pamięci dla kompresji,\n"
" dekompresji lub obu; LIMIT jest w bajtach, % RAM lub 0\n"
" dla limitów domyślnych"
#: src/xz/message.c:1160
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr ""
" --no-adjust jeśli ustawienia kompresji przekraczają limit użycia\n"
" pamięci, zostanie zgłoszony błąd zamiast zmniejszania\n"
" ustawień"
#: src/xz/message.c:1166
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
msgstr ""
"\n"
" Łańcuch własnych filtrów do kompresji (alternatywa do używania -0 .. -9):"
#: src/xz/message.c:1175
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
" --lzma2[=OPTS] more of the following options (valid values; default):\n"
" preset=PRE reset options to a preset (0-9[e])\n"
" dict=NUM dictionary size (4KiB - 1536MiB; 8MiB)\n"
" lc=NUM number of literal context bits (0-4; 3)\n"
" lp=NUM number of literal position bits (0-4; 0)\n"
" pb=NUM number of position bits (0-4; 2)\n"
" mode=MODE compression mode (fast, normal; normal)\n"
" nice=NUM nice length of a match (2-273; 64)\n"
" mf=NAME match finder (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=NUM maximum search depth; 0=automatic (default)"
msgstr ""
"\n"
" --lzma1[=OPCJE] LZMA1 lub LZMA2; OPCJE to oddzielona przecinkami lista\n"
" --lzma2[=OPCJE] zera lub więcej następujących opcji (w nawiasach wartości\n"
" poprawne; domyślne):\n"
" preset=PRE ustawienie opcji na predefiniowane (0-9[e])\n"
" dict=ILE rozmiar słownika (4KiB - 1536MiB; 8MiB)\n"
" lc=ILE liczba bitów kontekstu literału (0-4; 3)\n"
" lp=ILE liczba bitów pozycji literału (0-4; 0)\n"
" pp=ILE liczba bitów pozycji (0-4; 2)\n"
" mode=TRYB tryb kompresji (fast, normal; normal)\n"
" nice=ILE długość dopasowania (2-273; 64)\n"
" mf=NAZWA dopasowywacz (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=ILE maks. głębokość szukania; 0=auto (domyślne)"
#: src/xz/message.c:1190
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --arm[=OPTS] ARM BCJ filter (little endian only)\n"
" --armthumb[=OPTS] ARM-Thumb BCJ filter (little endian only)\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
"\n"
" --x86[=OPCJE] Filtr BCJ x86 (32-bitowy lub 64-bitowy)\n"
" --powerpc[=OPCJE] Filtr BCJ PowerPC (tylko big-endian)\n"
" --ia64[=OPCJE] Filtr BCJ IA-64 (Itanium)\n"
" --arm[=OPCJE] Filtr BCJ ARM (tylko little-endian)\n"
" --armthumb[=OPCJE] Filtr BCJ ARM-Thumb (tylko little-endian)\n"
" --sparc[=OPCJE] Filtr BCJ SPARC\n"
" Poprawne OPCJE dla wszystkich filtrów BCJ:\n"
" start=ILE offset początku konwersji (domyślnie=0)"
#: src/xz/message.c:1202
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"
msgstr ""
"\n"
" --delta[=OPCJE] Filtr delta; poprawne OPCJE (poprawne wart.; domyślne):\n"
" dist=ILE odległość między bajtami odejmowanymi od\n"
" siebie (1-256; 1)"
#: src/xz/message.c:1210
msgid ""
"\n"
" Other options:\n"
msgstr ""
"\n"
" Inne opcje:\n"
#: src/xz/message.c:1213
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
msgstr ""
" -q, --quiet pominięcie ostrzeżeń; dwukrotne podanie pomija też błędy\n"
" -v, --verbose więcej informacji; dwukrotne podanie to jeszcze więcej"
#: src/xz/message.c:1218
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn ostrzeżenia nie mają wpływu na status zakończenia"
#: src/xz/message.c:1220
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot komunikaty w formacie dla maszyny (do skryptów)"
#: src/xz/message.c:1223
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr ""
" --info-memory wyświetlenie całkowitej ilości pamięci RAM oraz aktualnie\n"
" aktywnych limitów pamięci i zakończenie pracy"
#: src/xz/message.c:1226
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
msgstr ""
" -h, --help wyświetlenie krótkiego opisu (tylko podstawowe opcje)\n"
" -H, --long-help wyświetlenie tego długiego opisu i zakończenie"
#: src/xz/message.c:1230
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
msgstr ""
" -h, --help wyświetlenie tego krótkiego opisu i zakończenie\n"
" -H, --long-help wyświetlenie długiego opisu (także opcje zaawansowane)"
#: src/xz/message.c:1235
msgid " -V, --version display the version number and exit"
msgstr " -V, --version wyświetlenie informacji o wersji i zakończenie"
#: src/xz/message.c:1237
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
msgstr ""
"\n"
"Jeśli nie podano PLIKU lub PLIK to -, czytane jest standardowe wejście.\n"
#. TRANSLATORS: This message indicates the bug reporting address
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1243
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
"Błędy prosimy zgłaszać na adres <%s>\n"
"(w języku angielskim lub fińskim).\n"
"Błędy w tłumaczeniu prosimy zgłaszać na adres\n"
"<translation-team-pl@lists.sourceforge.net>.\n"
#: src/xz/message.c:1245
#, c-format
msgid "%s home page: <%s>\n"
msgstr "Strona domowa %s: <%s>\n"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s: Opcje muszą być parami `nazwa=wartość' rozdzielonymi przecinkami"
#: src/xz/options.c:93
#, c-format
msgid "%s: Invalid option name"
msgstr "%s: Błędna nazwa opcji"
#: src/xz/options.c:113
#, c-format
msgid "%s: Invalid option value"
msgstr "%s: Błędna wartość opcji"
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "Nieobsługiwane ustawienie predefiniowane LZMA1/LZMA2: %s"
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "Suma lc i lp nie może przekroczyć 4"
#: src/xz/options.c:359
#, c-format
msgid "The selected match finder requires at least nice=%<PRIu32>"
msgstr "Wybrany dopasowywacz wymaga przynajmniej nice=%<PRIu32>"
#: src/xz/suffix.c:101 src/xz/suffix.c:194
#, c-format
msgid "%s: With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "%s: Przy --format=raw i zapisie do pliku wymagana jest opcja --suffix=.ROZ"
#: src/xz/suffix.c:121
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s: Nazwa pliku ma nieznane rozszerzenie, pominięto"
#: src/xz/suffix.c:175 src/xz/suffix.c:184
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s: Plik już ma rozszerzenie `%s', pominięto"
#: src/xz/suffix.c:235
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s: Błędne rozszerzenie nazwy pliku"
#: src/xz/util.c:61
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s: Wartość nie jest nieujemną liczbą całkowitą"
#: src/xz/util.c:103
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s: Błędny przyrostek mnożnika"
#: src/xz/util.c:105
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "Poprawne przyrostki to `KiB' (2^10), `MiB' (2^20) i `GiB' (2^30)."
#: src/xz/util.c:122
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "Wartość opcji `%s' musi być w przedziale [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:247
msgid "Empty filename, skipping"
msgstr "Pusta nazwa pliku, pominięto"
#: src/xz/util.c:261
msgid "Compressed data cannot be read from a terminal"
msgstr "Dane skompresowane nie mogą być czytane z terminala"
#: src/xz/util.c:274
msgid "Compressed data cannot be written to a terminal"
msgstr "Dane skompresowane nie mogą być zapisywane na terminal"
#: src/common/tuklib_exit.c:39
msgid "Writing to standard output failed"
msgstr "Zapis na standardowe wyjście nie powiódł się"
#: src/common/tuklib_exit.c:42
msgid "Unknown error"
msgstr "Nieznany błąd"

View File

@ -103,9 +103,12 @@
# define UINT64_MAX UINT64_C(18446744073709551615) # define UINT64_MAX UINT64_C(18446744073709551615)
#endif #endif
// Interix has broken header files, which typedef size_t to unsigned long, // Incorrect(?) SIZE_MAX:
// - Interix headers typedef size_t to unsigned long,
// but a few lines later define SIZE_MAX to INT32_MAX. // but a few lines later define SIZE_MAX to INT32_MAX.
#ifdef __INTERIX // - SCO OpenServer (x86) headers typedef size_t to unsigned int
// but define SIZE_MAX to INT32_MAX.
#if defined(__INTERIX) || defined(_SCO_DS)
# undef SIZE_MAX # undef SIZE_MAX
#endif #endif

View File

@ -39,12 +39,14 @@ tuklib_open_stdxxx(int err_status)
| (i == 0 ? O_WRONLY : O_RDONLY)); | (i == 0 ? O_WRONLY : O_RDONLY));
if (fd != i) { if (fd != i) {
if (fd != -1)
(void)close(fd);
// Something went wrong. Exit with the // Something went wrong. Exit with the
// exit status we were given. Don't try // exit status we were given. Don't try
// to print an error message, since stderr // to print an error message, since stderr
// may very well be non-existent. This // may very well be non-existent. This
// error should be extremely rare. // error should be extremely rare.
(void)close(fd);
exit(err_status); exit(err_status);
} }
} }

View File

@ -33,6 +33,10 @@
# include <syidef.h> # include <syidef.h>
# include <ssdef.h> # include <ssdef.h>
#elif defined(AMIGA) || defined(__AROS__)
# define __USE_INLINE__
# include <proto/exec.h>
// AIX // AIX
#elif defined(TUKLIB_PHYSMEM_AIX) #elif defined(TUKLIB_PHYSMEM_AIX)
# include <sys/systemcfg.h> # include <sys/systemcfg.h>
@ -119,6 +123,9 @@ tuklib_physmem(void)
if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL) if (LIB$GETSYI(&val, &vms_mem, 0, 0, 0, 0) == SS$_NORMAL)
ret = (uint64_t)vms_mem * 8192; ret = (uint64_t)vms_mem * 8192;
#elif defined(AMIGA) || defined(__AROS__)
ret = AvailMem(MEMF_TOTAL);
#elif defined(TUKLIB_PHYSMEM_AIX) #elif defined(TUKLIB_PHYSMEM_AIX)
ret = _system_configuration.physmem; ret = _system_configuration.physmem;

View File

@ -24,7 +24,7 @@ liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/simple \ -I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \ -I$(top_srcdir)/src/common \
-DTUKLIB_SYMBOL_PREFIX=lzma_ -DTUKLIB_SYMBOL_PREFIX=lzma_
liblzma_la_LDFLAGS = -no-undefined -version-info 5:0:0 liblzma_la_LDFLAGS = -no-undefined -version-info 5:8:0
include $(srcdir)/common/Makefile.inc include $(srcdir)/common/Makefile.inc
include $(srcdir)/check/Makefile.inc include $(srcdir)/check/Makefile.inc
@ -88,3 +88,23 @@ endif
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = liblzma.pc pkgconfig_DATA = liblzma.pc
EXTRA_DIST += liblzma.pc.in EXTRA_DIST += liblzma.pc.in
pc_verbose = $(pc_verbose_@AM_V@)
pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
pc_verbose_0 = @echo " PC " $@;
liblzma.pc: $(srcdir)/liblzma.pc.in
$(AM_V_at)rm -f $@
$(pc_verbose)sed \
-e 's,@prefix[@],$(prefix),g' \
-e 's,@exec_prefix[@],$(exec_prefix),g' \
-e 's,@libdir[@],$(libdir),g' \
-e 's,@includedir[@],$(includedir),g' \
-e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
-e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
-e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
-e 's,@PTHREAD_LIBS[@],$(PTHREAD_LIBS),g' \
< $(srcdir)/liblzma.pc.in > $@ || { rm -f $@; exit 1; }
clean-local:
rm -f liblzma.pc

View File

@ -318,6 +318,9 @@ extern LZMA_API(lzma_ret) lzma_block_header_encode(
* The size of the Block Header must have already been decoded with * The size of the Block Header must have already been decoded with
* lzma_block_header_size_decode() macro and stored to block->header_size. * lzma_block_header_size_decode() macro and stored to block->header_size.
* *
* The integrity check type from Stream Header must have been stored
* to block->check.
*
* block->filters must have been allocated, but they don't need to be * block->filters must have been allocated, but they don't need to be
* initialized (possible existing filter options are not freed). * initialized (possible existing filter options are not freed).
* *
@ -483,6 +486,7 @@ extern LZMA_API(size_t) lzma_block_buffer_bound(size_t uncompressed_size)
* *
* \return - LZMA_OK: Encoding was successful. * \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space. * - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR * - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR * - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR * - LZMA_DATA_ERROR

View File

@ -66,6 +66,10 @@
* This function is a wrapper for lzma_raw_encoder_memusage(). * This function is a wrapper for lzma_raw_encoder_memusage().
* *
* \param preset Compression preset (level and possible flags) * \param preset Compression preset (level and possible flags)
*
* \return Number of bytes of memory required for the given
* preset when encoding. If an error occurs, for example
* due to unsupported preset, UINT64_MAX is returned.
*/ */
extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset) extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure; lzma_nothrow lzma_attr_pure;
@ -77,6 +81,11 @@ extern LZMA_API(uint64_t) lzma_easy_encoder_memusage(uint32_t preset)
* This function is a wrapper for lzma_raw_decoder_memusage(). * This function is a wrapper for lzma_raw_decoder_memusage().
* *
* \param preset Compression preset (level and possible flags) * \param preset Compression preset (level and possible flags)
*
* \return Number of bytes of memory required to decompress a file
* that was compressed using the given preset. If an error
* occurs, for example due to unsupported preset, UINT64_MAX
* is returned.
*/ */
extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset) extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
lzma_nothrow lzma_attr_pure; lzma_nothrow lzma_attr_pure;
@ -148,6 +157,7 @@ extern LZMA_API(lzma_ret) lzma_easy_encoder(
* *
* \return - LZMA_OK: Encoding was successful. * \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space. * - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR * - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR * - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR * - LZMA_DATA_ERROR
@ -171,6 +181,7 @@ extern LZMA_API(lzma_ret) lzma_easy_buffer_encode(
* *
* \return - LZMA_OK: Initialization was successful. * \return - LZMA_OK: Initialization was successful.
* - LZMA_MEM_ERROR * - LZMA_MEM_ERROR
* - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR * - LZMA_OPTIONS_ERROR
* - LZMA_PROG_ERROR * - LZMA_PROG_ERROR
*/ */
@ -250,6 +261,7 @@ extern LZMA_API(size_t) lzma_stream_buffer_bound(size_t uncompressed_size)
* *
* \return - LZMA_OK: Encoding was successful. * \return - LZMA_OK: Encoding was successful.
* - LZMA_BUF_ERROR: Not enough output buffer space. * - LZMA_BUF_ERROR: Not enough output buffer space.
* - LZMA_UNSUPPORTED_CHECK
* - LZMA_OPTIONS_ERROR * - LZMA_OPTIONS_ERROR
* - LZMA_MEM_ERROR * - LZMA_MEM_ERROR
* - LZMA_DATA_ERROR * - LZMA_DATA_ERROR

View File

@ -131,7 +131,9 @@ extern LZMA_API(lzma_ret) lzma_filters_copy(const lzma_filter *src,
* .id == LZMA_VLI_UNKNOWN. * .id == LZMA_VLI_UNKNOWN.
* *
* \return Number of bytes of memory required for the given * \return Number of bytes of memory required for the given
* filter chain when encoding. * filter chain when encoding. If an error occurs,
* for example due to unsupported filter chain,
* UINT64_MAX is returned.
*/ */
extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters) extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
lzma_nothrow lzma_attr_pure; lzma_nothrow lzma_attr_pure;
@ -148,7 +150,9 @@ extern LZMA_API(uint64_t) lzma_raw_encoder_memusage(const lzma_filter *filters)
* .id == LZMA_VLI_UNKNOWN. * .id == LZMA_VLI_UNKNOWN.
* *
* \return Number of bytes of memory required for the given * \return Number of bytes of memory required for the given
* filter chain when decoding. * filter chain when decoding. If an error occurs,
* for example due to unsupported filter chain,
* UINT64_MAX is returned.
*/ */
extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters) extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters)
lzma_nothrow lzma_attr_pure; lzma_nothrow lzma_attr_pure;

View File

@ -22,7 +22,7 @@
*/ */
#define LZMA_VERSION_MAJOR 5 #define LZMA_VERSION_MAJOR 5
#define LZMA_VERSION_MINOR 0 #define LZMA_VERSION_MINOR 0
#define LZMA_VERSION_PATCH 0 #define LZMA_VERSION_PATCH 8
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
#ifndef LZMA_VERSION_COMMIT #ifndef LZMA_VERSION_COMMIT

View File

@ -6,7 +6,6 @@
/// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they /// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they
/// are imported to liblzma, SSE instructions need to be used /// are imported to liblzma, SSE instructions need to be used
/// conditionally to keep the code working on older boxes. /// conditionally to keep the code working on older boxes.
/// We could also support using some external libary for SHA-256.
// //
// This code is based on the code found from 7-Zip, which has a modified // This code is based on the code found from 7-Zip, which has a modified
// version of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>. // version of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>.
@ -81,7 +80,7 @@ static const uint32_t SHA256_K[64] = {
static void static void
transform(uint32_t state[static 8], const uint32_t data[static 16]) transform(uint32_t state[8], const uint32_t data[16])
{ {
uint32_t W[16]; uint32_t W[16];
uint32_t T[8]; uint32_t T[8];

View File

@ -26,6 +26,11 @@ struct lzma_coder_s {
SEQ_CODE, SEQ_CODE,
} sequence; } sequence;
/// If true, reject files that are unlikely to be .lzma files.
/// If false, more non-.lzma files get accepted and will give
/// LZMA_DATA_ERROR either immediately or after a few output bytes.
bool picky;
/// Position in the header fields /// Position in the header fields
size_t pos; size_t pos;
@ -46,7 +51,7 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
alone_decode(lzma_coder *coder, alone_decode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((unused)), lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,
@ -68,13 +73,13 @@ alone_decode(lzma_coder *coder,
|= (size_t)(in[*in_pos]) << (coder->pos * 8); |= (size_t)(in[*in_pos]) << (coder->pos * 8);
if (++coder->pos == 4) { if (++coder->pos == 4) {
if (coder->options.dict_size != UINT32_MAX) { if (coder->picky && coder->options.dict_size
!= UINT32_MAX) {
// A hack to ditch tons of false positives: // A hack to ditch tons of false positives:
// We allow only dictionary sizes that are // We allow only dictionary sizes that are
// 2^n or 2^n + 2^(n-1). LZMA_Alone created // 2^n or 2^n + 2^(n-1). LZMA_Alone created
// only files with 2^n, but accepts any // only files with 2^n, but accepts any
// dictionary size. If someone complains, this // dictionary size.
// will be reconsidered.
uint32_t d = coder->options.dict_size - 1; uint32_t d = coder->options.dict_size - 1;
d |= d >> 2; d |= d >> 2;
d |= d >> 3; d |= d >> 3;
@ -103,9 +108,9 @@ alone_decode(lzma_coder *coder,
// Another hack to ditch false positives: Assume that // Another hack to ditch false positives: Assume that
// if the uncompressed size is known, it must be less // if the uncompressed size is known, it must be less
// than 256 GiB. Again, if someone complains, this // than 256 GiB.
// will be reconsidered. if (coder->picky
if (coder->uncompressed_size != LZMA_VLI_UNKNOWN && coder->uncompressed_size != LZMA_VLI_UNKNOWN
&& coder->uncompressed_size && coder->uncompressed_size
>= (LZMA_VLI_C(1) << 38)) >= (LZMA_VLI_C(1) << 38))
return LZMA_FORMAT_ERROR; return LZMA_FORMAT_ERROR;
@ -189,7 +194,7 @@ alone_decoder_memconfig(lzma_coder *coder, uint64_t *memusage,
extern lzma_ret extern lzma_ret
lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
uint64_t memlimit) uint64_t memlimit, bool picky)
{ {
lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator); lzma_next_coder_init(&lzma_alone_decoder_init, next, allocator);
@ -208,6 +213,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
} }
next->coder->sequence = SEQ_PROPERTIES; next->coder->sequence = SEQ_PROPERTIES;
next->coder->picky = picky;
next->coder->pos = 0; next->coder->pos = 0;
next->coder->options.dict_size = 0; next->coder->options.dict_size = 0;
next->coder->options.preset_dict = NULL; next->coder->options.preset_dict = NULL;
@ -223,7 +229,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
extern LZMA_API(lzma_ret) extern LZMA_API(lzma_ret)
lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit)
{ {
lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit, false);
strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_FINISH] = true; strm->internal->supported_actions[LZMA_FINISH] = true;

View File

@ -16,7 +16,8 @@
#include "common.h" #include "common.h"
extern lzma_ret lzma_alone_decoder_init(lzma_next_coder *next, extern lzma_ret lzma_alone_decoder_init(
lzma_allocator *allocator, uint64_t memlimit); lzma_next_coder *next, lzma_allocator *allocator,
uint64_t memlimit, bool picky);
#endif #endif

View File

@ -32,7 +32,7 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
alone_encode(lzma_coder *coder, alone_encode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((unused)), lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,
@ -103,7 +103,7 @@ alone_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
if (options->dict_size < LZMA_DICT_SIZE_MIN) if (options->dict_size < LZMA_DICT_SIZE_MIN)
return LZMA_OPTIONS_ERROR; return LZMA_OPTIONS_ERROR;
// Round up to to the next 2^n or 2^n + 2^(n - 1) depending on which // Round up to the next 2^n or 2^n + 2^(n - 1) depending on which
// one is the next unless it is UINT32_MAX. While the header would // one is the next unless it is UINT32_MAX. While the header would
// allow any 32-bit integer, we do this to keep the decoder of liblzma // allow any 32-bit integer, we do this to keep the decoder of liblzma
// accepting the resulting files. // accepting the resulting files.

View File

@ -54,7 +54,7 @@ auto_decode(lzma_coder *coder, lzma_allocator *allocator,
coder->memlimit, coder->flags)); coder->memlimit, coder->flags));
} else { } else {
return_if_error(lzma_alone_decoder_init(&coder->next, return_if_error(lzma_alone_decoder_init(&coder->next,
allocator, coder->memlimit)); allocator, coder->memlimit, true));
// If the application wants to know about missing // If the application wants to know about missing
// integrity check or about the check in general, we // integrity check or about the check in general, we

View File

@ -226,16 +226,23 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
const uint8_t *in, size_t in_size, const uint8_t *in, size_t in_size,
uint8_t *out, size_t *out_pos, size_t out_size) uint8_t *out, size_t *out_pos, size_t out_size)
{ {
// Sanity checks // Validate the arguments.
if (block == NULL || block->filters == NULL if (block == NULL || (in == NULL && in_size != 0) || out == NULL
|| (in == NULL && in_size != 0) || out == NULL
|| out_pos == NULL || *out_pos > out_size) || out_pos == NULL || *out_pos > out_size)
return LZMA_PROG_ERROR; return LZMA_PROG_ERROR;
// Check the version field. // The contents of the structure may depend on the version so
// check the version before validating the contents of *block.
if (block->version != 0) if (block->version != 0)
return LZMA_OPTIONS_ERROR; return LZMA_OPTIONS_ERROR;
if ((unsigned int)(block->check) > LZMA_CHECK_ID_MAX
|| block->filters == NULL)
return LZMA_PROG_ERROR;
if (!lzma_check_is_supported(block->check))
return LZMA_UNSUPPORTED_CHECK;
// Size of a Block has to be a multiple of four, so limit the size // Size of a Block has to be a multiple of four, so limit the size
// here already. This way we don't need to check it again when adding // here already. This way we don't need to check it again when adding
// Block Padding. // Block Padding.
@ -243,8 +250,7 @@ lzma_block_buffer_encode(lzma_block *block, lzma_allocator *allocator,
// Get the size of the Check field. // Get the size of the Check field.
const size_t check_size = lzma_check_size(block->check); const size_t check_size = lzma_check_size(block->check);
if (check_size == UINT32_MAX) assert(check_size != UINT32_MAX);
return LZMA_PROG_ERROR;
// Reserve space for the Check field. // Reserve space for the Check field.
if (out_size - *out_pos <= check_size) if (out_size - *out_pos <= check_size)

View File

@ -144,7 +144,7 @@ block_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
block_encoder_update(lzma_coder *coder, lzma_allocator *allocator, block_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
const lzma_filter *filters lzma_attribute((unused)), const lzma_filter *filters lzma_attribute((__unused__)),
const lzma_filter *reversed_filters) const lzma_filter *reversed_filters)
{ {
if (coder->sequence != SEQ_CODE) if (coder->sequence != SEQ_CODE)
@ -161,6 +161,11 @@ lzma_block_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
{ {
lzma_next_coder_init(&lzma_block_encoder_init, next, allocator); lzma_next_coder_init(&lzma_block_encoder_init, next, allocator);
if (block == NULL)
return LZMA_PROG_ERROR;
// The contents of the structure may depend on the version so
// check the version first.
if (block->version != 0) if (block->version != 0)
return LZMA_OPTIONS_ERROR; return LZMA_OPTIONS_ERROR;

View File

@ -35,7 +35,7 @@ lzma_version_string(void)
// Memory allocation // // Memory allocation //
/////////////////////// ///////////////////////
extern void * lzma_attribute((malloc)) extern void * lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
lzma_alloc(size_t size, lzma_allocator *allocator) lzma_alloc(size_t size, lzma_allocator *allocator)
{ {
// Some malloc() variants return NULL if called with size == 0. // Some malloc() variants return NULL if called with size == 0.

View File

@ -205,7 +205,7 @@ struct lzma_internal_s {
/// Allocates memory /// Allocates memory
extern void *lzma_alloc(size_t size, lzma_allocator *allocator) extern void *lzma_alloc(size_t size, lzma_allocator *allocator)
lzma_attribute((malloc)) lzma_attr_alloc_size(1); lzma_attribute((__malloc__)) lzma_attr_alloc_size(1);
/// Frees memory /// Frees memory
extern void lzma_free(void *ptr, lzma_allocator *allocator); extern void lzma_free(void *ptr, lzma_allocator *allocator);

View File

@ -43,7 +43,7 @@ static const struct {
.changes_size = true, .changes_size = true,
}, },
#endif #endif
#ifdef HAVE_DECODER_LZMA2 #if defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2)
{ {
.id = LZMA_FILTER_LZMA2, .id = LZMA_FILTER_LZMA2,
.options_size = sizeof(lzma_options_lzma), .options_size = sizeof(lzma_options_lzma),
@ -52,7 +52,7 @@ static const struct {
.changes_size = true, .changes_size = true,
}, },
#endif #endif
#ifdef HAVE_DECODER_X86 #if defined(HAVE_ENCODER_X86) || defined(HAVE_DECODER_X86)
{ {
.id = LZMA_FILTER_X86, .id = LZMA_FILTER_X86,
.options_size = sizeof(lzma_options_bcj), .options_size = sizeof(lzma_options_bcj),
@ -70,7 +70,7 @@ static const struct {
.changes_size = false, .changes_size = false,
}, },
#endif #endif
#ifdef HAVE_DECODER_IA64 #if defined(HAVE_ENCODER_IA64) || defined(HAVE_DECODER_IA64)
{ {
.id = LZMA_FILTER_IA64, .id = LZMA_FILTER_IA64,
.options_size = sizeof(lzma_options_bcj), .options_size = sizeof(lzma_options_bcj),

View File

@ -398,10 +398,13 @@ extern LZMA_API(lzma_index *)
lzma_index_init(lzma_allocator *allocator) lzma_index_init(lzma_allocator *allocator)
{ {
lzma_index *i = index_init_plain(allocator); lzma_index *i = index_init_plain(allocator);
if (i == NULL)
return NULL;
index_stream *s = index_stream_init(0, 0, 1, 0, allocator); index_stream *s = index_stream_init(0, 0, 1, 0, allocator);
if (i == NULL || s == NULL) { if (s == NULL) {
index_stream_end(s, allocator);
lzma_free(i, allocator); lzma_free(i, allocator);
return NULL;
} }
index_tree_append(&i->streams, &s->node); index_tree_append(&i->streams, &s->node);

View File

@ -56,10 +56,11 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
index_decode(lzma_coder *coder, lzma_allocator *allocator, index_decode(lzma_coder *coder, lzma_allocator *allocator,
const uint8_t *restrict in, size_t *restrict in_pos, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out lzma_attribute((unused)), size_t in_size,
size_t *restrict out_pos lzma_attribute((unused)), uint8_t *restrict out lzma_attribute((__unused__)),
size_t out_size lzma_attribute((unused)), size_t *restrict out_pos lzma_attribute((__unused__)),
lzma_action action lzma_attribute((unused))) size_t out_size lzma_attribute((__unused__)),
lzma_action action lzma_attribute((__unused__)))
{ {
// Similar optimization as in index_encoder.c // Similar optimization as in index_encoder.c
const size_t in_start = *in_pos; const size_t in_start = *in_pos;

View File

@ -42,12 +42,13 @@ struct lzma_coder_s {
static lzma_ret static lzma_ret
index_encode(lzma_coder *coder, index_encode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((unused)), lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in lzma_attribute((unused)), const uint8_t *restrict in lzma_attribute((__unused__)),
size_t *restrict in_pos lzma_attribute((unused)), size_t *restrict in_pos lzma_attribute((__unused__)),
size_t in_size lzma_attribute((unused)), size_t in_size lzma_attribute((__unused__)),
uint8_t *restrict out, size_t *restrict out_pos, uint8_t *restrict out, size_t *restrict out_pos,
size_t out_size, lzma_action action lzma_attribute((unused))) size_t out_size,
lzma_action action lzma_attribute((__unused__)))
{ {
// Position where to start calculating CRC32. The idea is that we // Position where to start calculating CRC32. The idea is that we
// need to call lzma_crc32() only once per call to index_encode(). // need to call lzma_crc32() only once per call to index_encode().

View File

@ -51,6 +51,9 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
|| out_pos_ptr == NULL || *out_pos_ptr > out_size) || out_pos_ptr == NULL || *out_pos_ptr > out_size)
return LZMA_PROG_ERROR; return LZMA_PROG_ERROR;
if (!lzma_check_is_supported(check))
return LZMA_UNSUPPORTED_CHECK;
// Note for the paranoids: Index encoder prevents the Stream from // Note for the paranoids: Index encoder prevents the Stream from
// getting too big and still being accepted with LZMA_OK, and Block // getting too big and still being accepted with LZMA_OK, and Block
// encoder catches if the input is too big. So we don't need to // encoder catches if the input is too big. So we don't need to
@ -81,24 +84,30 @@ lzma_stream_buffer_encode(lzma_filter *filters, lzma_check check,
out_pos += LZMA_STREAM_HEADER_SIZE; out_pos += LZMA_STREAM_HEADER_SIZE;
// Block // Encode a Block but only if there is at least one byte of input.
lzma_block block = { lzma_block block = {
.version = 0, .version = 0,
.check = check, .check = check,
.filters = filters, .filters = filters,
}; };
if (in_size > 0)
return_if_error(lzma_block_buffer_encode(&block, allocator, return_if_error(lzma_block_buffer_encode(&block, allocator,
in, in_size, out, &out_pos, out_size)); in, in_size, out, &out_pos, out_size));
// Index // Index
{ {
// Create an Index with one Record. // Create an Index. It will have one Record if there was
// at least one byte of input to encode. Otherwise the
// Index will be empty.
lzma_index *i = lzma_index_init(allocator); lzma_index *i = lzma_index_init(allocator);
if (i == NULL) if (i == NULL)
return LZMA_MEM_ERROR; return LZMA_MEM_ERROR;
lzma_ret ret = lzma_index_append(i, allocator, lzma_ret ret = LZMA_OK;
if (in_size > 0)
ret = lzma_index_append(i, allocator,
lzma_block_unpadded_size(&block), lzma_block_unpadded_size(&block),
block.uncompressed_size); block.uncompressed_size);

View File

@ -280,6 +280,7 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->end = &stream_encoder_end; next->end = &stream_encoder_end;
next->update = &stream_encoder_update; next->update = &stream_encoder_update;
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
next->coder->block_encoder = LZMA_NEXT_CODER_INIT; next->coder->block_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index_encoder = LZMA_NEXT_CODER_INIT; next->coder->index_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index = NULL; next->coder->index = NULL;
@ -289,7 +290,6 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->sequence = SEQ_STREAM_HEADER; next->coder->sequence = SEQ_STREAM_HEADER;
next->coder->block_options.version = 0; next->coder->block_options.version = 0;
next->coder->block_options.check = check; next->coder->block_options.check = check;
next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
// Initialize the Index // Initialize the Index
lzma_index_end(next->coder->index, allocator); lzma_index_end(next->coder->index, allocator);

View File

@ -85,7 +85,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
static lzma_ret static lzma_ret
delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator, delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
const lzma_filter *filters_null lzma_attribute((unused)), const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters) const lzma_filter *reversed_filters)
{ {
// Delta doesn't and will never support changing the options in // Delta doesn't and will never support changing the options in

View File

@ -126,7 +126,7 @@ decode_buffer(lzma_coder *coder,
static lzma_ret static lzma_ret
lz_decode(lzma_coder *coder, lz_decode(lzma_coder *coder,
lzma_allocator *allocator lzma_attribute((unused)), lzma_allocator *allocator lzma_attribute((__unused__)),
const uint8_t *restrict in, size_t *restrict in_pos, const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size, size_t *restrict out_pos, size_t out_size,

View File

@ -480,7 +480,7 @@ lz_encoder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator, lz_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
const lzma_filter *filters_null lzma_attribute((unused)), const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters) const lzma_filter *reversed_filters)
{ {
if (coder->lz.options_update == NULL) if (coder->lz.options_update == NULL)

View File

@ -39,7 +39,7 @@
// Endianness doesn't matter in hash_2_calc() (no effect on the output). // Endianness doesn't matter in hash_2_calc() (no effect on the output).
#ifdef TUKLIB_FAST_UNALIGNED_ACCESS #ifdef TUKLIB_FAST_UNALIGNED_ACCESS
# define hash_2_calc() \ # define hash_2_calc() \
const uint32_t hash_value = *(const uint16_t *)(cur); const uint32_t hash_value = *(const uint16_t *)(cur)
#else #else
# define hash_2_calc() \ # define hash_2_calc() \
const uint32_t hash_value \ const uint32_t hash_value \

View File

@ -67,6 +67,10 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
const uint32_t control = in[*in_pos]; const uint32_t control = in[*in_pos];
++*in_pos; ++*in_pos;
// End marker
if (control == 0x00)
return LZMA_STREAM_END;
if (control >= 0xE0 || control == 1) { if (control >= 0xE0 || control == 1) {
// Dictionary reset implies that next LZMA chunk has // Dictionary reset implies that next LZMA chunk has
// to set new properties. // to set new properties.
@ -104,10 +108,6 @@ lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
&coder->options); &coder->options);
} }
} else { } else {
// End marker
if (control == 0x00)
return LZMA_STREAM_END;
// Invalid control values // Invalid control values
if (control > 2) if (control > 2)
return LZMA_DATA_ERROR; return LZMA_DATA_ERROR;

View File

@ -374,7 +374,7 @@ lzma_lzma2_props_encode(const void *options, uint8_t *out)
const lzma_options_lzma *const opt = options; const lzma_options_lzma *const opt = options;
uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN); uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN);
// Round up to to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending // Round up to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending
// on which one is the next: // on which one is the next:
--d; --d;
d |= d >> 2; d |= d >> 2;

View File

@ -30,14 +30,16 @@ lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset)
options->lp = LZMA_LP_DEFAULT; options->lp = LZMA_LP_DEFAULT;
options->pb = LZMA_PB_DEFAULT; options->pb = LZMA_PB_DEFAULT;
options->dict_size = UINT32_C(1) << (uint8_t []){ static const uint8_t dict_pow2[]
18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level]; = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 };
options->dict_size = UINT32_C(1) << dict_pow2[level];
if (level <= 3) { if (level <= 3) {
options->mode = LZMA_MODE_FAST; options->mode = LZMA_MODE_FAST;
options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4;
options->nice_len = level <= 1 ? 128 : 273; options->nice_len = level <= 1 ? 128 : 273;
options->depth = (uint8_t []){ 4, 8, 24, 48 }[level]; static const uint8_t depths[] = { 4, 8, 24, 48 };
options->depth = depths[level];
} else { } else {
options->mode = LZMA_MODE_NORMAL; options->mode = LZMA_MODE_NORMAL;
options->mf = LZMA_MF_BT4; options->mf = LZMA_MF_BT4;

View File

@ -15,7 +15,7 @@
static size_t static size_t
arm_code(lzma_simple *simple lzma_attribute((unused)), arm_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View File

@ -15,7 +15,7 @@
static size_t static size_t
armthumb_code(lzma_simple *simple lzma_attribute((unused)), armthumb_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View File

@ -15,7 +15,7 @@
static size_t static size_t
ia64_code(lzma_simple *simple lzma_attribute((unused)), ia64_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View File

@ -15,7 +15,7 @@
static size_t static size_t
powerpc_code(lzma_simple *simple lzma_attribute((unused)), powerpc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View File

@ -35,9 +35,6 @@ copy_or_code(lzma_coder *coder, lzma_allocator *allocator,
} else { } else {
// Call the next coder in the chain to provide us some data. // Call the next coder in the chain to provide us some data.
// We don't care about uncompressed_size here, because
// the next filter in the chain will do it for us (since
// we don't change the size of the data).
const lzma_ret ret = coder->next.code( const lzma_ret ret = coder->next.code(
coder->next.coder, allocator, coder->next.coder, allocator,
in, in_pos, in_size, in, in_pos, in_size,
@ -110,7 +107,7 @@ simple_code(lzma_coder *coder, lzma_allocator *allocator,
// filtered if the buffer sizes used by the application are reasonable. // filtered if the buffer sizes used by the application are reasonable.
const size_t out_avail = out_size - *out_pos; const size_t out_avail = out_size - *out_pos;
const size_t buf_avail = coder->size - coder->pos; const size_t buf_avail = coder->size - coder->pos;
if (out_avail > buf_avail) { if (out_avail > buf_avail || buf_avail == 0) {
// Store the old position so that we know from which byte // Store the old position so that we know from which byte
// to start filtering. // to start filtering.
const size_t out_start = *out_pos; const size_t out_start = *out_pos;
@ -212,7 +209,7 @@ simple_coder_end(lzma_coder *coder, lzma_allocator *allocator)
static lzma_ret static lzma_ret
simple_coder_update(lzma_coder *coder, lzma_allocator *allocator, simple_coder_update(lzma_coder *coder, lzma_allocator *allocator,
const lzma_filter *filters_null lzma_attribute((unused)), const lzma_filter *filters_null lzma_attribute((__unused__)),
const lzma_filter *reversed_filters) const lzma_filter *reversed_filters)
{ {
// No update support, just call the next filter in the chain. // No update support, just call the next filter in the chain.

View File

@ -22,8 +22,7 @@ struct lzma_coder_s {
/// Next filter in the chain /// Next filter in the chain
lzma_next_coder next; lzma_next_coder next;
/// True if the next coder in the chain has returned LZMA_STREAM_END /// True if the next coder in the chain has returned LZMA_STREAM_END.
/// or if we have processed uncompressed_size bytes.
bool end_was_reached; bool end_was_reached;
/// True if filter() should encode the data; false to decode. /// True if filter() should encode the data; false to decode.

View File

@ -15,7 +15,7 @@
static size_t static size_t
sparc_code(lzma_simple *simple lzma_attribute((unused)), sparc_code(lzma_simple *simple lzma_attribute((__unused__)),
uint32_t now_pos, bool is_encoder, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size) uint8_t *buffer, size_t size)
{ {

View File

@ -4,14 +4,14 @@
.\" This file has been put into the public domain. .\" This file has been put into the public domain.
.\" You can do whatever you want with this file. .\" You can do whatever you want with this file.
.\" .\"
.TH LZMAINFO 1 "2010-09-27" "Tukaani" "XZ Utils" .TH LZMAINFO 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME .SH NAME
lzmainfo \- show information stored in the .lzma file header lzmainfo \- show information stored in the .lzma file header
.SH SYNOPSIS .SH SYNOPSIS
.B lzmainfo .B lzmainfo
.RB [ \-\-help ] .RB [ \-\-help ]
.RB [ \-\-version ] .RB [ \-\-version ]
.RI [ file ]... .RI [ file... ]
.SH DESCRIPTION .SH DESCRIPTION
.B lzmainfo .B lzmainfo
shows information stored in the shows information stored in the

View File

@ -26,7 +26,7 @@
#endif #endif
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
help(void) help(void)
{ {
printf( printf(
@ -45,7 +45,7 @@ _("Usage: %s [--help] [--version] [FILE]...\n"
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
version(void) version(void)
{ {
puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING); puts("lzmainfo (" PACKAGE_NAME ") " LZMA_VERSION_STRING);

View File

@ -120,10 +120,12 @@ elif test $# -eq 2; then
( ($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null | ( ($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
eval "$cmp" /dev/fd/5 - >&3) 5<&0 eval "$cmp" /dev/fd/5 - >&3) 5<&0
) )
cmp_status=$?
case $xz_status in case $xz_status in
*[1-9]*) xz_status=1;; *[1-9]*) xz_status=1;;
*) xz_status=0;; *) xz_status=0;;
esac esac
(exit $cmp_status)
else else
F=`expr "/$2" : '.*/\(.*\)[-.][ablmtxz2]*$'` || F=$prog F=`expr "/$2" : '.*/\(.*\)[-.][ablmtxz2]*$'` || F=$prog
tmp= tmp=

View File

@ -27,7 +27,7 @@
xz='@xz@ --format=auto' xz='@xz@ --format=auto'
unset GZIP BZIP BZIP2 unset GZIP BZIP BZIP2
case ${0##/*} in case ${0##*/} in
*egrep*) prog=xzegrep; grep=${GREP:-egrep};; *egrep*) prog=xzegrep; grep=${GREP:-egrep};;
*fgrep*) prog=xzfgrep; grep=${GREP:-fgrep};; *fgrep*) prog=xzfgrep; grep=${GREP:-fgrep};;
*) prog=xzgrep; grep=${GREP:-grep};; *) prog=xzgrep; grep=${GREP:-grep};;
@ -35,7 +35,7 @@ esac
version="$prog (@PACKAGE_NAME@) @VERSION@" version="$prog (@PACKAGE_NAME@) @VERSION@"
usage="Usage: ${0##/*} [OPTION]... [-e] PATTERN [FILE]... usage="Usage: ${0##*/} [OPTION]... [-e] PATTERN [FILE]...
Look for instances of PATTERN in the input FILEs, using their Look for instances of PATTERN in the input FILEs, using their
uncompressed contents if they are compressed. uncompressed contents if they are compressed.
@ -106,10 +106,12 @@ while test $# -ne 0; do
with_filename=1 with_filename=1
continue;; continue;;
(-l | --files-with-*) (-l | --files-with-*)
files_with_matches=1;; files_with_matches=1
continue;;
(-L | --files-witho*) (-L | --files-witho*)
files_without_matches=1;; files_without_matches=1
(--no-f*) continue;;
(-h | --no-f*)
no_filename=1;; no_filename=1;;
(-V | --v | --ve | --ver | --vers | --versi | --versio | --version) (-V | --v | --ve | --ver | --vers | --versi | --versio | --version)
echo "$version" || exit 2 echo "$version" || exit 2
@ -126,6 +128,10 @@ while test $# -ne 0; do
grep="$grep $option$optarg" grep="$grep $option$optarg"
done done
if test $files_with_matches -eq 1 || test $files_without_matches -eq 1; then
grep="$grep -q"
fi
eval "set -- $operands "'${1+"$@"}' eval "set -- $operands "'${1+"$@"}'
if test $have_pat -eq 0; then if test $have_pat -eq 0; then
@ -143,7 +149,9 @@ if test $# -eq 0; then
fi fi
exec 3>&1 exec 3>&1
res=0
# res=1 means that no file matched yet
res=1
for i; do for i; do
case $i in case $i in
@ -156,9 +164,9 @@ for i; do
exec 5>&1 exec 5>&1
($uncompress -- "$i" 5>&-; echo $? >&5) 3>&- | ($uncompress -- "$i" 5>&-; echo $? >&5) 3>&- |
if test $files_with_matches -eq 1; then if test $files_with_matches -eq 1; then
eval "$grep" -q && { printf '%s\n' "$i" || exit 2; } eval "$grep" && { printf '%s\n' "$i" || exit 2; }
elif test $files_without_matches -eq 1; then elif test $files_without_matches -eq 1; then
eval "$grep" -q || { eval "$grep" || {
r=$? r=$?
if test $r -eq 1; then if test $r -eq 1; then
printf '%s\n' "$i" || r=2 printf '%s\n' "$i" || r=2
@ -190,7 +198,17 @@ for i; do
fi >&3 5>&- fi >&3 5>&-
) )
r=$? r=$?
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 || r=2
test $res -lt $r && res=$r # fail occured previously, nothing worse can happen
test $res -gt 1 && continue
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 \
|| test "$(kill -l "$xz_status" 2> /dev/null)" = "PIPE" || r=2
# still no match
test $r -eq 1 && continue
# 0 == match, >=2 == fail
res=$r
done done
exit $res exit $res

View File

@ -46,7 +46,7 @@ if test "${LESSMETACHARS+set}" != set; then
LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~' LESSMETACHARS="$space$tab$nl'"';*?"()<>[|&^`#\$%=~'
fi fi
if test "$(less -V | { read ver && echo ${ver#less }; })" -ge 429; then if test "$(less -V | { read less ver re && echo ${ver}; })" -ge 429; then
# less 429 or later: LESSOPEN pipe will be used on # less 429 or later: LESSOPEN pipe will be used on
# standard input if $LESSOPEN begins with |-. # standard input if $LESSOPEN begins with |-.
LESSOPEN="|-$xz -cdfq -- %s" LESSOPEN="|-$xz -cdfq -- %s"

View File

@ -4,15 +4,15 @@
.\" .\"
.\" License: GNU GPLv2+ .\" License: GNU GPLv2+
.\" .\"
.TH XZMORE 1 "2010-09-27" "Tukaani" "XZ Utils" .TH XZMORE 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME .SH NAME
xzmore, lzmore \- view xz or lzma compressed (text) files xzmore, lzmore \- view xz or lzma compressed (text) files
.SH SYNOPSIS .SH SYNOPSIS
.B xzmore .B xzmore
.RI [ "filename ..." ] .RI [ file... ]
.br .br
.B lzmore .B lzmore
.RI [ "filename ..." ] .RI [ file... ]
.SH DESCRIPTION .SH DESCRIPTION
.B xzmore .B xzmore
is a filter which allows examination of is a filter which allows examination of

View File

@ -438,7 +438,7 @@ parse_environment(args_info *args, char *argv0, const char *varname)
} else if (prev_was_space) { } else if (prev_was_space) {
prev_was_space = false; prev_was_space = false;
// Keep argc small enough to fit into a singed int // Keep argc small enough to fit into a signed int
// and to keep it usable for memory allocation. // and to keep it usable for memory allocation.
if (++argc == my_min( if (++argc == my_min(
INT_MAX, SIZE_MAX / sizeof(char *))) INT_MAX, SIZE_MAX / sizeof(char *)))

View File

@ -37,15 +37,10 @@ static io_buf in_buf;
static io_buf out_buf; static io_buf out_buf;
/// Number of filters. Zero indicates that we are using a preset. /// Number of filters. Zero indicates that we are using a preset.
static size_t filters_count = 0; static uint32_t filters_count = 0;
/// Number of the preset (0-9) /// Number of the preset (0-9)
static size_t preset_number = 6; static uint32_t preset_number = LZMA_PRESET_DEFAULT;
/// If a preset is used (no custom filter chain) and preset_extreme is true,
/// a significantly slower compression is used to achieve slightly better
/// compression ratio.
static bool preset_extreme = false;
/// Integrity check type /// Integrity check type
static lzma_check check; static lzma_check check;
@ -63,11 +58,9 @@ coder_set_check(lzma_check new_check)
} }
extern void static void
coder_set_preset(size_t new_preset) forget_filter_chain(void)
{ {
preset_number = new_preset;
// Setting a preset makes us forget a possibly defined custom // Setting a preset makes us forget a possibly defined custom
// filter chain. // filter chain.
while (filters_count > 0) { while (filters_count > 0) {
@ -80,10 +73,21 @@ coder_set_preset(size_t new_preset)
} }
extern void
coder_set_preset(uint32_t new_preset)
{
preset_number &= ~LZMA_PRESET_LEVEL_MASK;
preset_number |= new_preset;
forget_filter_chain();
return;
}
extern void extern void
coder_set_extreme(void) coder_set_extreme(void)
{ {
preset_extreme = true; preset_number |= LZMA_PRESET_EXTREME;
forget_filter_chain();
return; return;
} }
@ -98,11 +102,17 @@ coder_add_filter(lzma_vli id, void *options)
filters[filters_count].options = options; filters[filters_count].options = options;
++filters_count; ++filters_count;
// Setting a custom filter chain makes us forget the preset options.
// This makes a difference if one specifies e.g. "xz -9 --lzma2 -e"
// where the custom filter chain resets the preset level back to
// the default 6, making the example equivalent to "xz -6e".
preset_number = LZMA_PRESET_DEFAULT;
return; return;
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
memlimit_too_small(uint64_t memory_usage) memlimit_too_small(uint64_t memory_usage)
{ {
message(V_ERROR, _("Memory usage limit is too low for the given " message(V_ERROR, _("Memory usage limit is too low for the given "
@ -134,9 +144,6 @@ coder_set_compression_settings(void)
} }
// Get the preset for LZMA1 or LZMA2. // Get the preset for LZMA1 or LZMA2.
if (preset_extreme)
preset_number |= LZMA_PRESET_EXTREME;
if (lzma_lzma_preset(&opt_lzma, preset_number)) if (lzma_lzma_preset(&opt_lzma, preset_number))
message_bug(); message_bug();
@ -193,9 +200,9 @@ coder_set_compression_settings(void)
} }
if (memory_usage > memory_limit) { if (memory_usage > memory_limit) {
// If --no-auto-adjust was used or we didn't find LZMA1 or // If --no-adjust was used or we didn't find LZMA1 or
// LZMA2 as the last filter, give an error immediately. // LZMA2 as the last filter, give an error immediately.
// --format=raw implies --no-auto-adjust. // --format=raw implies --no-adjust.
if (!opt_auto_adjust || opt_format == FORMAT_RAW) if (!opt_auto_adjust || opt_format == FORMAT_RAW)
memlimit_too_small(memory_usage); memlimit_too_small(memory_usage);
@ -284,7 +291,10 @@ coder_set_compression_settings(void)
static bool static bool
is_format_xz(void) is_format_xz(void)
{ {
return strm.avail_in >= 6 && memcmp(in_buf.u8, "\3757zXZ", 6) == 0; // Specify the magic as hex to be compatible with EBCDIC systems.
static const uint8_t magic[6] = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 };
return strm.avail_in >= sizeof(magic)
&& memcmp(in_buf.u8, magic, sizeof(magic)) == 0;
} }

View File

@ -46,7 +46,7 @@ extern bool opt_auto_adjust;
extern void coder_set_check(lzma_check check); extern void coder_set_check(lzma_check check);
/// Set preset number /// Set preset number
extern void coder_set_preset(size_t new_preset); extern void coder_set_preset(uint32_t new_preset);
/// Enable extreme mode /// Enable extreme mode
extern void coder_set_extreme(void); extern void coder_set_extreme(void);

View File

@ -41,9 +41,10 @@ static bool warn_fchown;
static bool try_sparse = true; static bool try_sparse = true;
#ifndef TUKLIB_DOSLIKE #ifndef TUKLIB_DOSLIKE
/// File status flags of standard output. This is used by io_open_dest() /// Original file status flags of standard output. This is used by
/// and io_close_dest(). /// io_open_dest() and io_close_dest() to save and restore the flags.
static int stdout_flags = 0; static int stdout_flags;
static bool restore_stdout_flags = false;
#endif #endif
@ -53,7 +54,7 @@ static bool io_write_buf(file_pair *pair, const uint8_t *buf, size_t size);
extern void extern void
io_init(void) io_init(void)
{ {
// Make sure that stdin, stdout, and and stderr are connected to // Make sure that stdin, stdout, and stderr are connected to
// a valid file descriptor. Exit immediately with exit code ERROR // a valid file descriptor. Exit immediately with exit code ERROR
// if we cannot make the file descriptors valid. Maybe we should // if we cannot make the file descriptors valid. Maybe we should
// print an error message, but our stderr could be screwed anyway. // print an error message, but our stderr could be screwed anyway.
@ -397,10 +398,6 @@ io_open_src_real(file_pair *pair)
was_symlink = true; was_symlink = true;
# elif defined(__NetBSD__) # elif defined(__NetBSD__)
// As of 2010-09-05, NetBSD doesn't document what errno is
// used with O_NOFOLLOW. It is EFTYPE though, and I
// understood that is very unlikely to change even though
// it is undocumented.
if (errno == EFTYPE) if (errno == EFTYPE)
was_symlink = true; was_symlink = true;
@ -441,7 +438,7 @@ io_open_src_real(file_pair *pair)
flags &= ~O_NONBLOCK; flags &= ~O_NONBLOCK;
if (fcntl(pair->src_fd, F_SETFL, flags)) if (fcntl(pair->src_fd, F_SETFL, flags) == -1)
goto error_msg; goto error_msg;
} }
#endif #endif
@ -634,11 +631,11 @@ io_open_dest_real(file_pair *pair)
if (!S_ISREG(pair->dest_st.st_mode)) if (!S_ISREG(pair->dest_st.st_mode))
return false; return false;
const int flags = fcntl(STDOUT_FILENO, F_GETFL); stdout_flags = fcntl(STDOUT_FILENO, F_GETFL);
if (flags == -1) if (stdout_flags == -1)
return false; return false;
if (flags & O_APPEND) { if (stdout_flags & O_APPEND) {
// Creating a sparse file is not possible // Creating a sparse file is not possible
// when O_APPEND is active (it's used by // when O_APPEND is active (it's used by
// shell's >> redirection). As I understand // shell's >> redirection). As I understand
@ -657,12 +654,14 @@ io_open_dest_real(file_pair *pair)
return false; return false;
if (fcntl(STDOUT_FILENO, F_SETFL, if (fcntl(STDOUT_FILENO, F_SETFL,
stdout_flags & ~O_APPEND)) stdout_flags & ~O_APPEND)
== -1)
return false; return false;
// Remember the flags so that io_close_dest() // Disabling O_APPEND succeeded. Mark
// can restore them. // that the flags should be restored
stdout_flags = flags; // in io_close_dest().
restore_stdout_flags = true;
} else if (lseek(STDOUT_FILENO, 0, SEEK_CUR) } else if (lseek(STDOUT_FILENO, 0, SEEK_CUR)
!= pair->dest_st.st_size) { != pair->dest_st.st_size) {
@ -703,13 +702,12 @@ io_close_dest(file_pair *pair, bool success)
{ {
#ifndef TUKLIB_DOSLIKE #ifndef TUKLIB_DOSLIKE
// If io_open_dest() has disabled O_APPEND, restore it here. // If io_open_dest() has disabled O_APPEND, restore it here.
if (stdout_flags != 0) { if (restore_stdout_flags) {
assert(pair->dest_fd == STDOUT_FILENO); assert(pair->dest_fd == STDOUT_FILENO);
const int fail = fcntl(STDOUT_FILENO, F_SETFL, stdout_flags); restore_stdout_flags = false;
stdout_flags = 0;
if (fail) { if (fcntl(STDOUT_FILENO, F_SETFL, stdout_flags) == -1) {
message_error(_("Error restoring the O_APPEND flag " message_error(_("Error restoring the O_APPEND flag "
"to standard output: %s"), "to standard output: %s"),
strerror(errno)); strerror(errno));
@ -882,7 +880,7 @@ io_write_buf(file_pair *pair, const uint8_t *buf, size_t size)
if (amount == -1) { if (amount == -1) {
if (errno == EINTR) { if (errno == EINTR) {
if (user_abort) if (user_abort)
return -1; return true;
continue; continue;
} }

View File

@ -35,4 +35,4 @@ extern void hardware_memlimit_set(uint64_t new_memlimit,
extern uint64_t hardware_memlimit_get(enum operation_mode mode); extern uint64_t hardware_memlimit_get(enum operation_mode mode);
/// Display the amount of RAM and memory usage limits and exit. /// Display the amount of RAM and memory usage limits and exit.
extern void hardware_memlimit_show(void) lzma_attribute((noreturn)); extern void hardware_memlimit_show(void) lzma_attribute((__noreturn__));

View File

@ -203,6 +203,20 @@ parse_indexes(xz_file_info *xfi, file_pair *pair)
goto error; goto error;
} }
// Check that the Stream Footer doesn't specify something
// that we don't support. This can only happen if the xz
// version is older than liblzma and liblzma supports
// something new.
//
// It is enough to check Stream Footer. Stream Header must
// match when it is compared against Stream Footer with
// lzma_stream_flags_compare().
if (footer_flags.version != 0) {
message_error("%s: %s", pair->src_name,
message_strm(LZMA_OPTIONS_ERROR));
goto error;
}
// Check that the size of the Index field looks sane. // Check that the size of the Index field looks sane.
lzma_vli index_size = footer_flags.backward_size; lzma_vli index_size = footer_flags.backward_size;
if ((lzma_vli)(pos) < index_size + LZMA_STREAM_HEADER_SIZE) { if ((lzma_vli)(pos) < index_size + LZMA_STREAM_HEADER_SIZE) {
@ -382,14 +396,9 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
if (buf.u8[0] == 0) if (buf.u8[0] == 0)
goto data_error; goto data_error;
lzma_block block;
lzma_filter filters[LZMA_FILTERS_MAX + 1];
// Initialize the pointers so that they can be passed to free().
for (size_t i = 0; i < ARRAY_SIZE(filters); ++i)
filters[i].options = NULL;
// Initialize the block structure and decode Block Header Size. // Initialize the block structure and decode Block Header Size.
lzma_filter filters[LZMA_FILTERS_MAX + 1];
lzma_block block;
block.version = 0; block.version = 0;
block.check = iter->stream.flags->check; block.check = iter->stream.flags->check;
block.filters = filters; block.filters = filters;
@ -434,9 +443,25 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
switch (lzma_block_compressed_size(&block, switch (lzma_block_compressed_size(&block,
iter->block.unpadded_size)) { iter->block.unpadded_size)) {
case LZMA_OK: case LZMA_OK:
// Validate also block.uncompressed_size if it is present.
// If it isn't present, there's no need to set it since
// we aren't going to actually decompress the Block; if
// we were decompressing, then we should set it so that
// the Block decoder could validate the Uncompressed Size
// that was stored in the Index.
if (block.uncompressed_size == LZMA_VLI_UNKNOWN
|| block.uncompressed_size
== iter->block.uncompressed_size)
break; break;
// If the above fails, the file is corrupt so
// LZMA_DATA_ERROR is a good error code.
case LZMA_DATA_ERROR: case LZMA_DATA_ERROR:
// Free the memory allocated by lzma_block_header_decode().
for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
free(filters[i].options);
goto data_error; goto data_error;
default: default:
@ -466,14 +491,6 @@ data_error:
// Show the error message. // Show the error message.
message_error("%s: %s", pair->src_name, message_error("%s: %s", pair->src_name,
message_strm(LZMA_DATA_ERROR)); message_strm(LZMA_DATA_ERROR));
// Free the memory allocated by lzma_block_header_decode().
// This is truly needed only if we get here after a succcessful
// call to lzma_block_header_decode() but it doesn't hurt to
// always do it.
for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
free(filters[i].options);
return true; return true;
} }

View File

@ -94,7 +94,7 @@ static volatile sig_atomic_t progress_needs_updating = false;
/// Signal handler for SIGALRM /// Signal handler for SIGALRM
static void static void
progress_signal_handler(int sig lzma_attribute((unused))) progress_signal_handler(int sig lzma_attribute((__unused__)))
{ {
progress_needs_updating = true; progress_needs_updating = true;
return; return;
@ -211,7 +211,7 @@ message_set_files(unsigned int files)
static void static void
print_filename(void) print_filename(void)
{ {
if (files_total != 1 || filename != stdin_filename) { if (!opt_robot && (files_total != 1 || filename != stdin_filename)) {
signals_block(); signals_block();
FILE *file = opt_mode == MODE_LIST ? stdout : stderr; FILE *file = opt_mode == MODE_LIST ? stdout : stderr;
@ -726,7 +726,11 @@ vmessage(enum message_verbosity v, const char *fmt, va_list ap)
progress_flush(false); progress_flush(false);
fprintf(stderr, "%s: ", progname); // TRANSLATORS: This is the program name in the beginning
// of the line in messages. Usually it becomes "xz: ".
// This is a translatable string because French needs
// a space before a colon.
fprintf(stderr, _("%s: "), progname);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
fputc('\n', stderr); fputc('\n', stderr);
@ -855,6 +859,17 @@ message_mem_needed(enum message_verbosity v, uint64_t memusage)
// the user might need to +1 MiB to get high enough limit.) // the user might need to +1 MiB to get high enough limit.)
memusage = round_up_to_mib(memusage); memusage = round_up_to_mib(memusage);
uint64_t memlimit = hardware_memlimit_get(opt_mode);
// Handle the case when there is no memory usage limit.
// This way we don't print a weird message with a huge number.
if (memlimit == UINT64_MAX) {
message(v, _("%s MiB of memory is required. "
"The limiter is disabled."),
uint64_to_str(memusage, 0));
return;
}
// With US-ASCII: // With US-ASCII:
// 2^64 with thousand separators + " MiB" suffix + '\0' = 26 + 4 + 1 // 2^64 with thousand separators + " MiB" suffix + '\0' = 26 + 4 + 1
// But there may be multibyte chars so reserve enough space. // But there may be multibyte chars so reserve enough space.
@ -863,7 +878,6 @@ message_mem_needed(enum message_verbosity v, uint64_t memusage)
// Show the memory usage limit as MiB unless it is less than 1 MiB. // Show the memory usage limit as MiB unless it is less than 1 MiB.
// This way it's easy to notice errors where one has typed // This way it's easy to notice errors where one has typed
// --memory=123 instead of --memory=123MiB. // --memory=123 instead of --memory=123MiB.
uint64_t memlimit = hardware_memlimit_get(opt_mode);
if (memlimit < (UINT32_C(1) << 20)) { if (memlimit < (UINT32_C(1) << 20)) {
snprintf(memlimitstr, sizeof(memlimitstr), "%s B", snprintf(memlimitstr, sizeof(memlimitstr), "%s B",
uint64_to_str(memlimit, 1)); uint64_to_str(memlimit, 1));

View File

@ -45,7 +45,7 @@ extern enum message_verbosity message_verbosity_get(void);
/// ///
/// This doesn't touch the exit status. /// This doesn't touch the exit status.
extern void message(enum message_verbosity verbosity, const char *fmt, ...) extern void message(enum message_verbosity verbosity, const char *fmt, ...)
lzma_attribute((format(printf, 2, 3))); lzma_attribute((__format__(__printf__, 2, 3)));
/// \brief Prints a warning and possibly sets exit status /// \brief Prints a warning and possibly sets exit status
@ -53,7 +53,7 @@ extern void message(enum message_verbosity verbosity, const char *fmt, ...)
/// The message is printed only if verbosity level is at least V_WARNING. /// The message is printed only if verbosity level is at least V_WARNING.
/// The exit status is set to WARNING unless it was already at ERROR. /// The exit status is set to WARNING unless it was already at ERROR.
extern void message_warning(const char *fmt, ...) extern void message_warning(const char *fmt, ...)
lzma_attribute((format(printf, 1, 2))); lzma_attribute((__format__(__printf__, 1, 2)));
/// \brief Prints an error message and sets exit status /// \brief Prints an error message and sets exit status
@ -61,25 +61,25 @@ extern void message_warning(const char *fmt, ...)
/// The message is printed only if verbosity level is at least V_ERROR. /// The message is printed only if verbosity level is at least V_ERROR.
/// The exit status is set to ERROR. /// The exit status is set to ERROR.
extern void message_error(const char *fmt, ...) extern void message_error(const char *fmt, ...)
lzma_attribute((format(printf, 1, 2))); lzma_attribute((__format__(__printf__, 1, 2)));
/// \brief Prints an error message and exits with EXIT_ERROR /// \brief Prints an error message and exits with EXIT_ERROR
/// ///
/// The message is printed only if verbosity level is at least V_ERROR. /// The message is printed only if verbosity level is at least V_ERROR.
extern void message_fatal(const char *fmt, ...) extern void message_fatal(const char *fmt, ...)
lzma_attribute((format(printf, 1, 2))) lzma_attribute((__format__(__printf__, 1, 2)))
lzma_attribute((noreturn)); lzma_attribute((__noreturn__));
/// Print an error message that an internal error occurred and exit with /// Print an error message that an internal error occurred and exit with
/// EXIT_ERROR. /// EXIT_ERROR.
extern void message_bug(void) lzma_attribute((noreturn)); extern void message_bug(void) lzma_attribute((__noreturn__));
/// Print a message that establishing signal handlers failed, and exit with /// Print a message that establishing signal handlers failed, and exit with
/// exit status ERROR. /// exit status ERROR.
extern void message_signal_handler(void) lzma_attribute((noreturn)); extern void message_signal_handler(void) lzma_attribute((__noreturn__));
/// Convert lzma_ret to a string. /// Convert lzma_ret to a string.
@ -116,11 +116,11 @@ extern void message_try_help(void);
/// Prints the version number to stdout and exits with exit status SUCCESS. /// Prints the version number to stdout and exits with exit status SUCCESS.
extern void message_version(void) lzma_attribute((noreturn)); extern void message_version(void) lzma_attribute((__noreturn__));
/// Print the help message. /// Print the help message.
extern void message_help(bool long_help) lzma_attribute((noreturn)); extern void message_help(bool long_help) lzma_attribute((__noreturn__));
/// \brief Set the total number of files to be processed /// \brief Set the total number of files to be processed

View File

@ -31,8 +31,8 @@ typedef struct {
} option_map; } option_map;
/// Parses option=value pairs that are separated with colons, semicolons, /// Parses option=value pairs that are separated with commas:
/// or commas: opt=val:opt=val;opt=val,opt=val /// opt=val,opt=val,opt=val
/// ///
/// Each option is a string, that is converted to an integer using the /// Each option is a string, that is converted to an integer using the
/// index where the option string is in the array. /// index where the option string is in the array.
@ -150,7 +150,7 @@ enum {
static void static void
set_delta(void *options, uint32_t key, uint64_t value, set_delta(void *options, uint32_t key, uint64_t value,
const char *valuestr lzma_attribute((unused))) const char *valuestr lzma_attribute((__unused__)))
{ {
lzma_options_delta *opt = options; lzma_options_delta *opt = options;
switch (key) { switch (key) {
@ -194,7 +194,7 @@ enum {
static void static void
set_bcj(void *options, uint32_t key, uint64_t value, set_bcj(void *options, uint32_t key, uint64_t value,
const char *valuestr lzma_attribute((unused))) const char *valuestr lzma_attribute((__unused__)))
{ {
lzma_options_bcj *opt = options; lzma_options_bcj *opt = options;
switch (key) { switch (key) {
@ -241,7 +241,7 @@ enum {
}; };
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
error_lzma_preset(const char *valuestr) error_lzma_preset(const char *valuestr)
{ {
message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr); message_fatal(_("Unsupported LZMA1/LZMA2 preset: %s"), valuestr);

View File

@ -77,17 +77,19 @@ signals_init(void)
sigaddset(&hooked_signals, message_progress_sigs[i]); sigaddset(&hooked_signals, message_progress_sigs[i]);
#endif #endif
struct sigaction sa; // Using "my_sa" because "sa" may conflict with a sockaddr variable
// from system headers on Solaris.
struct sigaction my_sa;
// All the signals that we handle we also blocked while the signal // All the signals that we handle we also blocked while the signal
// handler runs. // handler runs.
sa.sa_mask = hooked_signals; my_sa.sa_mask = hooked_signals;
// Don't set SA_RESTART, because we want EINTR so that we can check // Don't set SA_RESTART, because we want EINTR so that we can check
// for user_abort and cleanup before exiting. We block the signals // for user_abort and cleanup before exiting. We block the signals
// for which we have established a handler when we don't want EINTR. // for which we have established a handler when we don't want EINTR.
sa.sa_flags = 0; my_sa.sa_flags = 0;
sa.sa_handler = &signal_handler; my_sa.sa_handler = &signal_handler;
for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) { for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) {
// If the parent process has left some signals ignored, // If the parent process has left some signals ignored,
@ -98,7 +100,7 @@ signals_init(void)
continue; continue;
// Establish the signal handler. // Establish the signal handler.
if (sigaction(sigs[i], &sa, NULL)) if (sigaction(sigs[i], &my_sa, NULL))
message_signal_handler(); message_signal_handler();
} }
@ -179,7 +181,7 @@ signals_exit(void)
// console window. // console window.
static BOOL WINAPI static BOOL WINAPI
signal_handler(DWORD type lzma_attribute((unused))) signal_handler(DWORD type lzma_attribute((__unused__)))
{ {
// Since we don't get a signal number which we could raise() at // Since we don't get a signal number which we could raise() at
// signals_exit() like on POSIX, just set the exit status to // signals_exit() like on POSIX, just set the exit status to

View File

@ -21,12 +21,6 @@
static char *custom_suffix = NULL; static char *custom_suffix = NULL;
struct suffix_pair {
const char *compressed;
const char *uncompressed;
};
/// \brief Test if the char is a directory separator /// \brief Test if the char is a directory separator
static bool static bool
is_dir_sep(char c) is_dir_sep(char c)
@ -86,7 +80,10 @@ test_suffix(const char *suffix, const char *src_name, size_t src_len)
static char * static char *
uncompressed_name(const char *src_name, const size_t src_len) uncompressed_name(const char *src_name, const size_t src_len)
{ {
static const struct suffix_pair suffixes[] = { static const struct {
const char *compressed;
const char *uncompressed;
} suffixes[] = {
{ ".xz", "" }, { ".xz", "" },
{ ".txz", ".tar" }, // .txz abbreviation for .txt.gz is rare. { ".txz", ".tar" }, // .txz abbreviation for .txt.gz is rare.
{ ".lzma", "" }, { ".lzma", "" },
@ -145,25 +142,25 @@ static char *
compressed_name(const char *src_name, const size_t src_len) compressed_name(const char *src_name, const size_t src_len)
{ {
// The order of these must match the order in args.h. // The order of these must match the order in args.h.
static const struct suffix_pair all_suffixes[][3] = { static const char *const all_suffixes[][3] = {
{ {
{ ".xz", "" }, ".xz",
{ ".txz", ".tar" }, ".txz",
{ NULL, NULL } NULL
}, { }, {
{ ".lzma", "" }, ".lzma",
{ ".tlz", ".tar" }, ".tlz",
{ NULL, NULL } NULL
/* /*
}, { }, {
{ ".gz", "" }, ".gz",
{ ".tgz", ".tar" }, ".tgz",
{ NULL, NULL } NULL
*/ */
}, { }, {
// --format=raw requires specifying the suffix // --format=raw requires specifying the suffix
// manually or using stdout. // manually or using stdout.
{ NULL, NULL } NULL
} }
}; };
@ -171,14 +168,22 @@ compressed_name(const char *src_name, const size_t src_len)
assert(opt_format != FORMAT_AUTO); assert(opt_format != FORMAT_AUTO);
const size_t format = opt_format - 1; const size_t format = opt_format - 1;
const struct suffix_pair *const suffixes = all_suffixes[format]; const char *const *suffixes = all_suffixes[format];
for (size_t i = 0; suffixes[i].compressed != NULL; ++i) { for (size_t i = 0; suffixes[i] != NULL; ++i) {
if (test_suffix(suffixes[i].compressed, src_name, src_len) if (test_suffix(suffixes[i], src_name, src_len) != 0) {
!= 0) {
message_warning(_("%s: File already has `%s' " message_warning(_("%s: File already has `%s' "
"suffix, skipping"), src_name, "suffix, skipping"), src_name,
suffixes[i].compressed); suffixes[i]);
return NULL;
}
}
if (custom_suffix != NULL) {
if (test_suffix(custom_suffix, src_name, src_len) != 0) {
message_warning(_("%s: File already has `%s' "
"suffix, skipping"), src_name,
custom_suffix);
return NULL; return NULL;
} }
} }
@ -193,7 +198,7 @@ compressed_name(const char *src_name, const size_t src_len)
} }
const char *suffix = custom_suffix != NULL const char *suffix = custom_suffix != NULL
? custom_suffix : suffixes[0].compressed; ? custom_suffix : suffixes[0];
const size_t suffix_len = strlen(suffix); const size_t suffix_len = strlen(suffix);
char *dest_name = xmalloc(src_len + suffix_len + 1); char *dest_name = xmalloc(src_len + suffix_len + 1);
@ -227,7 +232,7 @@ suffix_set(const char *suffix)
// Empty suffix and suffixes having a directory separator are // Empty suffix and suffixes having a directory separator are
// rejected. Such suffixes would break things later. // rejected. Such suffixes would break things later.
if (suffix[0] == '\0' || has_dir_sep(suffix)) if (suffix[0] == '\0' || has_dir_sep(suffix))
message_fatal(_("%s: Invalid filename suffix"), optarg); message_fatal(_("%s: Invalid filename suffix"), suffix);
// Replace the old custom_suffix (if any) with the new suffix. // Replace the old custom_suffix (if any) with the new suffix.
free(custom_suffix); free(custom_suffix);

View File

@ -26,9 +26,19 @@ xrealloc(void *ptr, size_t size)
{ {
assert(size > 0); assert(size > 0);
// Save ptr so that we can free it if realloc fails.
// The point is that message_fatal ends up calling stdio functions
// which in some libc implementations might allocate memory from
// the heap. Freeing ptr improves the chances that there's free
// memory for stdio functions if they need it.
void *p = ptr;
ptr = realloc(ptr, size); ptr = realloc(ptr, size);
if (ptr == NULL)
message_fatal("%s", strerror(errno)); if (ptr == NULL) {
const int saved_errno = errno;
free(p);
message_fatal("%s", strerror(saved_errno));
}
return ptr; return ptr;
} }

View File

@ -20,11 +20,11 @@
/// \brief Safe realloc() that never returns NULL /// \brief Safe realloc() that never returns NULL
extern void *xrealloc(void *ptr, size_t size) extern void *xrealloc(void *ptr, size_t size)
lzma_attribute((malloc)) lzma_attr_alloc_size(2); lzma_attribute((__malloc__)) lzma_attr_alloc_size(2);
/// \brief Safe strdup() that never returns NULL /// \brief Safe strdup() that never returns NULL
extern char *xstrdup(const char *src) lzma_attribute((malloc)); extern char *xstrdup(const char *src) lzma_attribute((__malloc__));
/// \brief Fancy version of strtoull() /// \brief Fancy version of strtoull()
@ -102,7 +102,7 @@ extern const char *uint64_to_nicestr(uint64_t value,
/// A maximum of *left bytes is written starting from *pos. *pos and *left /// A maximum of *left bytes is written starting from *pos. *pos and *left
/// are updated accordingly. /// are updated accordingly.
extern void my_snprintf(char **pos, size_t *left, const char *fmt, ...) extern void my_snprintf(char **pos, size_t *left, const char *fmt, ...)
lzma_attribute((format(printf, 3, 4))); lzma_attribute((__format__(__printf__, 3, 4)));
/// \brief Check if filename is empty and print an error message /// \brief Check if filename is empty and print an error message

View File

@ -5,16 +5,17 @@
.\" This file has been put into the public domain. .\" This file has been put into the public domain.
.\" You can do whatever you want with this file. .\" You can do whatever you want with this file.
.\" .\"
.TH XZ 1 "2010-10-04" "Tukaani" "XZ Utils" .TH XZ 1 "2013-06-21" "Tukaani" "XZ Utils"
. .
.SH NAME .SH NAME
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
. .
.SH SYNOPSIS .SH SYNOPSIS
.B xz .B xz
.RI [ option ]... .RI [ option... ]
.RI [ file ]... .RI [ file... ]
.PP .
.SH COMMAND ALIASES
.B unxz .B unxz
is equivalent to is equivalent to
.BR "xz \-\-decompress" . .BR "xz \-\-decompress" .
@ -708,7 +709,7 @@ be dramatically higher than that of the single-threaded mode.
DecMem contains the decompressor memory requirements. DecMem contains the decompressor memory requirements.
That is, the compression settings determine That is, the compression settings determine
the memory requirements of the decompressor. the memory requirements of the decompressor.
The exact decompressor memory usage is slighly more than The exact decompressor memory usage is slightly more than
the LZMA2 dictionary size, but the values in the table the LZMA2 dictionary size, but the values in the table
have been rounded up to the next full MiB. have been rounded up to the next full MiB.
.RE .RE
@ -866,7 +867,7 @@ This is equivalent to specifying \fB\-\-memlimit\-compress=\fIlimit
\fB\-\-memlimit\-decompress=\fIlimit\fR. \fB\-\-memlimit\-decompress=\fIlimit\fR.
.TP .TP
.B \-\-no\-adjust .B \-\-no\-adjust
Display an error and exit if the compression settings exceed the Display an error and exit if the compression settings exceed
the memory usage limit. the memory usage limit.
The default is to adjust the settings downwards so The default is to adjust the settings downwards so
that the memory usage limit is not exceeded. that the memory usage limit is not exceeded.
@ -897,11 +898,14 @@ if threading will be enabled by default.
.SS "Custom compressor filter chains" .SS "Custom compressor filter chains"
A custom filter chain allows specifying A custom filter chain allows specifying
the compression settings in detail instead of relying on the compression settings in detail instead of relying on
the settings associated to the preset levels. the settings associated to the presets.
When a custom filter chain is specified, When a custom filter chain is specified,
the compression preset level options preset options (\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR)
(\fB\-0\fR ... \fB\-9\fR and \fB\-\-extreme\fR) are earlier on the command line are forgotten.
silently ignored. If a preset option is specified
after one or more custom filter chain options,
the new preset takes effect and
the custom filter chain options specified earlier are forgotten.
.PP .PP
A filter chain is comparable to piping on the command line. A filter chain is comparable to piping on the command line.
When compressing, the uncompressed input goes to the first filter, When compressing, the uncompressed input goes to the first filter,
@ -934,6 +938,15 @@ Extra commas in
are ignored. are ignored.
Every option has a default value, so you need to Every option has a default value, so you need to
specify only those you want to change. specify only those you want to change.
.PP
To see the whole filter chain and
.IR options ,
use
.B "xz \-vv"
(that is, use
.B \-\-verbose
twice).
This works also for viewing the filter chain options used by presets.
.TP .TP
\fB\-\-lzma1\fR[\fB=\fIoptions\fR] \fB\-\-lzma1\fR[\fB=\fIoptions\fR]
.PD 0 .PD 0
@ -976,13 +989,12 @@ The only supported modifier is currently
.BR e , .BR e ,
which matches which matches
.BR \-\-extreme . .BR \-\-extreme .
The default If no
.I preset .B preset
is is specified, the default values of LZMA1 or LZMA2
.BR 6 ,
from which the default values for the rest of the LZMA1 or LZMA2
.I options .I options
are taken. are taken from the preset
.BR 6 .
.TP .TP
.BI dict= size .BI dict= size
Dictionary (history buffer) Dictionary (history buffer)
@ -1578,7 +1590,7 @@ is supported only together with
.BR \-\-info\-memory , .BR \-\-info\-memory ,
and and
.BR \-\-list . .BR \-\-list .
It will be supported for normal compression and It will be supported for compression and
decompression in the future. decompression in the future.
. .
.SS Version .SS Version
@ -1836,6 +1848,25 @@ headers.
.PD .PD
.PP .PP
The columns of the The columns of the
.B summary
lines:
.PD 0
.RS
.IP 2. 4
Amount of memory (in bytes) required to decompress
this file with this
.B xz
version
.IP 3. 4
.B yes
or
.B no
indicating if all block headers have both compressed size and
uncompressed size stored in them
.RE
.PD
.PP
The columns of the
.B totals .B totals
line: line:
.PD 0 .PD 0
@ -2160,14 +2191,15 @@ The output can vary even between different
builds of the same XZ Utils version, builds of the same XZ Utils version,
if different build options are used. if different build options are used.
.PP .PP
The above means that implementing The above means that once
.B \-\-rsyncable .B \-\-rsyncable
to create rsyncable has been implemented,
.B .xz the resulting files won't necessarily be rsyncable
files is not going to happen without unless both old and new files have been compressed
freezing a part of the encoder with the same xz version.
implementation, which can then be used with This problem can be fixed if a part of the encoder
.BR \-\-rsyncable . implementation is frozen to keep rsyncable output
stable across xz versions.
. .
.SS "Embedded .xz decompressors" .SS "Embedded .xz decompressors"
Embedded Embedded

View File

@ -59,7 +59,14 @@ endif
if COND_LZMADEC if COND_LZMADEC
bin_PROGRAMS += lzmadec bin_PROGRAMS += lzmadec
# FIXME: If xzdec is disabled, this will create a dangling symlink. # Create the symlink lzmadec.1->xzdec.1 only if xzdec.1 was installed.
# This is better than creating a dangling symlink, especially
# because creating the link may fail due to the directory being missing.
#
# FIXME: The correct solution would be to install xzdec.1 as lzmadec.1
# but I don't know what is the sane way to do it and since this is a bit
# unusual situation anyway, it's not that important.
if COND_XZDEC
install-data-hook: install-data-hook:
cd $(DESTDIR)$(mandir)/man1 && \ cd $(DESTDIR)$(mandir)/man1 && \
target=`echo xzdec | sed '$(transform)'` && \ target=`echo xzdec | sed '$(transform)'` && \
@ -72,3 +79,4 @@ uninstall-hook:
link=`echo lzmadec | sed '$(transform)'` && \ link=`echo lzmadec | sed '$(transform)'` && \
rm -f $$link.1 rm -f $$link.1
endif endif
endif

View File

@ -4,17 +4,17 @@
.\" This file has been put into the public domain. .\" This file has been put into the public domain.
.\" You can do whatever you want with this file. .\" You can do whatever you want with this file.
.\" .\"
.TH XZDEC 1 "2010-09-27" "Tukaani" "XZ Utils" .TH XZDEC 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME .SH NAME
xzdec, lzmadec \- Small .xz and .lzma decompressors xzdec, lzmadec \- Small .xz and .lzma decompressors
.SH SYNOPSIS .SH SYNOPSIS
.B xzdec .B xzdec
.RI [ option ]... .RI [ option... ]
.RI [ file ]... .RI [ file... ]
.br .br
.B lzmadec .B lzmadec
.RI [ option ]... .RI [ option... ]
.RI [ file ]... .RI [ file... ]
.SH DESCRIPTION .SH DESCRIPTION
.B xzdec .B xzdec
is a liblzma-based decompression-only tool for is a liblzma-based decompression-only tool for

View File

@ -40,7 +40,7 @@
static unsigned int display_errors = 2; static unsigned int display_errors = 2;
static void lzma_attribute((format(printf, 1, 2))) static void lzma_attribute((__format__(__printf__, 1, 2)))
my_errorf(const char *fmt, ...) my_errorf(const char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -57,18 +57,18 @@ my_errorf(const char *fmt, ...)
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
help(void) help(void)
{ {
printf( printf(
"Usage: %s [OPTION]... [FILE]...\n" "Usage: %s [OPTION]... [FILE]...\n"
"Uncompress files in the ." TOOL_FORMAT " format to the standard output.\n" "Decompress files in the ." TOOL_FORMAT " format to standard output.\n"
"\n" "\n"
" -c, --stdout (ignored)\n" " -d, --decompress (ignored, only decompression is supported)\n"
" -d, --decompress (ignored)\n" " -k, --keep (ignored, files are never deleted)\n"
" -k, --keep (ignored)\n" " -c, --stdout (ignored, output is always written to standard output)\n"
" -q, --quiet specify *twice* to suppress errors\n" " -q, --quiet specify *twice* to suppress errors\n"
" -Q, --no-warn (ignored)\n" " -Q, --no-warn (ignored, the exit status 2 is never used)\n"
" -h, --help display this help and exit\n" " -h, --help display this help and exit\n"
" -V, --version display the version number and exit\n" " -V, --version display the version number and exit\n"
"\n" "\n"
@ -81,7 +81,7 @@ PACKAGE_NAME " home page: <" PACKAGE_URL ">\n", progname);
} }
static void lzma_attribute((noreturn)) static void lzma_attribute((__noreturn__))
version(void) version(void)
{ {
printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n" printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n"

View File

@ -10,9 +10,11 @@ EXTRA_DIST = \
tests.h \ tests.h \
test_files.sh \ test_files.sh \
test_compress.sh \ test_compress.sh \
test_scripts.sh \
bcj_test.c \ bcj_test.c \
compress_prepared_bcj_sparc \ compress_prepared_bcj_sparc \
compress_prepared_bcj_x86 compress_prepared_bcj_x86 \
xzgrep_expected_output
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-I$(top_srcdir)/src/common \ -I$(top_srcdir)/src/common \
@ -33,7 +35,8 @@ check_PROGRAMS = \
test_stream_flags \ test_stream_flags \
test_filter_flags \ test_filter_flags \
test_block_header \ test_block_header \
test_index test_index \
test_bcj_exact_size
TESTS = \ TESTS = \
test_check \ test_check \
@ -41,8 +44,14 @@ TESTS = \
test_filter_flags \ test_filter_flags \
test_block_header \ test_block_header \
test_index \ test_index \
test_bcj_exact_size \
test_files.sh \ test_files.sh \
test_compress.sh test_compress.sh
if COND_SCRIPTS
TESTS += test_scripts.sh
endif
clean-local: clean-local:
-rm -f compress_generated_* -rm -f compress_generated_* \
xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz

View File

@ -79,7 +79,8 @@ static void
write_abc(FILE *file) write_abc(FILE *file)
{ {
for (size_t i = 0; i < 12345; ++i) for (size_t i = 0; i < 12345; ++i)
fwrite("abc\n", 4, 1, file); if (fwrite("abc\n", 4, 1, file) != 1)
exit(1);
} }

View File

@ -87,6 +87,10 @@
uncompressed with dictionary reset, and third is LZMA with new uncompressed with dictionary reset, and third is LZMA with new
properties but without dictionary reset. properties but without dictionary reset.
good-1-lzma2-5.xz has an empty LZMA2 stream with only the end of
payload marker. XZ Utils 5.0.1 and older incorrectly see this file
as corrupt.
good-1-3delta-lzma2.xz has three Delta filters and LZMA2. good-1-3delta-lzma2.xz has three Delta filters and LZMA2.
@ -184,6 +188,10 @@
bad-1-block_header-5.xz has zero as Compressed Size in Block Header. bad-1-block_header-5.xz has zero as Compressed Size in Block Header.
bad-1-block_header-6.xz has corrupt Block Header which may crash
xz -lvv in XZ Utils 5.0.3 and earlier. It was fixed in the commit
c0297445064951807803457dca1611b3c47e7f0f.
bad-2-index-1.xz has wrong Unpadded Sizes in Index. bad-2-index-1.xz has wrong Unpadded Sizes in Index.
bad-2-index-2.xz has wrong Uncompressed Sizes in Index. bad-2-index-2.xz has wrong Uncompressed Sizes in Index.

Binary file not shown.

Binary file not shown.

112
tests/test_bcj_exact_size.c Normal file
View File

@ -0,0 +1,112 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file test_bcj_exact_size.c
/// \brief Tests BCJ decoding when the output size is known
///
/// These tests fail with XZ Utils 5.0.3 and earlier.
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tests.h"
/// Something to be compressed
static const uint8_t in[16] = "0123456789ABCDEF";
/// in[] after compression
static uint8_t compressed[1024];
static size_t compressed_size = 0;
/// Output buffer for decompressing compressed[]
static uint8_t out[sizeof(in)];
static void
compress(void)
{
// Compress with PowerPC BCJ and LZMA2. PowerPC BCJ is used because
// it has fixed 4-byte alignment which makes triggering the potential
// bug easy.
lzma_options_lzma opt_lzma2;
succeed(lzma_lzma_preset(&opt_lzma2, 0));
lzma_filter filters[3] = {
{ .id = LZMA_FILTER_POWERPC, .options = NULL },
{ .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 },
{ .id = LZMA_VLI_UNKNOWN, .options = NULL },
};
expect(lzma_stream_buffer_encode(filters, LZMA_CHECK_CRC32, NULL,
in, sizeof(in),
compressed, &compressed_size, sizeof(compressed))
== LZMA_OK);
}
static void
decompress(void)
{
lzma_stream strm = LZMA_STREAM_INIT;
expect(lzma_stream_decoder(&strm, 10 << 20, 0) == LZMA_OK);
strm.next_in = compressed;
strm.next_out = out;
while (true) {
if (strm.total_in < compressed_size)
strm.avail_in = 1;
const lzma_ret ret = lzma_code(&strm, LZMA_RUN);
if (ret == LZMA_STREAM_END) {
expect(strm.total_in == compressed_size);
expect(strm.total_out == sizeof(in));
return;
}
expect(ret == LZMA_OK);
if (strm.total_out < sizeof(in))
strm.avail_out = 1;
}
}
static void
decompress_empty(void)
{
// An empty file with one Block using PowerPC BCJ and LZMA2.
static const uint8_t empty_bcj_lzma2[] = {
0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00, 0x00, 0x01,
0x69, 0x22, 0xDE, 0x36, 0x02, 0x01, 0x05, 0x00,
0x21, 0x01, 0x00, 0x00, 0x7F, 0xE0, 0xF1, 0xC8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x11, 0x00, 0x3B, 0x96, 0x5F, 0x73,
0x90, 0x42, 0x99, 0x0D, 0x01, 0x00, 0x00, 0x00,
0x00, 0x01, 0x59, 0x5A
};
// Decompress without giving any output space.
uint64_t memlimit = 1 << 20;
size_t in_pos = 0;
size_t out_pos = 0;
expect(lzma_stream_buffer_decode(&memlimit, 0, NULL,
empty_bcj_lzma2, &in_pos, sizeof(empty_bcj_lzma2),
out, &out_pos, 0) == LZMA_OK);
expect(in_pos == sizeof(empty_bcj_lzma2));
expect(out_pos == 0);
}
extern int
main(void)
{
compress();
decompress();
decompress_empty();
return 0;
}

View File

@ -1,52 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file test_block.c
/// \brief Tests Block coders
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "tests.h"
static uint8_t text[] = "Hello world!";
static uint8_t buffer[4096];
static lzma_options_block block_options;
static lzma_stream strm = LZMA_STREAM_INIT;
static void
test1(void)
{
}
int
main()
{
lzma_init();
block_options = (lzma_options_block){
.check_type = LZMA_CHECK_NONE,
.has_eopm = true,
.has_uncompressed_size_in_footer = false,
.has_backward_size = false,
.handle_padding = false,
.total_size = LZMA_VLI_UNKNOWN,
.compressed_size = LZMA_VLI_UNKNOWN,
.uncompressed_size = LZMA_VLI_UNKNOWN,
.header_size = 5,
};
block_options.filters[0].id = LZMA_VLI_UNKNOWN;
block_options.filters[0].options = NULL;
lzma_end(&strm);
return 0;
}

76
tests/test_scripts.sh Executable file
View File

@ -0,0 +1,76 @@
#!/bin/sh
###############################################################################
#
# Author: Jonathan Nieder
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# If scripts weren't built, this test is skipped.
XZ=../src/xz/xz
XZDIFF=../src/scripts/xzdiff
XZGREP=../src/scripts/xzgrep
for i in XZ XZDIFF XZGREP; do
eval test -x "\$$i" && continue
(exit 77)
exit 77
done
PATH=`pwd`/../src/xz:$PATH
export PATH
test -z "$srcdir" && srcdir=.
preimage=$srcdir/files/good-1-check-crc32.xz
samepostimage=$srcdir/files/good-1-check-crc64.xz
otherpostimage=$srcdir/files/good-1-lzma2-1.xz
"$XZDIFF" "$preimage" "$samepostimage" >/dev/null
status=$?
if test "$status" != 0 ; then
echo "xzdiff with no changes exited with status $status != 0"
(exit 1)
exit 1
fi
"$XZDIFF" "$preimage" "$otherpostimage" >/dev/null
status=$?
if test "$status" != 1 ; then
echo "xzdiff with changes exited with status $status != 1"
(exit 1)
exit 1
fi
"$XZDIFF" "$preimage" "$srcdir/files/missing.xz" >/dev/null 2>&1
status=$?
if test "$status" != 2 ; then
echo "xzdiff with missing operand exited with status $status != 2"
(exit 1)
exit 1
fi
# The exit status must be 0 when a match was found at least from one file,
# and 1 when no match was found in any file.
cp "$srcdir/files/good-1-lzma2-1.xz" xzgrep_test_1.xz
cp "$srcdir/files/good-2-lzma2.xz" xzgrep_test_2.xz
for pattern in el Hello NOMATCH; do
for opts in "" "-l" "-h" "-H"; do
echo "=> xzgrep $opts $pattern <="
"$XZGREP" $opts $pattern xzgrep_test_1.xz xzgrep_test_2.xz
echo retval $?
done
done > xzgrep_test_output 2>&1
if cmp -s "$srcdir/xzgrep_expected_output" xzgrep_test_output ; then
:
else
echo "unexpected output from xzgrep"
(exit 1)
exit 1
fi
(exit 0)
exit 0

View File

@ -0,0 +1,39 @@
=> xzgrep el <=
xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut
xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep -l el <=
xzgrep_test_1.xz
xzgrep_test_2.xz
retval 0
=> xzgrep -h el <=
elit, sed do eiusmod tempor incididunt ut
in voluptate velit esse cillum dolore eu
Hello
retval 0
=> xzgrep -H el <=
xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut
xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep Hello <=
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep -l Hello <=
xzgrep_test_2.xz
retval 0
=> xzgrep -h Hello <=
Hello
retval 0
=> xzgrep -H Hello <=
xzgrep_test_2.xz:Hello
retval 0
=> xzgrep NOMATCH <=
retval 1
=> xzgrep -l NOMATCH <=
retval 1
=> xzgrep -h NOMATCH <=
retval 1
=> xzgrep -H NOMATCH <=
retval 1

View File

@ -133,7 +133,7 @@ Building XZ Utils
Using a snapshot from the Git repository Using a snapshot from the Git repository
To use a snapshot, the build system files need to be generated with To use a snapshot, the build system files need to be generated with
autogen.sh or "autoreconf -fi" before trying to build using the the autogen.sh or "autoreconf -fi" before trying to build using the
above build instructions. You can install the relevant extra packages above build instructions. You can install the relevant extra packages
from MinGW or use Cygwin or use e.g. a GNU/Linux system to create a from MinGW or use Cygwin or use e.g. a GNU/Linux system to create a
source package with the required build system files. source package with the required build system files.

Some files were not shown because too many files have changed in this diff Show More