]> granicus.if.org Git - xz/log
xz
10 years agoliblzma: Simplify LZMA fast mode code by using memcmp().
Lasse Collin [Fri, 25 Jul 2014 19:30:38 +0000 (22:30 +0300)]
liblzma: Simplify LZMA fast mode code by using memcmp().

10 years agoliblzma: Use lzma_memcmplen() in fast mode of LZMA.
Lasse Collin [Fri, 25 Jul 2014 19:29:49 +0000 (22:29 +0300)]
liblzma: Use lzma_memcmplen() in fast mode of LZMA.

10 years agoUpdate THANKS.
Lasse Collin [Fri, 25 Jul 2014 18:16:23 +0000 (21:16 +0300)]
Update THANKS.

10 years agoliblzma: Use lzma_memcmplen() in the match finders.
Lasse Collin [Fri, 25 Jul 2014 18:15:07 +0000 (21:15 +0300)]
liblzma: Use lzma_memcmplen() in the match finders.

This doesn't change the match finder output.

10 years agoliblzma: Add lzma_memcmplen() for fast memory comparison.
Lasse Collin [Fri, 25 Jul 2014 17:57:20 +0000 (20:57 +0300)]
liblzma: Add lzma_memcmplen() for fast memory comparison.

This commit just adds the function. Its uses will be in
separate commits.

This hasn't been tested much yet and it's perhaps a bit early
to commit it but if there are bugs they should get found quite
quickly.

Thanks to Jun I Jin from Intel for help and for pointing out
that string comparison needs to be optimized in liblzma.

10 years agoUpdate THANKS.
Lasse Collin [Sat, 12 Jul 2014 18:10:09 +0000 (21:10 +0300)]
Update THANKS.

10 years agoTranslations: Add Vietnamese translation.
Lasse Collin [Sat, 12 Jul 2014 17:06:08 +0000 (20:06 +0300)]
Translations: Add Vietnamese translation.

Thanks to Trần Ngọc Quân.

10 years agoxz: Update the help message of a few options.
Lasse Collin [Sun, 29 Jun 2014 17:54:14 +0000 (20:54 +0300)]
xz: Update the help message of a few options.

Updated: --threads, --block-size, and --block-list
Added: --flush-timeout

10 years agoxz: Use lzma_cputhreads() instead of own copy of tuklib_cpucores().
Lasse Collin [Wed, 18 Jun 2014 19:07:06 +0000 (22:07 +0300)]
xz: Use lzma_cputhreads() instead of own copy of tuklib_cpucores().

10 years agoliblzma: Add lzma_cputhreads().
Lasse Collin [Wed, 18 Jun 2014 19:04:24 +0000 (22:04 +0300)]
liblzma: Add lzma_cputhreads().

10 years agoxz: Check for filter chain compatibility for --flush-timeout.
Lasse Collin [Wed, 18 Jun 2014 16:11:52 +0000 (19:11 +0300)]
xz: Check for filter chain compatibility for --flush-timeout.

This avoids LZMA_PROG_ERROR from lzma_code() with filter chains
that don't support LZMA_SYNC_FLUSH.

10 years agoxzgrep: List xzgrep_expected_output in tests/Makefile.am.
Lasse Collin [Fri, 13 Jun 2014 16:21:54 +0000 (19:21 +0300)]
xzgrep: List xzgrep_expected_output in tests/Makefile.am.

10 years agoxzgrep: Improve the test script.
Lasse Collin [Fri, 13 Jun 2014 15:58:22 +0000 (18:58 +0300)]
xzgrep: Improve the test script.

Now it should be close to the functionality of the original
version by Pavel Raiskup.

10 years agoxzgrep: Add a test for the previous fix.
Lasse Collin [Wed, 11 Jun 2014 18:03:25 +0000 (21:03 +0300)]
xzgrep: Add a test for the previous fix.

This is a simplified version of Pavel Raiskup's
original patch.

10 years agoxzgrep: exit 0 when at least one file matches.
Lasse Collin [Wed, 11 Jun 2014 17:43:28 +0000 (20:43 +0300)]
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.

10 years agoxz: Force single-threaded mode when --flush-timeout is used.
Lasse Collin [Mon, 9 Jun 2014 18:21:24 +0000 (21:21 +0300)]
xz: Force single-threaded mode when --flush-timeout is used.

10 years agoUpdate THANKS.
Lasse Collin [Sun, 25 May 2014 19:05:39 +0000 (22:05 +0300)]
Update THANKS.

10 years agoliblzma: Use lzma_alloc_zero() in LZ encoder initialization.
Lasse Collin [Sun, 25 May 2014 18:45:56 +0000 (21:45 +0300)]
liblzma: Use lzma_alloc_zero() in LZ encoder initialization.

This avoids a memzero() call for a newly-allocated memory,
which can be expensive when encoding small streams with
an over-sized dictionary.

To avoid using lzma_alloc_zero() for memory that doesn't
need to be zeroed, lzma_mf.son is now allocated separately,
which requires handling it separately in normalize() too.

Thanks to Vincenzo Innocente for reporting the problem.

10 years agoliblzma: Add the internal function lzma_alloc_zero().
Lasse Collin [Sun, 25 May 2014 16:25:57 +0000 (19:25 +0300)]
liblzma: Add the internal function lzma_alloc_zero().

10 years agoxz: Fix uint64_t vs. size_t which broke 32-bit build.
Lasse Collin [Thu, 8 May 2014 15:03:09 +0000 (18:03 +0300)]
xz: Fix uint64_t vs. size_t which broke 32-bit build.

Thanks to Christian Hesse.

10 years agoDocs: Update comments to refer to lzma/lzma12.h in example programs.
Lasse Collin [Sun, 4 May 2014 08:09:11 +0000 (11:09 +0300)]
Docs: Update comments to refer to lzma/lzma12.h in example programs.

10 years agoliblzma: Rename the private API header lzma/lzma.h to lzma/lzma12.h.
Lasse Collin [Sun, 4 May 2014 08:07:17 +0000 (11:07 +0300)]
liblzma: Rename the private API header lzma/lzma.h to lzma/lzma12.h.

It can be confusing that two header files have the same name.
The public API file is still lzma.h.

10 years agoBuild: Fix the combination of --disable-xzdec --enable-lzmadec.
Lasse Collin [Fri, 25 Apr 2014 14:53:42 +0000 (17:53 +0300)]
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.

10 years agoBuild: Add --disable-doc to configure.
Lasse Collin [Fri, 25 Apr 2014 14:44:26 +0000 (17:44 +0300)]
Build: Add --disable-doc to configure.

10 years agoUpdate INSTALL.
Lasse Collin [Thu, 24 Apr 2014 15:06:24 +0000 (18:06 +0300)]
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".

10 years agoxz: Rename a variable to avoid a namespace collision on Solaris.
Lasse Collin [Wed, 9 Apr 2014 14:26:10 +0000 (17:26 +0300)]
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.

10 years agoDocs: Add example program for threaded encoding.
Lasse Collin [Wed, 29 Jan 2014 18:19:41 +0000 (20:19 +0200)]
Docs: Add example program for threaded encoding.

I didn't add -DLZMA_UNSTABLE to Makefile so one has to
specify it manually as long as LZMA_UNSTABLE is needed.

10 years agoliblzma: Fix lzma_mt.preset not working with lzma_stream_encoder_mt().
Lasse Collin [Wed, 29 Jan 2014 18:13:51 +0000 (20:13 +0200)]
liblzma: Fix lzma_mt.preset not working with lzma_stream_encoder_mt().

It read the filter chain from a wrong variable.

10 years agoliblzma: Fix typo in a comment.
Lasse Collin [Mon, 20 Jan 2014 09:20:40 +0000 (11:20 +0200)]
liblzma: Fix typo in a comment.

10 years agoWindows: Add config.h for building liblzma with MSVC 2013.
Lasse Collin [Sun, 12 Jan 2014 17:38:43 +0000 (19:38 +0200)]
Windows: Add config.h for building liblzma with MSVC 2013.

This is for building liblzma. Building xz tool too requires
a little more work. Maybe it will be supported, but for most
MSVC users it's enough to be able to build liblzma.

C99 support in MSVC 2013 is almost usable which is a big
improvement over earlier versions. It's "almost" because
there's a dumb bug that breaks mixed declarations after
an "if" statements unless the "if" statement uses braces:

https://connect.microsoft.com/VisualStudio/feedback/details/808650/visual-studio-2013-c99-compiler-bug
https://connect.microsoft.com/VisualStudio/feedback/details/808472/c99-support-of-mixed-declarations-and-statements-fails-with-certain-types-and-constructs

Hopefully it will get fixed. Then liblzma should be
compilable with MSVC 2013 without patching.

10 years agoxz: Fix a comment.
Lasse Collin [Sun, 12 Jan 2014 15:41:14 +0000 (17:41 +0200)]
xz: Fix a comment.

10 years agoWindows: Add MSVC defines for inline and restrict keywords.
Lasse Collin [Sun, 12 Jan 2014 15:04:33 +0000 (17:04 +0200)]
Windows: Add MSVC defines for inline and restrict keywords.

10 years agoliblzma: Avoid C99 compound literal arrays.
Lasse Collin [Sun, 12 Jan 2014 14:44:52 +0000 (16:44 +0200)]
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.

10 years agoliblzma: Remove a useless C99ism from sha256.c.
Lasse Collin [Sun, 12 Jan 2014 10:50:30 +0000 (12:50 +0200)]
liblzma: Remove a useless C99ism from sha256.c.

Unsurprisingly it makes no difference in compiled output.

10 years agoxz: Fix use of wrong variable.
Lasse Collin [Sun, 12 Jan 2014 10:17:08 +0000 (12:17 +0200)]
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.

10 years agoFix typos in comments.
Lasse Collin [Sun, 12 Jan 2014 10:11:36 +0000 (12:11 +0200)]
Fix typos in comments.

11 years agoUpdate THANKS.
Lasse Collin [Tue, 26 Nov 2013 16:20:16 +0000 (18:20 +0200)]
Update THANKS.

11 years agoliblzma: Document the need for block->check for lzma_block_header_decode().
Lasse Collin [Tue, 26 Nov 2013 16:20:09 +0000 (18:20 +0200)]
liblzma: Document the need for block->check for lzma_block_header_decode().

Thanks to Tomer Chachamu.

11 years agoxz: Update the man page about --block-size and --block-list.
Lasse Collin [Tue, 12 Nov 2013 14:38:57 +0000 (16:38 +0200)]
xz: Update the man page about --block-size and --block-list.

11 years agoUpdate THANKS.
Lasse Collin [Tue, 12 Nov 2013 14:30:53 +0000 (16:30 +0200)]
Update THANKS.

11 years agoxz: Make --block-list and --block-size work together in single-threaded.
Lasse Collin [Tue, 12 Nov 2013 14:29:48 +0000 (16:29 +0200)]
xz: Make --block-list and --block-size work together in single-threaded.

Previously, --block-list and --block-size only worked together
in threaded mode. Boundaries are specified by --block-list, but
--block-size specifies the maximum size for a Block. Now this
works in single-threaded mode too.

Thanks to James M Leddy for the original patch.

11 years agoBump the version number to 5.1.3alpha. v5.1.3alpha
Lasse Collin [Sat, 26 Oct 2013 10:26:14 +0000 (13:26 +0300)]
Bump the version number to 5.1.3alpha.

11 years agoUpdate NEWS for 5.1.3alpha.
Lasse Collin [Sat, 26 Oct 2013 10:25:02 +0000 (13:25 +0300)]
Update NEWS for 5.1.3alpha.

11 years agoUpdate TODO.
Lasse Collin [Sat, 26 Oct 2013 09:47:04 +0000 (12:47 +0300)]
Update TODO.

11 years agoxz: Document behavior of --block-list with threads.
Lasse Collin [Fri, 25 Oct 2013 19:41:28 +0000 (22:41 +0300)]
xz: Document behavior of --block-list with threads.

This needs to be updated before 5.2.0.

11 years agoxz: Document --flush-timeout=TIMEOUT on the man page.
Lasse Collin [Tue, 22 Oct 2013 17:03:12 +0000 (20:03 +0300)]
xz: Document --flush-timeout=TIMEOUT on the man page.

11 years agoxz: Take advantage of LZMA_FULL_BARRIER with --block-list.
Lasse Collin [Tue, 22 Oct 2013 16:51:55 +0000 (19:51 +0300)]
xz: Take advantage of LZMA_FULL_BARRIER with --block-list.

Now if --block-list is used in threaded mode, the encoder
won't need to flush at each Block boundary specified via
--block-list. This improves performance a lot, making
threading helpful with --block-list.

The flush timer was reset after LZMA_FULL_FLUSH but since
LZMA_FULL_BARRIER doesn't flush, resetting the timer is
no longer done.

11 years agoliblzma: Support LZMA_FULL_FLUSH and _BARRIER in threaded encoder.
Lasse Collin [Wed, 2 Oct 2013 17:05:23 +0000 (20:05 +0300)]
liblzma: Support LZMA_FULL_FLUSH and _BARRIER in threaded encoder.

Now --block-list=SIZES works with in the threaded mode too,
although the performance is still bad due to the use of
LZMA_FULL_FLUSH instead of the new LZMA_FULL_BARRIER.

11 years agoliblzma: Add LZMA_FULL_BARRIER support to single-threaded encoder.
Lasse Collin [Wed, 2 Oct 2013 09:55:11 +0000 (12:55 +0300)]
liblzma: Add LZMA_FULL_BARRIER support to single-threaded encoder.

In the single-threaded encoder LZMA_FULL_BARRIER is simply
an alias for LZMA_FULL_FLUSH.

11 years agoliblzma: Add block_buffer_encoder.h into Makefile.inc.
Lasse Collin [Tue, 17 Sep 2013 08:57:51 +0000 (11:57 +0300)]
liblzma: Add block_buffer_encoder.h into Makefile.inc.

This should have been in b465da5988dd59ad98fda10c2e4ea13d0b9c73bc.

11 years agoxz: Add a missing test for TUKLIB_DOSLIKE.
Lasse Collin [Tue, 17 Sep 2013 08:55:38 +0000 (11:55 +0300)]
xz: Add a missing test for TUKLIB_DOSLIKE.

11 years agoAdd native threading support on Windows.
Lasse Collin [Tue, 17 Sep 2013 08:52:28 +0000 (11:52 +0300)]
Add native threading support on Windows.

Now liblzma only uses "mythread" functions and types
which are defined in mythread.h matching the desired
threading method.

Before Windows Vista, there is no direct equivalent to
pthread condition variables. Since this package doesn't
use pthread_cond_broadcast(), pre-Vista threading can
still be kept quite simple. The pre-Vista code doesn't
use anything that wasn't already available in Windows 95,
so the binaries should run even on Windows 95 if someone
happens to care.

11 years agoBuild: Remove a comment about Automake 1.10 from configure.ac.
Lasse Collin [Wed, 11 Sep 2013 11:40:35 +0000 (14:40 +0300)]
Build: Remove a comment about Automake 1.10 from configure.ac.

The previous commit supports silent rules and that requires
Automake 1.11.

11 years agoBuild: Create liblzma.pc in a src/liblzma/Makefile.am.
Lasse Collin [Mon, 9 Sep 2013 17:37:03 +0000 (20:37 +0300)]
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.

11 years agoFix the previous commit which broke the build.
Lasse Collin [Sun, 4 Aug 2013 12:24:09 +0000 (15:24 +0300)]
Fix the previous commit which broke the build.

Apparently I didn't even compile-test the previous commit.

Thanks to Christian Hesse.

11 years agoWindows: Add Windows support to tuklib_cpucores().
Lasse Collin [Sat, 3 Aug 2013 10:52:58 +0000 (13:52 +0300)]
Windows: Add Windows support to tuklib_cpucores().

It is used for Cygwin too. I'm not sure if that is
a good or bad idea.

Thanks to Vincent Torri.

11 years agomacosx: separate liblzma package
Anders F Bjorklund [Fri, 2 Aug 2013 13:59:46 +0000 (15:59 +0200)]
macosx: separate liblzma package

11 years agomacosx: set minimum to leopard
Anders F Bjorklund [Fri, 2 Aug 2013 13:58:44 +0000 (15:58 +0200)]
macosx: set minimum to leopard

11 years agomove configurables into variables
Anders F Bjorklund [Sun, 7 Aug 2011 11:13:30 +0000 (13:13 +0200)]
move configurables into variables

11 years agoUpdate THANKS.
Lasse Collin [Mon, 15 Jul 2013 11:08:41 +0000 (14:08 +0300)]
Update THANKS.

11 years agoBuild: Fix the detection of missing CRC32.
Lasse Collin [Mon, 15 Jul 2013 11:08:02 +0000 (14:08 +0300)]
Build: Fix the detection of missing CRC32.

Thanks to Vincent Torri.

11 years agoxz: Add preliminary support for --flush-timeout=TIMEOUT.
Lasse Collin [Thu, 4 Jul 2013 11:18:46 +0000 (14:18 +0300)]
xz: Add preliminary support for --flush-timeout=TIMEOUT.

When --flush-timeout=TIMEOUT is used, xz will use
LZMA_SYNC_FLUSH if read() would block and at least
TIMEOUT milliseconds has elapsed since the previous flush.

This can be useful in realtime-like use cases where the
data is simultanously decompressed by another process
(possibly on a different computer). If new uncompressed
input data is produced slowly, without this option xz could
buffer the data for a long time until it would become
decompressible from the output.

If TIMEOUT is 0, the feature is disabled. This is the default.

This commit affects the compression side. Using xz for
the decompression side for the above purpose doesn't work
yet so well because there is quite a bit of input and
output buffering when decompressing.

The --long-help or man page were not updated yet.
The details of this feature may change.

11 years agoxz: Don't set src_eof=true after an I/O error because it's useless.
Lasse Collin [Thu, 4 Jul 2013 10:41:03 +0000 (13:41 +0300)]
xz: Don't set src_eof=true after an I/O error because it's useless.

11 years agoxz: Fix the test when to read more input.
Lasse Collin [Thu, 4 Jul 2013 10:25:11 +0000 (13:25 +0300)]
xz: Fix the test when to read more input.

Testing for end of file was no longer correct after full flushing
became possible with --block-size=SIZE and --block-list=SIZES.
There was no bug in practice though because xz just made a few
unneeded zero-byte reads.

11 years agoxz: Move some of the timing code into mytime.[hc].
Lasse Collin [Thu, 4 Jul 2013 09:51:57 +0000 (12:51 +0300)]
xz: Move some of the timing code into mytime.[hc].

This switches units from microseconds to milliseconds.

New clock_gettime(CLOCK_MONOTONIC) will be used if available.
There is still a fallback to gettimeofday().

11 years agoUpdate THANKS.
Lasse Collin [Mon, 1 Jul 2013 11:35:03 +0000 (14:35 +0300)]
Update THANKS.

11 years agoxz: Silence a warning seen with _FORTIFY_SOURCE=2.
Lasse Collin [Mon, 1 Jul 2013 11:34:11 +0000 (14:34 +0300)]
xz: Silence a warning seen with _FORTIFY_SOURCE=2.

Thanks to Christian Hesse.

11 years agoUpdate NEWS for 5.0.5.
Lasse Collin [Sun, 30 Jun 2013 16:40:11 +0000 (19:40 +0300)]
Update NEWS for 5.0.5.

11 years agoMan pages: Use similar syntax for synopsis as in xz.
Lasse Collin [Sun, 30 Jun 2013 15:02:27 +0000 (18:02 +0300)]
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
eb6ca9854b8eb9fbf72497c1cf608d6b19d2d494. Eric S. Raymond
didn't mention these man pages in his bug report, but
it's nice to be consistent.

11 years agoxz: Use non-blocking I/O for the output file.
Lasse Collin [Sat, 29 Jun 2013 12:59:13 +0000 (15:59 +0300)]
xz: Use non-blocking I/O for the output file.

Now both reading and writing should be without
race conditions with signals.

They might still be signal handling issues left.
Signals are blocked during many operations to avoid
EINTR but it may cause problems e.g. if writing to
stderr blocks when trying to display an error message.

11 years agoxz: Fix return value type in io_write_buf().
Lasse Collin [Fri, 28 Jun 2013 20:56:17 +0000 (23:56 +0300)]
xz: Fix return value type in io_write_buf().

It didn't affect the behavior of the code since -1
becomes true anyway.

11 years agoxz: Use the self-pipe trick to avoid a race condition with signals.
Lasse Collin [Fri, 28 Jun 2013 20:48:05 +0000 (23:48 +0300)]
xz: Use the self-pipe trick to avoid a race condition with signals.

It is possible that a signal to set user_abort arrives right
before a blocking system call is made. In this case the call
may block until another signal arrives, while the wanted
behavior is to make xz clean up and exit as soon as possible.

After this commit, the race condition is avoided with the
input side which already uses non-blocking I/O. The output
side still uses blocking I/O and thus has the race condition.

11 years agoxz: Use non-blocking I/O for the input file.
Lasse Collin [Fri, 28 Jun 2013 19:51:02 +0000 (22:51 +0300)]
xz: Use non-blocking I/O for the input file.

11 years agoxz: Remove an outdated NetBSD-specific comment.
Lasse Collin [Fri, 28 Jun 2013 15:46:13 +0000 (18:46 +0300)]
xz: Remove an outdated NetBSD-specific comment.

Nowadays errno == EFTYPE is documented in open(2).

11 years agoxz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.
Lasse Collin [Fri, 28 Jun 2013 15:09:47 +0000 (18:09 +0300)]
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).

11 years agoxz: Fix use of wrong variable in a fcntl() call.
Lasse Collin [Fri, 28 Jun 2013 14:36:47 +0000 (17:36 +0300)]
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.

11 years agoxz: Fix assertion related to posix_fadvise().
Lasse Collin [Fri, 28 Jun 2013 11:55:37 +0000 (14:55 +0300)]
xz: Fix assertion related to posix_fadvise().

Input file can be a FIFO or something else that doesn't
support posix_fadvise() so don't check the return value
even with an assertion. Nothing bad happens if the call
to posix_fadvise() fails.

11 years agoxz: Check the value of lzma_stream_flags.version in --list.
Lasse Collin [Wed, 26 Jun 2013 10:30:57 +0000 (13:30 +0300)]
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.

11 years agoBuild: Require Automake 1.12 and use serial-tests option.
Lasse Collin [Wed, 26 Jun 2013 09:17:00 +0000 (12:17 +0300)]
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.

11 years agoUpdate THANKS.
Lasse Collin [Sun, 23 Jun 2013 15:59:13 +0000 (18:59 +0300)]
Update THANKS.

11 years agoliblzma: Avoid a warning about a shadowed variable.
Lasse Collin [Sun, 23 Jun 2013 15:57:23 +0000 (18:57 +0300)]
liblzma: Avoid a warning about a shadowed variable.

On Mac OS X wait() is declared in <sys/wait.h> that
we include one way or other so don't use "wait" as
a variable name.

Thanks to Christian Kujau.

11 years agoxz: Validate Uncompressed Size from Block Header in list.c.
Lasse Collin [Sun, 23 Jun 2013 14:36:47 +0000 (17:36 +0300)]
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.

11 years agoUpdate THANKS.
Lasse Collin [Fri, 21 Jun 2013 19:08:11 +0000 (22:08 +0300)]
Update THANKS.

11 years agoxz: Make the man page more friendly to doclifter.
Lasse Collin [Fri, 21 Jun 2013 19:04:45 +0000 (22:04 +0300)]
xz: Make the man page more friendly to doclifter.

Thanks to Eric S. Raymond.

11 years agoxz: A couple of man page fixes.
Lasse Collin [Fri, 21 Jun 2013 18:54:59 +0000 (21:54 +0300)]
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.

11 years agoxz: Fix interaction between preset and custom filter chains.
Lasse Collin [Fri, 21 Jun 2013 18:50:26 +0000 (21:50 +0300)]
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.

11 years agoBuild: Use -Wvla with GCC if supported.
Lasse Collin [Sat, 27 Apr 2013 19:07:46 +0000 (22:07 +0300)]
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.

11 years agoxzdec: Improve the --help message.
Lasse Collin [Mon, 15 Apr 2013 16:29:09 +0000 (19:29 +0300)]
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.

11 years agoUpdate THANKS.
Lasse Collin [Fri, 5 Apr 2013 16:25:40 +0000 (19:25 +0300)]
Update THANKS.

11 years agoxzgrep: make the '-h' option to be --no-filename equivalent
Jeff Bastian [Wed, 3 Apr 2013 11:59:17 +0000 (13:59 +0200)]
xzgrep: make the '-h' option to be --no-filename equivalent

* src/scripts/xzgrep.in: Accept the '-h' option in argument parsing.

11 years agoliblzma: Be less picky in lzma_alone_decoder().
Lasse Collin [Sat, 23 Mar 2013 20:25:15 +0000 (22:25 +0200)]
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

11 years agoliblzma: Use lzma_block_buffer_bound64() in threaded encoder.
Lasse Collin [Sat, 23 Mar 2013 19:55:13 +0000 (21:55 +0200)]
liblzma: Use lzma_block_buffer_bound64() in threaded encoder.

Now it uses lzma_block_uncomp_encode() if the data doesn't
fit into the space calculated by lzma_block_buffer_bound64().

11 years agoliblzma: Fix another deadlock in the threaded encoder.
Lasse Collin [Sat, 23 Mar 2013 19:51:38 +0000 (21:51 +0200)]
liblzma: Fix another deadlock in the threaded encoder.

This race condition could cause a deadlock if lzma_end() was
called before finishing the encoding. This can happen with
xz with debugging enabled (non-debugging version doesn't
call lzma_end() before exiting).

11 years agoliblzma: Add lzma_block_uncomp_encode().
Lasse Collin [Sat, 23 Mar 2013 17:17:33 +0000 (19:17 +0200)]
liblzma: Add lzma_block_uncomp_encode().

This also adds a new internal function
lzma_block_buffer_bound64() which is similar to
lzma_block_buffer_bound() but uses uint64_t instead
of size_t.

11 years agoAvoid unneeded use of awk in xzless.
Lasse Collin [Tue, 5 Mar 2013 17:14:50 +0000 (19:14 +0200)]
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 db5c1817fabf7cbb9e4087b1576eb26f0747338e.

Thanks to Ariel P for the patch.

12 years agoMake the progress indicator smooth in threaded mode.
Lasse Collin [Fri, 14 Dec 2012 18:13:32 +0000 (20:13 +0200)]
Make the progress indicator smooth in threaded mode.

This adds lzma_get_progress() to liblzma and takes advantage
of it in xz.

lzma_get_progress() collects progress information from
the thread-specific structures so that fairly accurate
progress information is available to applications. Adding
a new function seemed to be a better way than making the
information directly available in lzma_stream (like total_in
and total_out are) because collecting the information requires
locking mutexes. It's waste of time to do it more often than
the up to date information is actually needed by an application.

12 years agoliblzma: Fix mythread_sync for nested locking.
Lasse Collin [Fri, 14 Dec 2012 09:01:41 +0000 (11:01 +0200)]
liblzma: Fix mythread_sync for nested locking.

12 years agoxz: Mention --threads in --help.
Lasse Collin [Thu, 13 Dec 2012 19:05:36 +0000 (21:05 +0200)]
xz: Mention --threads in --help.

Thanks to Olivier Delhomme for pointing out that this
was still missing.

12 years agoxzless: Make "less -V" parsing more robust
Jonathan Nieder [Mon, 19 Nov 2012 08:10:10 +0000 (00:10 -0800)]
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>
12 years agoxz: Fix the note about --rsyncable on the man page.
Lasse Collin [Wed, 3 Oct 2012 12:54:24 +0000 (15:54 +0300)]
xz: Fix the note about --rsyncable on the man page.