platform/upstream/xz.git
6 years agoapply ASLR options 89/143789/1 accepted/tizen_4.0_base tizen_4.0_base tizen_4.0_tv accepted/tizen/4.0/base/20170828.221358 accepted/tizen/base/20170814.055838 submit/tizen_4.0_base/20170828.000000 submit/tizen_4.0_base/20170828.000001 submit/tizen_base/20170811.105929 tizen_4.0.IoT.p1_release tizen_4.0.IoT.p2_release tizen_4.0.m2_release
MyoungJune Park [Fri, 11 Aug 2017 08:48:48 +0000 (17:48 +0900)]
apply ASLR options

Change-Id: Ieed346c6d5dcdf8b373f80a269cb307f4701817a
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
7 years agoAdd license file 26/122326/1 accepted/tizen/4.0/base/20170811.093055 accepted/tizen/base/20170331.130520 submit/tizen_4.0_base/20170811.071500 submit/tizen_base/20170331.065817 tizen_4.0.m1_release
DongHun Kwak [Fri, 31 Mar 2017 05:25:29 +0000 (14:25 +0900)]
Add license file

 - Add license file all packages
[Model] ALL
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] license file does not exist at package
[Cause & Measure] add license file at each package
[Checking Method] N/A

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: I81ff19b36492faa4af20d28827b2569b1c510511
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agofix error by [-Werror=coverage-mismatch] 68/113068/1 accepted/tizen/base/20170217.190119 submit/tizen_base/20170210.043124
Dongkyun, Son [Tue, 1 Nov 2016 10:43:35 +0000 (19:43 +0900)]
fix error by [-Werror=coverage-mismatch]

conftest.c: In function 'main':
conftest.c:46:1: error: the control flow of function 'main' does not
match its profile data (counter 'arcs') [-Werror=coverage-mismatch]

-Wno-coverage-mismatch
Warn if feedback profiles do not match when using the -fprofile-use
option. If a source file is changed between compiling with -fprofile-gen
and with -fprofile-use, the files with the profile feedback can fail to
match the source file and GCC cannot use the profile feedback
information. By default, this warning is enabled and is treated as an
error. -Wno-coverage-mismatch can be used to disable the warning or
-Wno-error=coverage-mismatch can be used to disable the error. Disabling
the error for this warning can result in poorly optimized code and is
useful only in the case of very minor changes such as bug fixes to an
existing code-base. Completely disabling the warning is not recommended.

Change-Id: I7b48d8c3d3a05a5c4c83a8d32f4304a0797af2c2
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
7 years agoBump to xz 5.2.2 #2 88/102588/1 accepted/tizen/3.0/base/20170106.094451 accepted/tizen/base/20161209.100251 submit/tizen_3.0_base/20170105.045531 submit/tizen_base/20161206.070730
DongHun Kwak [Tue, 6 Dec 2016 06:53:37 +0000 (15:53 +0900)]
Bump to xz 5.2.2 #2

[Model] ALL
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] liblzma.h invalid merging
[Cause & Measure] fix merge
[Checking Method] N/A

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: I1bd84e6ab5710ae8967c7ae9339a921ac478bc32
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoBump to xz 5.2.2 31/97431/1
DongHun Kwak [Mon, 14 Nov 2016 07:14:01 +0000 (16:14 +0900)]
Bump to xz 5.2.2

[Model] ALL
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] Bump to xz 5.2.2
[Cause & Measure] Bump to xz 5.2.2
[Checking Method] N/A

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: Ie40a3a5a48c6f2bd705561f972115de9fc9adaff
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoRebase for xz 5.2.2 30/97430/1
Lasse Collin [Sun, 9 Dec 2007 09:03:28 +0000 (11:03 +0200)]
Rebase for xz 5.2.2

Change-Id: I3d9f34900241151c216b57bba68052c2dd293a03
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.2.2 64/90064/1 upstream/5.2.2
DongHun Kwak [Wed, 28 Sep 2016 07:11:03 +0000 (16:11 +0900)]
Imported Upstream version 5.2.2

Change-Id: I88a4923ca5d7e7376cdf28e5b50ec629bebc7e6e
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.2.1 63/90063/1 upstream/5.2.1
DongHun Kwak [Wed, 28 Sep 2016 07:10:54 +0000 (16:10 +0900)]
Imported Upstream version 5.2.1

Change-Id: Ib9a5b6f2b2169823ee4154e5bac32dca1711c7f5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.2.0 62/90062/1 upstream/5.2.0
DongHun Kwak [Wed, 28 Sep 2016 07:10:38 +0000 (16:10 +0900)]
Imported Upstream version 5.2.0

Change-Id: I8ba25644e4924c6481ef136bb40b087aef258c90
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.0.8 61/90061/1 upstream/5.0.8
DongHun Kwak [Wed, 28 Sep 2016 07:10:15 +0000 (16:10 +0900)]
Imported Upstream version 5.0.8

Change-Id: I35401a73fbf62236e0dbaeed21ee8596e186eca5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.0.7 60/90060/1 upstream/5.0.7
DongHun Kwak [Wed, 28 Sep 2016 07:09:58 +0000 (16:09 +0900)]
Imported Upstream version 5.0.7

Change-Id: I69ed1329569e6445c0f418dad1a6f5b30a271204
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.0.6 59/90059/1 upstream/5.0.6
DongHun Kwak [Wed, 28 Sep 2016 07:09:41 +0000 (16:09 +0900)]
Imported Upstream version 5.0.6

Change-Id: I3397dc23ca85461efb248651e2e61103b5c74bab
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.0.5 58/90058/1 upstream/5.0.5
DongHun Kwak [Wed, 28 Sep 2016 07:09:25 +0000 (16:09 +0900)]
Imported Upstream version 5.0.5

Change-Id: I59da8ecd5b96e30004e93969fd82bd0bfe69162b
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoImported Upstream version 5.0.4 57/90057/1 upstream/5.0.4
DongHun Kwak [Wed, 28 Sep 2016 07:09:07 +0000 (16:09 +0900)]
Imported Upstream version 5.0.4

Change-Id: I282c2dd20ebb91b2ae626ca1071c18561f2238f8
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
7 years agoAdd define PTHREAD_LIBS environment variable 25/87425/2 accepted/tizen_3.0.m2_base tizen_3.0.m2_base accepted/tizen/3.0.m2/base/20170104.082120 accepted/tizen/3.0/base/20161028.103429 accepted/tizen/base/20160923.170233 submit/tizen_3.0.m2_base/20170104.073748 submit/tizen_3.0_base/20161028.062326 submit/tizen_base/20160909.043919
DongHun Kwak [Thu, 8 Sep 2016 02:44:45 +0000 (11:44 +0900)]
Add define PTHREAD_LIBS environment variable

[Model] ALL
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] Build break at Address Sanitizer testing
[Cause & Measure] Add define PTHREAD_LIBS environment variable
[Checking Method] N/A

[Team] Open Source Management and Setting Part
[Developer] dh0128.kwak
[Solution company] Samsung
[Change Type] N/A

Change-Id: I02ad342a0852ea274b9918f7840a58697e6eea50
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
8 years agoFixed license declaration at spec file 31/55631/1 accepted/tizen/base/20160324.155330 submit/tizen_base/20160322.013753
DongHun Kwak [Thu, 24 Dec 2015 01:35:00 +0000 (10:35 +0900)]
Fixed license declaration at spec file

Change-Id: Id0bfb6e80b8cc02fe21b71d6e83e34640bafe818
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
9 years agoBump to version 5.1.3 accepted/tizen_3.0_ivi accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable sandbox/kevinthierry/bump-5.1.3 tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_3.0.m1_mobile tizen_3.0.m1_tv tizen_3.0_ivi accepted/tizen/base/20151223.052351 accepted/tizen/common/20150107.100711 accepted/tizen/ivi/20150114.121604 accepted/tizen/mobile/20150129.040547 accepted/tizen/tv/20150324.014633 accepted/tizen/wearable/20150129.005549 submit/tizen_base/20151223.111112 submit/tizen_common/20150106.091514 submit/tizen_common/20151015.190624 submit/tizen_common/20151019.135620 submit/tizen_ivi/20150112.222222 submit/tizen_mobile/20150128.000000 submit/tizen_tv/20150130.050505 submit/tizen_tv/20150320.000000 submit/tizen_tv/20150323.000000 submit/tizen_wearable/20150127.000002 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release tizen_3.0_ivi_release
Kévin THIERRY [Fri, 31 Oct 2014 10:28:30 +0000 (11:28 +0100)]
Bump to version 5.1.3

Use source from upstream git repo instead of pristin-tar.

Also update spec file.

Bug-Tizen: TC-1880
Change-Id: I853213b13e5c144f04e4caa83843a583252a28f1
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
9 years agoresetting manifest requested domain to floor
Alexandru Cornea [Sat, 29 Jun 2013 03:47:34 +0000 (06:47 +0300)]
resetting manifest requested domain to floor

9 years agoFixed package group
Anas Nashif [Mon, 18 Mar 2013 19:57:32 +0000 (12:57 -0700)]
Fixed package group

9 years agoFixed package group
Anas Nashif [Mon, 18 Mar 2013 16:34:02 +0000 (09:34 -0700)]
Fixed package group

9 years agofixed baselibs.conf
Anas Nashif [Sat, 17 Nov 2012 00:47:41 +0000 (16:47 -0800)]
fixed baselibs.conf

9 years agoadd packaging
Anas Nashif [Wed, 7 Nov 2012 05:11:17 +0000 (21:11 -0800)]
add packaging

9 years agoadd packaging
Anas Nashif [Wed, 7 Nov 2012 05:10:46 +0000 (21:10 -0800)]
add packaging

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

10 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.

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

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

10 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.

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

10 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

10 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.

11 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.

11 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.

11 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.

11 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>
11 years agoImported Upstream version 5.0.3 upstream/5.0.3
Anas Nashif [Wed, 7 Nov 2012 05:10:45 +0000 (21:10 -0800)]
Imported Upstream version 5.0.3

11 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.

11 years agoxz: Improve handling of failed realloc in xrealloc.
Lasse Collin [Fri, 28 Sep 2012 17:11:09 +0000 (20:11 +0300)]
xz: Improve handling of failed realloc in xrealloc.

Thanks to Jim Meyering.

11 years agoA few typo fixes to comments and the xz man page.
Lasse Collin [Fri, 24 Aug 2012 13:27:31 +0000 (16:27 +0300)]
A few typo fixes to comments and the xz man page.

Thanks to Jim Meyering.

11 years agoxz: Add a warning to --help about alpha and beta versions.
Lasse Collin [Mon, 13 Aug 2012 18:40:09 +0000 (21:40 +0300)]
xz: Add a warning to --help about alpha and beta versions.

11 years agoBuild: Bump gettext version requirement to 0.18.
Lasse Collin [Thu, 2 Aug 2012 14:13:30 +0000 (17:13 +0300)]
Build: Bump gettext version requirement to 0.18.

Otherwise too old version of m4/lib-link.m4 gets included
when autoreconf -fi is run.

12 years agoUpdate THANKS.
Lasse Collin [Tue, 17 Jul 2012 15:29:08 +0000 (18:29 +0300)]
Update THANKS.

12 years agoliblzma: Make the use of lzma_allocator const-correct.
Lasse Collin [Tue, 17 Jul 2012 15:19:59 +0000 (18:19 +0300)]
liblzma: Make the use of lzma_allocator const-correct.

There is a tiny risk of causing breakage: If an application
assigns lzma_stream.allocator to a non-const pointer, such
code won't compile anymore. I don't know why anyone would do
such a thing though, so in practice this shouldn't cause trouble.

Thanks to Jan Kratochvil for the patch.

12 years agoTests: Remove tests/test_block.c that had gotten committed accidentally.
Lasse Collin [Thu, 5 Jul 2012 04:36:28 +0000 (07:36 +0300)]
Tests: Remove tests/test_block.c that had gotten committed accidentally.

12 years agoBuild: Include macosx/build.sh in the distribution.
Lasse Collin [Thu, 5 Jul 2012 04:33:35 +0000 (07:33 +0300)]
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. :-(

12 years agoBuild: Include validate_map.sh in the distribution.
Lasse Collin [Thu, 5 Jul 2012 04:28:53 +0000 (07:28 +0300)]
Build: Include validate_map.sh in the distribution.

It's required by "make mydist".

Fix also the location of EXTRA_DIST+= so that those files
get distributed also if symbol versioning isn't enabled.

12 years agoDocs: Fix the name LZMA Utils -> XZ Utils in debug/README.
Lasse Collin [Thu, 5 Jul 2012 04:24:45 +0000 (07:24 +0300)]
Docs: Fix the name LZMA Utils -> XZ Utils in debug/README.

12 years agoInclude debug/translation.bash in the distribution.
Lasse Collin [Thu, 5 Jul 2012 04:23:17 +0000 (07:23 +0300)]
Include debug/translation.bash in the distribution.

Also fix the script name mentioned in README.

12 years agoxz: Document --block-list better.
Lasse Collin [Wed, 4 Jul 2012 19:31:58 +0000 (22:31 +0300)]
xz: Document --block-list better.

Thanks to Jonathan Nieder.

12 years agoBump the version number to 5.1.2alpha.
Lasse Collin [Wed, 4 Jul 2012 17:01:49 +0000 (20:01 +0300)]
Bump the version number to 5.1.2alpha.

12 years agoUpdate NEWS for 5.1.2alpha.
Lasse Collin [Wed, 4 Jul 2012 17:01:19 +0000 (20:01 +0300)]
Update NEWS for 5.1.2alpha.

12 years agoxz: Fix the version number printed by xz -lvv.
Lasse Collin [Wed, 4 Jul 2012 16:58:23 +0000 (19:58 +0300)]
xz: Fix the version number printed by xz -lvv.

The decoder bug was fixed in 5.0.2 instead of 5.0.3.

12 years agoBuild: Add a comment to configure.ac about symbol versioning.
Lasse Collin [Wed, 4 Jul 2012 14:11:31 +0000 (17:11 +0300)]
Build: Add a comment to configure.ac about symbol versioning.

12 years agoUpdate TODO.
Lasse Collin [Wed, 4 Jul 2012 14:06:49 +0000 (17:06 +0300)]
Update TODO.