]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
3 years agoliblzma: Add threaded .xz decompressor.
Lasse Collin [Sun, 6 Mar 2022 21:36:20 +0000 (23:36 +0200)] 
liblzma: Add threaded .xz decompressor.

I realize that this is about a decade late.

Big thanks to Sebastian Andrzej Siewior for the original patch.
I made a bunch of smaller changes but after a while quite a few
things got rewritten. So any bugs in the commit were created by me.

3 years agoliblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK.
Lasse Collin [Sun, 6 Mar 2022 14:54:23 +0000 (16:54 +0200)] 
liblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK.

If Check is unsupported, it will be silently ignored.
It's the caller's job to handle it.

3 years agoliblzma: Add new output queue (lzma_outq) features.
Lasse Collin [Sun, 6 Mar 2022 14:41:19 +0000 (16:41 +0200)] 
liblzma: Add new output queue (lzma_outq) features.

Add lzma_outq_clear_cache2() which may leave one buffer allocated
in the cache.

Add lzma_outq_outbuf_memusage() to get the memory needed for
a single lzma_outbuf. This is now used internally in outqueue.c too.

Track both the total amount of memory allocated and the amount of
memory that is in active use (not in cache).

In lzma_outbuf, allow storing the current input position that
matches the current output position. This way the main thread
can notice when no more output is possible without first providing
more input.

Allow specifying return code for lzma_outq_read() in a finished
lzma_outbuf.

3 years agoliblzma: Index hash: Change return value type of hash_append() to void.
Lasse Collin [Sun, 6 Mar 2022 13:18:58 +0000 (15:18 +0200)] 
liblzma: Index hash: Change return value type of hash_append() to void.

3 years agoliblzma: Minor addition to lzma_vli_size() API doc.
Lasse Collin [Tue, 22 Feb 2022 01:42:57 +0000 (03:42 +0200)] 
liblzma: Minor addition to lzma_vli_size() API doc.

Thanks to Jia Tan.

3 years agoliblzma: Check the return value of lzma_index_append() in threaded encoder.
Lasse Collin [Tue, 22 Feb 2022 00:04:18 +0000 (02:04 +0200)] 
liblzma: Check the return value of lzma_index_append() in threaded encoder.

If lzma_index_append() failed (most likely memory allocation failure)
it could have gone unnoticed and the resulting .xz file would have
an incorrect Index. Decompressing such a file would produce the
correct uncompressed data but then an error would occur when
verifying the Index field.

3 years agoUpdate THANKS.
Lasse Collin [Mon, 21 Feb 2022 23:37:39 +0000 (01:37 +0200)] 
Update THANKS.

3 years agoliblzma: Use non-executable stack on FreeBSD as on Linux
Ed Maste [Fri, 11 Feb 2022 15:25:46 +0000 (15:25 +0000)] 
liblzma: Use non-executable stack on FreeBSD as on Linux

3 years agoliblzma: Make Block decoder catch certain types of errors better.
Lasse Collin [Sun, 20 Feb 2022 18:36:27 +0000 (20:36 +0200)] 
liblzma: Make Block decoder catch certain types of errors better.

Now it limits the input and output buffer sizes that are
passed to a raw decoder. This way there's no need to check
if the sizes can grow too big or overflow when updating
Compressed Size and Uncompressed Size counts. This also means
that a corrupt file cannot cause the raw decoder to process
useless extra input or output that would exceed the size info
in Block Header (and thus cause LZMA_DATA_ERROR anyway).

More importantly, now the size information is verified more
carefully in case raw decoder returns LZMA_OK. This doesn't
really matter with the current single-threaded .xz decoder
as the errors would be detected slightly later anyway. But
this helps avoiding corner cases in the upcoming threaded
decompressor, and it might help other Block decoder uses
outside liblzma too.

The test files bad-1-lzma2-{9,10,11}.xz test these conditions.
With the single-threaded .xz decoder the only difference is
that LZMA_DATA_ERROR is detected in a difference place now.

3 years agoTests: Add bad-1-lzma2-11.xz.
Lasse Collin [Sun, 20 Feb 2022 17:38:55 +0000 (19:38 +0200)] 
Tests: Add bad-1-lzma2-11.xz.

3 years agoTranslations: Fix po4a failure with the French man page translations.
Lasse Collin [Fri, 18 Feb 2022 16:51:10 +0000 (18:51 +0200)] 
Translations: Fix po4a failure with the French man page translations.

Thanks to Mario Blättermann for the patch.

3 years agoTranslations: Add French translation of man pages.
Lasse Collin [Sun, 6 Feb 2022 23:14:37 +0000 (01:14 +0200)] 
Translations: Add French translation of man pages.

This matches xz-utils 5.2.5-2 in Debian.

The translation was done by "bubu", proofread by the debian-l10n-french
mailing list contributors, and submitted to me on the xz-devel mailing
list by Jean-Pierre Giraud. Thanks to everyone!

3 years agoliblzma: Add NULL checks to LZMA and LZMA2 properties encoders.
jiat75 [Fri, 28 Jan 2022 12:47:55 +0000 (20:47 +0800)] 
liblzma: Add NULL checks to LZMA and LZMA2 properties encoders.

Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode()
assumed that the options pointers must be non-NULL because the
with these filters the API says it must never be NULL. It is
good to do these checks anyway.

3 years agoliblzma: Fix uint64_t vs. size_t confusion.
Lasse Collin [Sun, 6 Feb 2022 21:19:32 +0000 (23:19 +0200)] 
liblzma: Fix uint64_t vs. size_t confusion.

This broke 32-bit builds due to a pointer type mismatch.

This bug was introduced with the output-size-limited encoding
in 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c.

Thanks to huangqinjin for the bug report.

3 years agoCMake: Keep compatible with Windows 95 for 32-bit build.
huangqinjin [Mon, 13 Dec 2021 12:49:21 +0000 (20:49 +0800)] 
CMake: Keep compatible with Windows 95 for 32-bit build.

3 years agoxzgrep: Update man page timestamp.
Lasse Collin [Sat, 13 Nov 2021 19:04:05 +0000 (21:04 +0200)] 
xzgrep: Update man page timestamp.

3 years agoUpdate THANKS.
Lasse Collin [Sat, 13 Nov 2021 16:23:24 +0000 (18:23 +0200)] 
Update THANKS.

3 years agoxzgrep: use `grep -E/-F` instead of `egrep` and `fgrep`
Ville Skyttä [Sat, 13 Nov 2021 08:11:57 +0000 (10:11 +0200)] 
xzgrep: use `grep -E/-F` instead of `egrep` and `fgrep`

`egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in
current post 3.7 Git they have been made to emit obsolescence warnings:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1

3 years agoBump the version number for 5.3.2alpha. v5.3.2alpha
Lasse Collin [Thu, 28 Oct 2021 20:02:11 +0000 (23:02 +0300)] 
Bump the version number for 5.3.2alpha.

3 years agoAdd NEWS for 5.3.2alpha.
Lasse Collin [Thu, 28 Oct 2021 19:59:52 +0000 (22:59 +0300)] 
Add NEWS for 5.3.2alpha.

3 years agoUpdate THANKS.
Lasse Collin [Wed, 27 Oct 2021 20:27:48 +0000 (23:27 +0300)] 
Update THANKS.

3 years agoxz: Change the coding style of the previous commit.
Lasse Collin [Wed, 27 Oct 2021 20:23:11 +0000 (23:23 +0300)] 
xz: Change the coding style of the previous commit.

It isn't any better now but it's consistent with
the rest of the code base.

3 years agoxz: Avoid fchown(2) failure.
Alexander Bluhm [Tue, 5 Oct 2021 21:33:16 +0000 (23:33 +0200)] 
xz: Avoid fchown(2) failure.

OpenBSD does not allow to change the group of a file if the user
does not belong to this group.  In contrast to Linux, OpenBSD also
fails if the new group is the same as the old one.  Do not call
fchown(2) in this case, it would change nothing anyway.

This fixes an issue with Perl Alien::Build module.
https://github.com/PerlAlien/Alien-Build/issues/62

3 years agoliblzma: Fix liblzma.map for the lzma_microlzma_* symbols.
Lasse Collin [Fri, 17 Sep 2021 14:31:11 +0000 (17:31 +0300)] 
liblzma: Fix liblzma.map for the lzma_microlzma_* symbols.

This should have been part of d267d109c370a40b502e73f8664b154b15e4f253.

Thanks to Gao Xiang.

3 years agoUpdate THANKS.
Lasse Collin [Thu, 9 Sep 2021 19:21:07 +0000 (22:21 +0300)] 
Update THANKS.

3 years agoliblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC.
Lasse Collin [Thu, 9 Sep 2021 18:41:51 +0000 (21:41 +0300)] 
liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC.

By default, MSVC always sets __cplusplus to 199711L. The real
C++ standard version is available in _MSVC_LANG (or one could
use /Zc:__cplusplus to set __cplusplus correctly).

Fixes <https://sourceforge.net/p/lzmautils/discussion/708858/thread/f6bc3b108a/>.

Thanks to Dan Weiss.

3 years agoliblzma: Rename EROFS LZMA to MicroLZMA.
Lasse Collin [Sun, 5 Sep 2021 17:38:12 +0000 (20:38 +0300)] 
liblzma: Rename EROFS LZMA to MicroLZMA.

It still exists primarily for EROFS but MicroLZMA is
a more generic name (that hopefully doesn't clash with
something that already exists).

4 years agoxzdiff: Update the man page about the exit status.
Lasse Collin [Fri, 4 Jun 2021 16:02:38 +0000 (19:02 +0300)] 
xzdiff: Update the man page about the exit status.

This was forgotten from 194029ffaf74282a81f0c299c07f73caca3232ca.

4 years agoxzless: Fix less(1) version detection when it contains a dot.
Lasse Collin [Fri, 4 Jun 2021 15:52:48 +0000 (18:52 +0300)] 
xzless: Fix less(1) version detection when it contains a dot.

Sometimes the version number from "less -V" contains a dot,
sometimes not. xzless failed detect the version number when
it does contain a dot. This fixes it.

Thanks to nick87720z for reporting this. Apparently it had been
reported here <https://bugs.gentoo.org/489362> in 2013.

4 years agoUpdate THANKS.
Lasse Collin [Sun, 11 Apr 2021 16:58:10 +0000 (19:58 +0300)] 
Update THANKS.

4 years agoReduce maximum possible memory limit on MIPS32
Ivan A. Melnikov [Fri, 9 Apr 2021 08:45:10 +0000 (11:45 +0300)] 
Reduce maximum possible memory limit on MIPS32

Due to architectural limitations, address space available to a single
userspace process on MIPS32 is limited to 2 GiB, not 4, even on systems
that have more physical RAM -- e.g. 64-bit systems with 32-bit
userspace, or systems that use XPA (an extension similar to x86's PAE).

So, for MIPS32, we have to impose stronger memory limits. I've chosen
2000MiB to give the process some headroom.

4 years agoCMake: Use interface library for better FindLibLZMA compatibility.
Lasse Collin [Sat, 13 Feb 2021 21:31:27 +0000 (23:31 +0200)] 
CMake: Use interface library for better FindLibLZMA compatibility.

https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html

Thanks to Markus Rickert.

4 years agoCMake: Try to improve compatibility with the FindLibLZMA module.
Lasse Collin [Sat, 30 Jan 2021 16:36:04 +0000 (18:36 +0200)] 
CMake: Try to improve compatibility with the FindLibLZMA module.

The naming conflict with FindLibLZMA module gets worse.
Not avoiding it in the first place was stupid.

Normally find_package(LibLZMA) will use the module and
find_package(liblzma 5.2.5 REQUIRED CONFIG) will use the config
file even with a case insensitive file system. However, if
CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE and the file system
is case insensitive, find_package(LibLZMA) will find our liblzma
config file instead of using FindLibLZMA module.

One big problem with this is that FindLibLZMA uses
LibLZMA::LibLZMA and we use liblzma::liblzma as the target
name. With target names CMake happens to be case sensitive.
To workaround this, this commit adds

    add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma)

to the config file. Then both spellings work.

To make the behavior consistent between case sensitive and
insensitive file systems, the config and related files are
renamed from liblzmaConfig.cmake to liblzma-config.cmake style.
With this style CMake looks for lowercase version of the package
name so find_package(LiBLzmA 5.2.5 REQUIRED CONFIG) will work
to find our config file.

There are other differences between our config file and
FindLibLZMA so it's still possible that things break for
reasons other than the spelling of the target name. Hopefully
those situations aren't too common.

When the config file is available, it should always give as good or
better results as FindLibLZMA so this commit doesn't affect the
recommendation to use find_package(liblzma 5.2.5 REQUIRED CONFIG)
which explicitly avoids FindLibLZMA.

Thanks to Markus Rickert.

4 years agoUpdate THANKS.
Lasse Collin [Fri, 29 Jan 2021 19:19:43 +0000 (21:19 +0200)] 
Update THANKS.

4 years agoliblzma: Fix unitialized variable.
Lasse Collin [Fri, 29 Jan 2021 19:19:08 +0000 (21:19 +0200)] 
liblzma: Fix unitialized variable.

This was introduced two weeks ago in the commit
625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c.

Thanks to Nathan Moinvaziri.

4 years agoTests: Add bad-1-lzma2-10.xz and also modify -9.xz.
Lasse Collin [Sun, 24 Jan 2021 20:32:41 +0000 (22:32 +0200)] 
Tests: Add bad-1-lzma2-10.xz and also modify -9.xz.

4 years agoliblzma: Fix a wrong comment in stream_encoder_mt.c.
Lasse Collin [Sun, 24 Jan 2021 17:22:35 +0000 (19:22 +0200)] 
liblzma: Fix a wrong comment in stream_encoder_mt.c.

4 years agoTests: Add bad-1-lzma2-9.xz.
Lasse Collin [Sun, 24 Jan 2021 16:51:51 +0000 (18:51 +0200)] 
Tests: Add bad-1-lzma2-9.xz.

4 years agoTests: Add bad-1-check-crc32-2.xz.
Lasse Collin [Sun, 24 Jan 2021 15:02:00 +0000 (17:02 +0200)] 
Tests: Add bad-1-check-crc32-2.xz.

4 years agoliblzma: In EROFS LZMA decoder, verify that comp_size matches at the end.
Lasse Collin [Sun, 17 Jan 2021 17:20:50 +0000 (19:20 +0200)] 
liblzma: In EROFS LZMA decoder, verify that comp_size matches at the end.

When the uncompressed size is known to be exact, after decompressing
the stream exactly comp_size bytes of input must have been consumed.
This is a minor improvement to error detection.

4 years agoliblzma: Make EROFS LZMA decoder work when exact uncomp_size isn't known.
Lasse Collin [Sun, 17 Jan 2021 16:53:34 +0000 (18:53 +0200)] 
liblzma: Make EROFS LZMA decoder work when exact uncomp_size isn't known.

The caller must still not specify an uncompressed size bigger
than the actual uncompressed size.

As a downside, this now needs the exact compressed size.

4 years agoliblzma: Fix missing normalization in rc_encode_dummy().
Lasse Collin [Thu, 14 Jan 2021 18:57:11 +0000 (20:57 +0200)] 
liblzma: Fix missing normalization in rc_encode_dummy().

Without this fix it could attempt to create too much output.

4 years agoliblzma: Add EROFS LZMA encoder and decoder.
Lasse Collin [Thu, 14 Jan 2021 18:07:01 +0000 (20:07 +0200)] 
liblzma: Add EROFS LZMA encoder and decoder.

Right now this is just a planned extra-compact format for use
in the EROFS file system in Linux. At this point it's possible
that the format will either change or be abandoned and removed
completely.

The special thing about the encoder is that it uses the
output-size-limited encoding added in the previous commit.
EROFS uses fixed-sized blocks (e.g. 4 KiB) to hold compressed
data so the compressors must be able to create valid streams
that fill the given block size.

4 years agoliblzma: Add rough support for output-size-limited encoding in LZMA1.
Lasse Collin [Wed, 13 Jan 2021 17:16:32 +0000 (19:16 +0200)] 
liblzma: Add rough support for output-size-limited encoding in LZMA1.

With this it is possible to encode LZMA1 data without EOPM so that
the encoder will encode as much input as it can without exceeding
the specified output size limit. The resulting LZMA1 stream will
be a normal LZMA1 stream without EOPM. The actual uncompressed size
will be available to the caller via the uncomp_size pointer.

One missing thing is that the LZMA layer doesn't inform the LZ layer
when the encoding is finished and thus the LZ may read more input
when it won't be used. However, this doesn't matter if encoding is
done with a single call (which is the planned use case for now).
For proper multi-call encoding this should be improved.

This commit only adds the functionality for internal use.
Nothing uses it yet.

4 years agoScripts: Add zstd support to xzdiff.
Lasse Collin [Mon, 11 Jan 2021 21:57:11 +0000 (23:57 +0200)] 
Scripts: Add zstd support to xzdiff.

4 years agoUpdate THANKS.
Lasse Collin [Mon, 11 Jan 2021 21:41:30 +0000 (23:41 +0200)] 
Update THANKS.

4 years agoxz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky.
Lasse Collin [Mon, 11 Jan 2021 21:41:16 +0000 (23:41 +0200)] 
xz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky.

Previously this required using --force but that has other
effects too which might be undesirable. Changing the behavior
of --keep has a small risk of breaking existing scripts but
since this is a fairly special corner case I expect the
likehood of breakage to be low enough.

I think the new behavior is more logical. The only reason for
the old behavior was to be consistent with gzip and bzip2.

Thanks to Vincent Lefevre and Sebastian Andrzej Siewior.

4 years agoScripts: Fix exit status of xzgrep.
Lasse Collin [Mon, 11 Jan 2021 21:28:52 +0000 (23:28 +0200)] 
Scripts: Fix exit status of xzgrep.

Omit the -q option from xz, gzip, and bzip2. With xz this shouldn't
matter. With gzip it's important because -q makes gzip replace SIGPIPE
with exit status 2. With bzip2 it's important because with -q bzip2
is completely silent if input is corrupt while other decompressors
still give an error message.

Avoiding exit status 2 from gzip is important because bzip2 uses
exit status 2 to indicate corrupt input. Before this commit xzgrep
didn't recognize corrupt .bz2 files because xzgrep was treating
exit status 2 as SIGPIPE for gzip compatibility.

zstd still needs -q because otherwise it is noisy in normal
operation.

The code to detect real SIGPIPE didn't check if the exit status
was due to a signal (>= 128) and so could ignore some other exit
status too.

4 years agoScripts: Fix exit status of xzdiff/xzcmp.
Lasse Collin [Mon, 11 Jan 2021 20:01:51 +0000 (22:01 +0200)] 
Scripts: Fix exit status of xzdiff/xzcmp.

This is a minor fix since this affects only the situation when
the files differ and the exit status is something else than 0.
In such case there could be SIGPIPE from a decompression tool
and that would result in exit status of 2 from xzdiff/xzcmp
while the correct behavior would be to return 1 or whatever
else diff or cmp may have returned.

This commit omits the -q option from xz/gzip/bzip2/lzop arguments.
I'm not sure why the -q was used in the first place, perhaps it
hides warnings in some situation that I cannot see at the moment.
Hopefully the removal won't introduce a new bug.

With gzip the -q option was harmful because it made gzip return 2
instead of >= 128 with SIGPIPE. Ignoring exit status 2 (warning
from gzip) isn't practical because bzip2 uses exit status 2 to
indicate corrupt input file. It's better if SIGPIPE results in
exit status >= 128.

With bzip2 the removal of -q seems to be good because with -q
it prints nothing if input is corrupt. The other tools aren't
silent in this situation even with -q. On the other hand, if
zstd support is added, it will need -q since otherwise it's
noisy in normal situations.

Thanks to Étienne Mollier and Sebastian Andrzej Siewior.

4 years agoliblzma: Make lzma_outq usable for threaded decompression too.
Lasse Collin [Sat, 9 Jan 2021 19:14:36 +0000 (21:14 +0200)] 
liblzma: Make lzma_outq usable for threaded decompression too.

Before this commit all output queue buffers were allocated as
a single big allocation. Now each buffer is allocated separately
when needed. Used buffers are cached to avoid reallocation
overhead but the cache will keep only one buffer size at a time.
This should make things work OK in the decompression where most
of the time the buffer sizes will be the same but with some less
common files the buffer sizes may vary.

While this should work fine, it's still a bit preliminary
and may even get reverted if it turns out to be useless for
decompression.

4 years agoUpdate THANKS.
Lasse Collin [Wed, 23 Dec 2020 15:15:49 +0000 (17:15 +0200)] 
Update THANKS.

4 years agoliblzma: Enable Intel CET in x86 CRC assembly codes
H.J. Lu [Wed, 23 Dec 2020 14:49:04 +0000 (06:49 -0800)] 
liblzma: Enable Intel CET in x86 CRC assembly codes

When Intel CET is enabled, we need to include <cet.h> in assembly codes
to mark Intel CET support and add _CET_ENDBR to indirect jump targets.

Tested on Intel Tiger Lake under CET enabled Linux.

4 years agoUpdate THANKS.
Lasse Collin [Wed, 16 Dec 2020 16:33:29 +0000 (18:33 +0200)] 
Update THANKS.

4 years agoBuild: Don't build bundles on Apple OSes.
Lasse Collin [Wed, 16 Dec 2020 16:30:14 +0000 (18:30 +0200)] 
Build: Don't build bundles on Apple OSes.

Thanks to Daniel Packard.

4 years agoUpdate THANKS.
Lasse Collin [Sat, 5 Dec 2020 20:44:03 +0000 (22:44 +0200)] 
Update THANKS.

4 years agoScripts: Add zstd support to xzgrep.
Adam Borowski [Fri, 25 Sep 2020 01:35:18 +0000 (03:35 +0200)] 
Scripts: Add zstd support to xzgrep.

Thanks to Adam Borowski.

4 years agoCMake: Fix compatibility with CMake 3.13.
Lasse Collin [Tue, 17 Nov 2020 18:51:48 +0000 (20:51 +0200)] 
CMake: Fix compatibility with CMake 3.13.

The syntax "if(DEFINED CACHE{FOO})" requires CMake 3.14.
In some other places the code treats the cache variables
like normal variables already (${FOO} or if(FOO) is used,
not ${CACHE{FOO}).

Thanks to ygrek for reporting the bug on IRC.

4 years agoUpdate THANKS.
Lasse Collin [Sun, 1 Nov 2020 20:56:43 +0000 (22:56 +0200)] 
Update THANKS.

4 years agoxz: Avoid unneeded \f escapes on the man page.
Lasse Collin [Sun, 1 Nov 2020 20:34:25 +0000 (22:34 +0200)] 
xz: Avoid unneeded \f escapes on the man page.

I don't want to use \c in macro arguments but groff_man(7)
suggests that \f has better portability. \f would be needed
for the .TP strings for portability reasons anyway.

Thanks to Bjarni Ingi Gislason.

4 years agoxz: Use non-breaking spaces when intentionally using more than one space.
Lasse Collin [Sun, 1 Nov 2020 17:09:53 +0000 (19:09 +0200)] 
xz: Use non-breaking spaces when intentionally using more than one space.

This silences some style checker warnings. Seems that spaces
in the beginning of a line don't need this treatment.

Thanks to Bjarni Ingi Gislason.

4 years agoxz: Protect the ellipsis (...) on the man page with \&.
Lasse Collin [Sun, 1 Nov 2020 16:49:37 +0000 (18:49 +0200)] 
xz: Protect the ellipsis (...) on the man page with \&.

This does it only when ... appears outside macro calls.

Thanks to Bjarni Ingi Gislason.

4 years agoxz: Avoid the abbreviation "e.g." on the man page.
Lasse Collin [Sun, 1 Nov 2020 16:41:21 +0000 (18:41 +0200)] 
xz: Avoid the abbreviation "e.g." on the man page.

A few are simply omitted, most are converted to "for example"
and surrounded with commas. Sounds like that this is better
style, for example, man-pages(7) recommends avoiding such
abbreviations except in parenthesis.

Thanks to Bjarni Ingi Gislason.

5 years agoxz man page: Change \- (minus) to \(en (en-dash) for a numeric range.
Lasse Collin [Sun, 12 Jul 2020 20:10:03 +0000 (23:10 +0300)] 
xz man page: Change \- (minus) to \(en (en-dash) for a numeric range.

Docs of ancient troff/nroff mention \(em (em-dash) but not \(en
and \- was used for both minus and en-dash. I don't know how
portable \(en is nowadays but it can be changed back if someone
complains. At least GNU groff and OpenBSD's mandoc support it.

Thanks to Bjarni Ingi Gislason for the patch.

5 years agoWindows: Fix building of resource files when config.h isn't used.
Lasse Collin [Sun, 12 Jul 2020 17:46:24 +0000 (20:46 +0300)] 
Windows: Fix building of resource files when config.h isn't used.

Now CMake + Visual Studio works for building liblzma.dll.

Thanks to Markus Rickert.

5 years agosrc/scripts/xzgrep.1: Filenames to xzgrep are optional.
Lasse Collin [Mon, 6 Apr 2020 16:31:50 +0000 (19:31 +0300)] 
src/scripts/xzgrep.1: Filenames to xzgrep are optional.

xzgrep --help was correct already.

5 years agosrc/script/xzgrep.1: Remove superfluous '.RB'
Bjarni Ingi Gislason [Thu, 26 Mar 2020 22:17:31 +0000 (22:17 +0000)] 
src/script/xzgrep.1: Remove superfluous '.RB'

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/scripts/xzgrep.1

<src/scripts/xzgrep.1>:20 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:23 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:26 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:29 (macro RB): only 1 argument, but more are expected
<src/scripts/xzgrep.1>:32 (macro RB): only 1 argument, but more are expected

 "abc..." does not mean the same as "abc ...".

  The output from nroff and troff is unchanged except for the space
between "file" and "...".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoxzgrep.1: Delete superfluous '.PP'
Bjarni Ingi Gislason [Mon, 30 Mar 2020 21:56:36 +0000 (21:56 +0000)] 
xzgrep.1: Delete superfluous '.PP'

Summary:

mandoc -T lint xzgrep.1 :
mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty

  There is no change in the output of "nroff" and "troff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agosrc/xz/xz.1: Correct misused two-fonts macros
Bjarni Ingi Gislason [Thu, 26 Mar 2020 21:16:18 +0000 (21:16 +0000)] 
src/xz/xz.1: Correct misused two-fonts macros

Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./src/xz/xz.1

<src/xz/xz.1>:408 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1009 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1743 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:1920 (macro BR): only 1 argument, but more are expected
<src/xz/xz.1>:2213 (macro BR): only 1 argument, but more are expected

  Output from nroff and troff is unchanged, except for a font change of a
full stop (.).

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
5 years agoTypo fixes from fossies.org.
Lasse Collin [Mon, 23 Mar 2020 16:07:50 +0000 (18:07 +0200)] 
Typo fixes from fossies.org.

https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html

5 years agoUpdate NEWS for 5.2.5.
Lasse Collin [Tue, 17 Mar 2020 14:24:28 +0000 (16:24 +0200)] 
Update NEWS for 5.2.5.

5 years agoREADME: Update outdated sections.
Lasse Collin [Mon, 16 Mar 2020 18:01:37 +0000 (20:01 +0200)] 
README: Update outdated sections.

5 years agoREADME: Mention that man pages can be translated.
Lasse Collin [Mon, 16 Mar 2020 17:39:45 +0000 (19:39 +0200)] 
README: Mention that man pages can be translated.

5 years agoUpdate INSTALL.generic from Automake 1.16.1.
Lasse Collin [Mon, 16 Mar 2020 14:43:29 +0000 (16:43 +0200)] 
Update INSTALL.generic from Automake 1.16.1.

5 years agoUpdate INSTALL for Windows and DOS and add preliminary info for z/OS.
Lasse Collin [Sun, 15 Mar 2020 13:27:22 +0000 (15:27 +0200)] 
Update INSTALL for Windows and DOS and add preliminary info for z/OS.

5 years agoBuild: Update m4/ax_pthread.m4 from Autoconf Archive (again).
Lasse Collin [Sun, 15 Mar 2020 13:26:20 +0000 (15:26 +0200)] 
Build: Update m4/ax_pthread.m4 from Autoconf Archive (again).

5 years agoxz: Never use thousand separators in DJGPP builds.
Lasse Collin [Wed, 11 Mar 2020 19:15:35 +0000 (21:15 +0200)] 
xz: Never use thousand separators in DJGPP builds.

DJGPP 2.05 added support for thousands separators but it's
broken at least under WinXP with Finnish locale that uses
a non-breaking space as the thousands separator. Workaround
by disabling thousands separators for DJGPP builds.

5 years agoDOS: Update dos/Makefile for DJGPP 2.05.
Lasse Collin [Wed, 11 Mar 2020 17:38:08 +0000 (19:38 +0200)] 
DOS: Update dos/Makefile for DJGPP 2.05.

It doesn't need -fgnu89-inline like 2.04beta did.

5 years agoDOS: Update instructions in dos/INSTALL.txt.
Lasse Collin [Wed, 11 Mar 2020 17:36:07 +0000 (19:36 +0200)] 
DOS: Update instructions in dos/INSTALL.txt.

5 years agoDOS: Update config.h.
Lasse Collin [Wed, 11 Mar 2020 15:58:51 +0000 (17:58 +0200)] 
DOS: Update config.h.

The added defines assume GCC >= 4.8.

5 years agoliblzma: Fix a comment and RC_SYMBOLS_MAX.
Lasse Collin [Mon, 2 Mar 2020 11:54:33 +0000 (13:54 +0200)] 
liblzma: Fix a comment and RC_SYMBOLS_MAX.

The comment didn't match the value of RC_SYMBOLS_MAX and the value
itself was slightly larger than actually needed. The only harm
about this was that memory usage was a few bytes larger.

5 years agoBuild: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails.
Lasse Collin [Thu, 27 Feb 2020 18:58:52 +0000 (20:58 +0200)] 
Build: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails.

5 years agoBuild: Add support for --no-po4a option to autogen.sh.
Lasse Collin [Thu, 27 Feb 2020 18:24:27 +0000 (20:24 +0200)] 
Build: Add support for --no-po4a option to autogen.sh.

Normally, if po4a isn't available, autogen.sh will return
with non-zero exit status. The option --no-po4a can be useful
when one knows that po4a isn't available but wants autogen.sh
to still return with zero exit status.

5 years agoUpdate THANKS.
Lasse Collin [Tue, 25 Feb 2020 19:35:14 +0000 (21:35 +0200)] 
Update THANKS.

5 years agoBuild: Fix bugs in the CMake files.
Lasse Collin [Tue, 25 Feb 2020 18:42:31 +0000 (20:42 +0200)] 
Build: Fix bugs in the CMake files.

Seems that the phrase "add more quotes" from sh/bash scripting
applies to CMake as well. E.g. passing an unquoted list ${FOO}
to a function that expects one argument results in only the
first element of the list being passed as an argument and
the rest get ignored. Adding quotes helps ("${FOO}").

list(INSERT ...) is weird. Inserting an empty string to an empty
variable results in empty list, but inserting it to a non-empty
variable does insert an empty element to the list.

Since INSERT requires at least one element,
"${CMAKE_THREAD_LIBS_INIT}" needs to be quoted in CMakeLists.txt.
It might result in an empty element in the list. It seems to not
matter as empty elements consistently get ignored in that variable.
In fact, calling cmake_check_push_state() and cmake_check_pop_state()
will strip the empty elements from CMAKE_REQUIRED_LIBRARIES!

In addition to quoting fixes, this fixes checks for the cache
variables in tuklib_cpucores.cmake and tuklib_physmem.cmake.

Thanks to Martin Matuška for testing and reporting the problems.
These fixes aren't tested yet but hopefully they soon will be.

5 years agoBuild: Add very limited experimental CMake support.
Lasse Collin [Mon, 24 Feb 2020 21:38:16 +0000 (23:38 +0200)] 
Build: Add very limited experimental CMake support.

This does *NOT* replace the Autotools-based build system in
the foreseeable future. See the comment in the beginning
of CMakeLists.txt.

So far this has been tested only on GNU/Linux but I commit
it anyway to make it easier for others to test. Since I
haven't played much with CMake before, it's likely that
there are things that have been done in a silly or wrong
way and need to be fixed.

5 years agoUpdate m4/.gitignore.
Lasse Collin [Mon, 24 Feb 2020 21:37:07 +0000 (23:37 +0200)] 
Update m4/.gitignore.

5 years agotuklib: Omit an unneeded <sys/types.h> from a tests.
Lasse Collin [Mon, 24 Feb 2020 21:29:35 +0000 (23:29 +0200)] 
tuklib: Omit an unneeded <sys/types.h> from a tests.

tuklib_cpucores.c and tuklib_physmem.c don't include <sys/types.h>
even via other files in this package, so clearly that header isn't
needed in the tests either (no one has reported build problems due
to a missing header in a .c file).

5 years agoliblzma: Remove unneeded <sys/types.h> from fastpos_tablegen.c.
Lasse Collin [Mon, 24 Feb 2020 21:01:00 +0000 (23:01 +0200)] 
liblzma: Remove unneeded <sys/types.h> from fastpos_tablegen.c.

This file only generates fastpos_table.c.
It isn't built as a part of liblzma.

5 years agoUse defined(__GNUC__) before __GNUC__ in preprocessor lines.
Lasse Collin [Sat, 22 Feb 2020 12:15:07 +0000 (14:15 +0200)] 
Use defined(__GNUC__) before __GNUC__ in preprocessor lines.

This should silence the equivalent of -Wundef in compilers that
don't define __GNUC__.

5 years agoliblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.
Lasse Collin [Fri, 21 Feb 2020 15:40:02 +0000 (17:40 +0200)] 
liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.

This gives a tiny encoder speed improvement. This could have been done
in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but
it was forgotten.

5 years agoBuild: Add visibility.m4 from gnulib.
Lasse Collin [Fri, 21 Feb 2020 15:01:15 +0000 (17:01 +0200)] 
Build: Add visibility.m4 from gnulib.

Appears that this file used to get included as a side effect of
gettext. After the change to gettext version requirements this file
no longer got copied to the package and so the build was broken.

5 years agoxz: Silence a warning when sig_atomic_t is long int.
Lasse Collin [Fri, 21 Feb 2020 14:10:44 +0000 (16:10 +0200)] 
xz: Silence a warning when sig_atomic_t is long int.

It can be true at least on z/OS.

5 years agoxz: Avoid unneeded access of a volatile variable.
Lasse Collin [Fri, 21 Feb 2020 13:59:26 +0000 (15:59 +0200)] 
xz: Avoid unneeded access of a volatile variable.

5 years agotuklib_integer.m4: Optimize the check order.
Lasse Collin [Thu, 20 Feb 2020 23:24:18 +0000 (01:24 +0200)] 
tuklib_integer.m4: Optimize the check order.

The __builtin byteswapping is the preferred one so check for it first.

5 years agotuklib_exit: Add missing header.
Lasse Collin [Thu, 20 Feb 2020 16:54:04 +0000 (18:54 +0200)] 
tuklib_exit: Add missing header.

strerror() needs <string.h> which happened to be included via
tuklib_common.h -> tuklib_config.h -> sysdefs.h if HAVE_CONFIG_H
was defined. This wasn't tested without config.h before so it
had worked fine.

5 years agoRevert the previous commit and add a comment.
Lasse Collin [Tue, 18 Feb 2020 17:12:35 +0000 (19:12 +0200)] 
Revert the previous commit and add a comment.

The previous commit broke crc32_tablegen.c.

If the whole package is built without config.h (with defines
set on the compiler command line) this should still work fine
as long as these headers conform to C99 well enough.

5 years agoDo not check for HAVE_CONFIG_H in tuklib_config.h.
Lasse Collin [Mon, 17 Feb 2020 21:37:20 +0000 (23:37 +0200)] 
Do not check for HAVE_CONFIG_H in tuklib_config.h.

In XZ Utils sysdefs.h takes care of it and the required headers.

5 years agosysdefs.h: Omit the conditionals around string.h and limits.h.
Lasse Collin [Sun, 16 Feb 2020 09:18:28 +0000 (11:18 +0200)] 
sysdefs.h: Omit the conditionals around string.h and limits.h.

string.h is used unconditionally elsewhere in the project and
configure has always stopped if limits.h is missing, so these
headers must have been always available even on the weirdest
systems.

5 years agoBuild: Bump Autoconf and Libtool version requirements.
Lasse Collin [Sat, 15 Feb 2020 13:07:11 +0000 (15:07 +0200)] 
Build: Bump Autoconf and Libtool version requirements.

There is no specific reason for this other than blocking
the most ancient versions. These are still old:

Autoconf 2.69 (2012)
Automake 1.12 (2012)
gettext 0.19.6 (2015)
Libtool 2.4 (2010)

5 years agoBuild: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6.
Lasse Collin [Sat, 15 Feb 2020 01:08:32 +0000 (03:08 +0200)] 
Build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6.

This bumps the version requirement from 0.19 (from 2014) to
0.19.6 (2015).

Using only the old AM_GNU_GETTEXT_VERSION results in old
gettext infrastructure being placed in the package. By using
both macros we get the latest gettext files while the other
programs in the Autotools family can still see the old macro.