Compare commits

..

14 Commits

Author SHA1 Message Date
Jia Tan 07779fa4e2 Tests: Add new test for xz -r, --recursive option. 2024-01-29 21:50:14 +08:00
Jia Tan 7ca735f2f0 xz: Update the man page for the -r, --recursive option. 2024-01-29 21:50:08 +08:00
Jia Tan e43178da0e xz: Add -r,--recursive to --help and --long-help. 2024-01-29 21:40:53 +08:00
Jia Tan 6b4b815b94 xz: Disable sandbox when recursive mode is used.
The sandbox is very restrictive when one file is being encoded/decoded
to standard out. In recursive mode, processing a directory requires
opening sub-files and sub-directories which would not be allowed under
the sandbox.
2024-01-29 21:40:53 +08:00
Jia Tan 340505c033 xz: Hide the number of input files with recursive mode.
In recursive mode we don't know how many files to process at the
beginning. So just like when using --files or --files0, the number of
total files will not be shown.
2024-01-29 21:40:53 +08:00
Jia Tan 9ffdb5f006 xz: Parse directories in recursive mode.
This directory parsing method prioritizes lower memory usage and file
descriptor utilization at the cost of more complicated code and a higher
number of small allocations. This method makes no recursive calls and
instead keeps a queue of directories to parse.Only one directory file
descriptor is ever needed at one time.

The directory_iterator abstracts the implementation of the directory
parsing to allow for an easy interface for both POSIX and MSVC.

Currently the MSVC builds suffers from MAX_PATH being limited to 260 by
default. This restricts the usefulness of recursive mode on Windows. A
user can edit a registry config in Windows 10, Version 1607 and later to
remove this low path limit. Alternatively, we can prefix the absolute
path with "\\?\" to also remove the restriction. Note, this restriction
also applies to the compatibility functions so MSVC builds cannot read
or write to files with paths longer than 260 characters.
2024-01-29 21:40:53 +08:00
Jia Tan f8c199bcdc xz: Restrict when recursive mode can be used.
If we are not compiling with dirent.h or MSVC, then we cannot use
recursive mode. Unfortunatly, there is not a great portable way to parse
directory contents.

There are _find_next() functions available for DOS like platforms, but
Windows version of these functions is different. Since we do not have a
good way to test these functions, support will not be added at this
time.
2024-01-29 21:40:53 +08:00
Jia Tan fe1af552d3 xz: Allow directories in io_open_src() in recursive mode.
If the directory is a symlink, it is skipped to prevent a loop in the
directory structure that would cause infinite recursion.
2024-01-29 21:40:53 +08:00
Jia Tan e08d65acaf Build: Check for dirent.h.
For both CMake and Autotools, define HAVE_DIRENT_H if the header file
is found.
2024-01-29 21:40:53 +08:00
Jia Tan 8d07e9bb7c xz: Enable -r, --recursive option. 2024-01-29 21:40:53 +08:00
Jia Tan b10b2e4a8f xz: Change the way coder_run() and list_run() are called in main().
Previously, a function pointer was used to determine if coder_run() or
list_run() should be called in the main entry processing loop. This was
replaced by an extra function call to process_entry().

coder_run() and list_run() were changed to accept a file_pair * argument
instead of a filename. The common repeated code was moved to
process_entry() instead.
2024-01-29 21:40:53 +08:00
Jia Tan a3bac71fe3 xz: Reorder #include order in private.h. 2024-01-29 21:40:53 +08:00
Jia Tan 882aad963e xz: Move some list_file() checks to args_parse().
The checks enforce that list mode will only run on .xz files. The
opt_format is only set during argument parsing and will not change
after. So we only need to check this once instead of every call to
list_file(). Additionally, this will cause the error to be detected
slightly earlier.
2024-01-29 21:40:53 +08:00
Jia Tan d6d1e40f19 xz: Add a function to print Windows specific error messages.
Native Windows C API functions do not use errno, but instead have to
call GetLastError(). There is not an easy way to convert this error
code into a helpful message, so this creates a wrapper around the
slightly complicated FormatMessage() function.

The new message_windows_error() function calls message_error() under the
hood, so it will set the exit status to 1.
2024-01-29 21:40:53 +08:00
378 changed files with 14110 additions and 22285 deletions

8
.github/SECURITY.md vendored
View File

@ -16,7 +16,13 @@ the chance that the exploit will be used before a patch is released.
You may submit a report by emailing us at
[xz@tukaani.org](mailto:xz@tukaani.org), or through
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
While both options are available, we prefer email.
While both options are available, we prefer email. In any case, please
provide a clear description of the vulnerability including:
- Affected versions of XZ Utils
- Estimated severity (low, moderate, high, critical)
- Steps to recreate the vulnerability
- All relevant files (core dumps, build logs, input files, etc.)
This project is maintained by a team of volunteers on a reasonable-effort
basis. As such, please give us 90 days to work on a fix before

View File

@ -1,9 +1,10 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
name: CI

View File

@ -1,9 +1,10 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
name: Windows-CI

1
.gitignore vendored
View File

@ -67,7 +67,6 @@ coverage
/tests/test_index
/tests/test_index_hash
/tests/test_lzip_decoder
/tests/test_microlzma
/tests/test_memlimit
/tests/test_stream_flags
/tests/test_vli

40
AUTHORS
View File

@ -9,13 +9,15 @@ Authors of XZ Utils
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
this code, XZ Utils wouldn't exist.
The SHA-256 implementation in liblzma is based on code written by
Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
The SHA-256 implementation in liblzma is based on the code found from
7-Zip <https://7-zip.org/>, which has a modified version of the SHA-256
code found from Crypto++ <https://www.cryptopp.com/>. The SHA-256 code
in Crypto++ was written by Kevin Springle and Wei Dai.
A few scripts have been adapted from GNU gzip. The original
versions were written by Jean-loup Gailly, Charles Levert, and
Paul Eggert. Andrew Dudman helped adapting the scripts and their
man pages for XZ Utils.
Some scripts have been adapted from gzip. The original versions
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
Andrew Dudman helped adapting the scripts and their man pages for
XZ Utils.
The initial version of the threaded .xz decompressor was written
by Sebastian Andrzej Siewior.
@ -23,31 +25,15 @@ Authors of XZ Utils
The initial version of the .lz (lzip) decoder was written
by Michał Górny.
Architecture-specific CRC optimizations were contributed by
Ilya Kurdyukov, Hans Jansen, and Chenxi Mao.
CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov.
Other authors:
- Jonathan Nieder
- Joachim Henke
Many people have contributed improvements or reported bugs.
Most of these people are mentioned in the file THANKS.
The GNU Autotools-based build system contains files from many authors,
which I'm not trying to list here.
The translations of the command line tools and man pages have been
contributed by many people via the Translation Project:
- https://translationproject.org/domain/xz.html
- https://translationproject.org/domain/xz-man.html
The authors of the translated man pages are in the header comments
of the man page files. In the source package, the authors of the
translations are in po/*.po and po4a/*.po files.
Third-party code whose authors aren't listed here:
- GNU getopt_long() in the 'lib' directory is included for
platforms that don't have a usable getopt_long().
- The build system files from GNU Autoconf, GNU Automake,
GNU Libtool, GNU Gettext, Autoconf Archive, and related files.
Several people have contributed fixes or reported bugs. Most of them
are mentioned in the file THANKS.

File diff suppressed because it is too large Load Diff

108
COPYING
View File

@ -6,95 +6,77 @@ XZ Utils Licensing
is a rough summary of which licenses apply to which parts of this
package (but check the individual files to be sure!):
- liblzma is under the BSD Zero Clause License (0BSD).
- liblzma is in the public domain.
- The command line tools xz, xzdec, lzmadec, and lzmainfo are
under 0BSD except that, on systems that don't have a usable
getopt_long, GNU getopt_long is compiled and linked in from the
'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
- xz, xzdec, and lzmadec command line tools are in the public
domain unless GNU getopt_long had to be compiled and linked
in from the lib directory. The getopt_long code is under
GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been
adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
and xzmore) are under GNU GPLv2+. The man pages of the scripts
are under 0BSD; they aren't based on the man pages of GNU gzip.
adapted from gzip. These scripts and their documentation are
under GNU GPLv2+.
- Most of the XZ Utils specific documentation that is in
plain text files (like README, INSTALL, PACKAGERS, NEWS,
and ChangeLog) are under 0BSD unless stated otherwise in
the file itself. The files xz-file-format.txt and
lzma-file-format.xt are in the public domain but may
be distributed under the terms of 0BSD too.
- Doxygen-generated HTML version of the liblzma API documentation:
While Doxygen is under the GNU GPLv2, the license information
in Doxygen includes the following exception:
Documents produced by doxygen are derivative works
derived from the input used in their production;
they are not affected by this license.
- All the documentation in the doc directory and most of the
XZ Utils specific documentation files in other directories
are in the public domain.
Note: The JavaScript files (under the MIT license) have
been removed from the Doxygen output.
been removed from the Doxygen-generated HTML version of the
liblzma API documentation. Doxygen itself is under the GNU GPL
but the remaining files generated by Doxygen are not affected
by the licenses used in Doxygen because Doxygen licensing has
the following exception:
- The XZ logo (xz-logo.png) included in the Doxygen-generated
documentation is under the Creative Commons BY-SA 4.0 license.
"Documents produced by doxygen are derivative works
derived from the input used in their production;
they are not affected by this license."
- Translated messages and man pages are under 0BSD except that
some old translations are in the public domain.
- The XZ logo included in the Doxygen documentation is under
the Creative Commons BY-SA 4.0 license.
- Test files and test code in the 'tests' directory, and
debugging utilities in the 'debug' directory are under
the BSD Zero Clause License (0BSD).
- Translated messages are in the public domain.
- The GNU Autotools based build system contains files that are
under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses.
These files don't affect the licensing of the binaries being
built.
- The build system contains public domain files, and files that
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
in the binaries being built.
- The extra directory contain files that are under various
free software licenses.
- Test files and test code in the tests directory, and debugging
utilities in the debug directory are in the public domain.
For the files under the BSD Zero Clause License (0BSD), if
a copyright notice is needed, the following is sufficient:
- The extra directory may contain public domain files, and files
that are under various free software licenses.
Copyright (C) The XZ Utils authors and contributors
You can do whatever you want with the files that have been put into
the public domain. If you find public domain legally problematic,
take the previous sentence as a license grant. If you still find
the lack of copyright legally problematic, you have too many
lawyers.
If you copy significant amounts of 0BSD-licensed code from XZ Utils
As usual, this software is provided "as is", without any warranty.
If you copy significant amounts of public domain code from XZ Utils
into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but
it is not legally required by the license terms. Here is an example
of a good notice to put into "about box" or into documentation:
naturally it is not legally required. Here is an example of a good
notice to put into "about box" or into documentation:
This software includes code from XZ Utils
<https://xz.tukaani.org/xz-utils/>.
The following license texts are included in the following files:
- COPYING.0BSD: BSD Zero Clause License
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
International Public License
A note about old XZ Utils releases:
Note that the toolchain (compiler, linker etc.) may add some code
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
binary wouldn't actually be in the public domain in its entirety
even though it contains no copyrighted code from the XZ Utils source
package.
XZ Utils releases 5.4.6 and older and 5.5.1alpha have a
significant amount of code put into the public domain and
that obviously remains so. The switch from public domain to
0BSD for newer releases was made in Febrary 2024 because
public domain has (real or perceived) legal ambiguities in
some jurisdictions.
There is very little *practical* difference between public
domain and 0BSD. The main difference likely is that one
shouldn't claim that 0BSD-licensed code is in the public
domain; 0BSD-licensed code is copyrighted but available under
an extremely permissive license. Neither 0BSD nor public domain
require retaining or reproducing author, copyright holder, or
license notices when distributing the software. (Compare to,
for example, BSD 2-Clause "Simplified" License which does have
such requirements.)
If you have questions, don't hesitate to ask for more information.
The contact information is in the README file.
If you have questions, don't hesitate to ask the author(s) for more
information.

View File

@ -1,11 +0,0 @@
Permission to use, copy, modify, and/or distribute this
software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

125
INSTALL
View File

@ -143,37 +143,43 @@ XZ Utils Installation
1.2.7. Windows
The "windows" directory contains instructions for a few types
of builds:
If it is enough to build liblzma (no command line tools):
- INSTALL-MinGW-w64_with_CMake.txt
Simple instructions how to build XZ Utils natively on
Windows using only CMake and a prebuilt toolchain
(GCC + MinGW-w64 or Clang/LLVM + MinGW-w64).
- There is CMake support. It should be good enough to build
static liblzma or liblzma.dll with Visual Studio. The CMake
support may work with MinGW or MinGW-w64. Read the comment
in the beginning of CMakeLists.txt before running CMake!
- INSTALL-MinGW-w64_with_Autotools.txt
Native build under MSYS2 or cross-compilation from
GNU/Linux using a bash script that creates a .zip
and .7z archives of the binaries and documentation.
The related file README-Windows.txt is for the
resulting binary package.
- There are Visual Studio project files under the "windows"
directory. See windows/INSTALL-MSVC.txt. In the future the
project files will be removed when CMake support is good
enough. Thus, please test the CMake version and help fix
possible issues.
- INSTALL-MSVC.txt
Building with MSVC / Visual Studio and CMake.
To build also the command line tools:
- liblzma-crt-mixing.txt
Documentation what to take into account as a programmer
if liblzma.dll and the application don't use the same
CRT (MSVCRT or UCRT).
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
for building the official binary packages for Windows.
There is windows/build.bash to ease packaging XZ Utils with
MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
See windows/INSTALL-MinGW.txt for more information.
Other choices:
- MinGW + MSYS (32-bit x86): I haven't recently tested this.
- Cygwin: https://cygwin.com/
Building on Cygwin can be done like on many POSIX operating
systems. XZ Utils >= 5.2.0 isn't compatible with Cygwin older
than 1.7.35 (data loss!). 1.7.35 was released on 2015-03-04.
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
you must use an old Cygwin version, stick to XZ Utils 5.0.x
which is safe under older Cygwin versions. You can check
the Cygwin version with the command "cygcheck -V".
- MSYS2: https://www.msys2.org/
It may be possible to build liblzma with other toolchains too, but
that will probably require writing a separate makefile. Building
the command line tools with non-GNU toolchains will be harder than
building only liblzma.
Even if liblzma is built with MinGW(-w64), the resulting DLL can
be used by other compilers and linkers, including MSVC. See
windows/README-Windows.txt for details.
1.2.8. DOS
@ -353,20 +359,20 @@ XZ Utils Installation
with --docdir=DIR.
--disable-assembler
This disables CRC32 and CRC64 assembly code on
32-bit x86. This option currently does nothing
on other architectures (not even on x86-64).
liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for
32-bit x86.
The 32-bit x86 assembly is position-independent code
which is suitable for use in shared libraries and
position-independent executables. It uses only i386
instructions but the code is optimized for i686 class
CPUs. If you are compiling liblzma exclusively for
All the assembler code in liblzma is position-independent
code, which is suitable for use in shared libraries and
position-independent executables. So far only i386
instructions are used, but the code is optimized for i686
class CPUs. If you are compiling liblzma exclusively for
pre-i686 systems, you may want to disable the assembler
code.
--disable-clmul-crc
Disable the use of carryless multiplication for CRC
Disable the use carryless multiplication for CRC
calculation even if compiler support for it is detected.
The code uses runtime detection of SSSE3, SSE4.1, and
CLMUL instructions on x86. On 32-bit x86 this currently
@ -377,16 +383,6 @@ XZ Utils Installation
required extensions (-msse4.1 -mpclmul) then runtime
detection isn't used and the generic code is omitted.
--disable-arm64-crc32
Disable the use of the ARM64 CRC32 instruction extension
even if compiler support for it is detected. The code will
detect support for the instruction at runtime.
If using compiler options that unconditionally allow the
required extensions (-march=armv8-a+crc or -march=armv8.1-a
and later) then runtime detection isn't used and the
generic code is omitted.
--enable-unaligned-access
Allow liblzma to use unaligned memory access for 16-bit,
32-bit, and 64-bit loads and stores. This should be
@ -561,45 +557,10 @@ XZ Utils Installation
sandboxing. If no Landlock support
is found, configure will give an error.
--enable-symbol-versions[=VARIANT]
Use symbol versioning for liblzma shared library.
This is enabled by default on GNU/Linux (glibc only),
other GNU-based systems, and FreeBSD.
Symbol versioning is never used for static liblzma. This
option is ignored when not building a shared library.
Supported VARIANTs:
no Disable symbol versioning. This is the
same as using --disable-symbol-versions.
auto Autodetect between "no", "linux",
and "generic".
yes Autodetect between "linux" and
"generic". This forces symbol
versioning to be used when
building a shared library.
generic Generic version is the default for
FreeBSD and GNU/Linux on MicroBlaze.
This is also used on GNU/Linux when
building with NVIDIA HPC Compiler
because the compiler doesn't support
the features required for the "linux"
variant below.
linux Special version for GNU/Linux (glibc
only). This adds a few extra symbol
versions for compatibility with binaries
that have been linked against a liblzma
version that has been patched with
"xz-5.2.2-compat-libs.patch" from
RHEL/CentOS 7. That patch was used
by some build tools outside of
RHEL/CentOS 7 too.
--enable-symbol-versions
Use symbol versioning for liblzma. This is enabled by
default on GNU/Linux, other GNU-based systems, and
FreeBSD.
--enable-debug
This enables the assert() macro and possibly some other

View File

@ -1,5 +1,9 @@
## SPDX-License-Identifier: 0BSD
##
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
GZIP_ENV = -9n
@ -17,11 +21,11 @@ if COND_DOC
dist_doc_DATA = \
AUTHORS \
COPYING \
COPYING.0BSD \
COPYING.GPLv2 \
NEWS \
README \
THANKS \
TODO \
doc/faq.txt \
doc/history.txt \
doc/xz-file-format.txt \
@ -34,9 +38,13 @@ dist_examples_DATA = \
doc/examples/02_decompress.c \
doc/examples/03_compress_custom.c \
doc/examples/04_compress_easy_mt.c \
doc/examples/11_file_info.c \
doc/examples/Makefile
examplesolddir = $(docdir)/examples_old
dist_examplesold_DATA = \
doc/examples_old/xz_pipe_comp.c \
doc/examples_old/xz_pipe_decomp.c
# Install the Doxygen generated documentation if they were built.
install-data-local:
if test -d "$(srcdir)/doc/api" ; then \
@ -51,25 +59,24 @@ uninstall-local:
endif
EXTRA_DIST = \
cmake \
po4a \
extra \
doc/xz-logo.png \
dos \
doxygen \
extra \
po4a \
windows \
macosx \
cmake \
CMakeLists.txt \
autogen.sh \
COPYING.CC-BY-SA-4.0 \
COPYING.GPLv2 \
COPYING.GPLv3 \
COPYING.LGPLv2.1 \
INSTALL.generic \
PACKAGERS \
TODO \
autogen.sh \
build-aux/manconv.sh \
build-aux/version.sh \
doc/xz-logo.png \
po/xz.pot-header
build-aux/version.sh
ACLOCAL_AMFLAGS = -I m4
@ -88,7 +95,7 @@ manfiles = \
dist-hook:
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat \
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \
> "$(distdir)/ChangeLog"; \
fi
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \

233
NEWS
View File

@ -2,239 +2,6 @@
XZ Utils Release Notes
======================
5.6.1 (2024-03-09)
* liblzma: Fixed two bugs relating to GNU indirect function (IFUNC)
with GCC. The more serious bug caused a program linked with
liblzma to crash on start up if the flag -fprofile-generate was
used to build liblzma. The second bug caused liblzma to falsely
report an invalid write to Valgrind when loading liblzma.
* xz: Changed the messages for thread reduction due to memory
constraints to only appear under the highest verbosity level.
* Build:
- Fixed a build issue when the header file <linux/landlock.h>
was present on the system but the Landlock system calls were
not defined in <sys/syscall.h>.
- The CMake build now warns and disables NLS if both gettext
tools and pre-created .gmo files are missing. Previously,
this caused the CMake build to fail.
* Minor improvements to man pages.
* Minor improvements to tests.
5.6.0 (2024-02-24)
This bumps the minor version of liblzma because new features were
added. The API and ABI are still backward compatible with liblzma
5.4.x and 5.2.x and 5.0.x.
NOTE: As described in the NEWS for 5.5.2beta, the core components
are now under the BSD Zero Clause License (0BSD).
Since 5.5.2beta:
* liblzma:
- Disabled the branchless C variant in the LZMA decoder based
on the benchmark results from the community.
- Disabled x86-64 inline assembly on x32 to fix the build.
* Sandboxing support in xz:
- Landlock is now used even when xz needs to create files.
In this case the sandbox has to be more permissive than
when no files need to be created. A similar thing was
already in use with pledge(2) since 5.3.4alpha.
- Landlock and pledge(2) are now stricter when reading from
more than one input file and only writing to standard output.
- Added support for Landlock ABI version 4.
* CMake:
- Default to -O2 instead of -O3 with CMAKE_BUILD_TYPE=Release.
-O3 is not useful for speed and makes the code larger.
- Now builds lzmainfo and lzmadec.
- xzdiff, xzgrep, xzless, xzmore, and their symlinks are now
installed. The scripts are also tested during "make test".
- Added translation support for xz, lzmainfo, and the
man pages.
- Applied the symbol versioning workaround for MicroBlaze that
is used in the Autotools build.
- The general XZ Utils and liblzma API documentation is now
installed.
- The CMake component names were changed a little and several
were added. liblzma_Runtime and liblzma_Development are
unchanged.
- Minimum required CMake version is now 3.14. However,
translation support is disabled with CMake versions
older than 3.20.
- The CMake-based build is now close to feature parity with the
Autotools-based build. Most importantly a few tests aren't
run yet. Testing the CMake-based build on different operating
systems would be welcome now. See the comment at the top of
CMakeLists.txt.
* Fixed a bug in the Autotools feature test for ARM64 CRC32
instruction support for old versions of Clang. This did not
affect the CMake build.
* Windows:
- The build instructions in INSTALL and windows/INSTALL*.txt
were revised completely.
- windows/build-with-cmake.bat along with the instructions
in windows/INSTALL-MinGW-w64_with_CMake.txt should make
it very easy to build liblzma.dll and xz.exe on Windows
using CMake and MinGW-w64 with either GCC or Clang/LLVM.
- windows/build.bash was updated. It now works on MSYS2 and
on GNU/Linux (cross-compiling) to create a .zip and .7z
package for 32-bit and 64-bit x86 using GCC + MinGW-w64.
* The TODO file is no longer installed as part of the
documentation. The file is out of date and does not reflect
the actual tasks that will be completed in the future.
* Translations:
- Translated lzmainfo man pages are now installed. These
had been forgotten in earlier versions.
- Updated Croatian, Esperanto, German, Hungarian, Korean,
Polish, Romanian, Spanish, Swedish, Vietnamese, and Ukrainian
translations.
- Updated German, Korean, Romanian, and Ukrainian man page
translations.
* Added a few tests.
Summary of new features added in the 5.5.x development releases:
* liblzma:
- LZMA decoder: Speed optimizations to the C code and
added GCC & Clang compatible inline assembly for x86-64.
- Added lzma_mt_block_size() to recommend a Block size for
multithreaded encoding.
- Added CLMUL-based CRC32 on x86-64 and E2K with runtime
processor detection. Similar to CRC64, on 32-bit x86 it
isn't available unless --disable-assembler is used.
- Optimized the CRC32 calculation on ARM64 platforms using the
CRC32 instructions. Runtime detection for the instruction is
used on GNU/Linux, FreeBSD, Windows, and macOS. If the
compiler flags indicate unconditional CRC32 instruction
support (+crc) then the generic version is not built.
- Added definitions of mask values like
LZMA_INDEX_CHECK_MASK_CRC32 to <lzma/index.h>.
* xz:
- Multithreaded mode is now the default. This improves
compression speed and creates .xz files that can be
decompressed in multithreaded mode. The downsides are
increased memory usage and slightly worse compression ratio.
- Added a new command line option --filters to set the filter
chain using the liblzma filter string syntax.
- Added new command line options --filters1 ... --filters9 to
set additional filter chains using the liblzma filter string
syntax. The --block-list option now allows specifying filter
chains that were set using these new options.
- Ported the command line tools to Windows MSVC.
Visual Studio 2015 or later is required.
* Added lz4 support to xzdiff/xzcmp and xzgrep.
5.5.2beta (2024-02-14)
* Licensing change: The core components are now under the
BSD Zero Clause License (0BSD). In XZ Utils 5.4.6 and older
and 5.5.1alpha these components are in the public domain and
obviously remain so; the change affects the new releases only.
0BSD is an extremely permissive license which doesn't require
retaining or reproducing copyright or license notices when
distributing the code, thus in practice there is extremely
little difference to public domain.
* liblzma
- Significant speed optimizations to the LZMA decoder were
made. There are now three variants that can be chosen at
build time:
* Basic C version: This is a few percent faster than
5.4.x due to some new optimizations.
* Branchless C: This is currently the default on platforms
for which there is no assembly code. This should be a few
percent faster than the basic C version.
* x86-64 inline assembly. This works with GCC and Clang.
The default choice can currently be overridden by setting
LZMA_RANGE_DECODER_CONFIG in CPPFLAGS: 0 means the basic
version and 3 means that branchless C version.
- Optimized the CRC32 calculation on ARM64 platforms using the
CRC32 instructions. The instructions are optional in ARMv8.0
and are required in ARMv8.1 and later. Runtime detection for
the instruction is used on GNU/Linux, FreeBSD, Windows, and
macOS. If the compiler flags indicate unconditional CRC32
instruction support (+crc) then the generic version is not
built.
* Added lz4 support to xzdiff/xzcmp and xzgrep.
* Man pages of xzdiff/xzcmp, xzgrep, and xzmore were rewritten
to simplify licensing of the man page translations.
* Translations:
- Updated Chinese (simplified), German, Korean, Polish,
Romanian, Spanish, Swedish, and Ukrainian translations.
- Updated German, Korean, Romanian, and Ukrainian man page
translations.
* Small improvements to the tests.
* Added doc/examples/11_file_info.c. It was added to the Git
repository in 2017 but forgotten to be added into distribution
tarballs.
* Removed doc/examples_old. These were from 2012.
* Removed the macos/build.sh script. It had not been updated
since 2013.
5.5.1alpha (2024-01-26)
* Added a new filter for RISC-V binaries. The filter can be used

View File

@ -124,15 +124,14 @@ Information to packagers of XZ Utils
If the package manager supports a license field, you probably should
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
XZ Utils are under the BSD Zero Clause License (0BSD), but some less
important files ending up into the binary package are under GPLv2+.
So it is simplest to just say GPLv2+ if you cannot specify
"BSD0 and GPLv2+".
XZ Utils are in the public domain, but some less important files
ending up into the binary package are under GPLv2+. So it is simplest
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
If you split XZ Utils into multiple packages as described earlier
in this file, liblzma and liblzma-dev packages will contain only
0BSD-licensed code from XZ Utils (compiler or linker may add some
third-party code which may have other licenses).
public domain code (from XZ Utils at least; compiler or linker may
add some third-party code, which may be copyrighted).
4. configure options

1
README
View File

@ -75,7 +75,6 @@ XZ Utils
PACKAGERS Information to packagers of XZ Utils
COPYING XZ Utils copyright and license information
COPYING.0BSD BSD Zero Clause License
COPYING.GPLv2 GNU General Public License version 2
COPYING.GPLv3 GNU General Public License version 3
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1

4
THANKS
View File

@ -76,7 +76,6 @@ has been important. :-) In alphabetical order:
- Richard Koch
- Anton Kochkov
- Ville Koskinen
- Sergey Kosukhin
- Marcin Kowalczyk
- Jan Kratochvil
- Christian Kujau
@ -153,9 +152,9 @@ has been important. :-) In alphabetical order:
- Dan Stromberg
- Jia Tan
- Vincent Torri
- Alexey Tourbin
- Paul Townsend
- Mohammed Adnène Trojette
- Alexey Tourbin
- Taiki Tsunekawa
- Maksym Vatsyk
- Loganaden Velvindron
@ -172,7 +171,6 @@ has been important. :-) In alphabetical order:
- Charles Wilson
- Lars Wirzenius
- Pilorz Wojciech
- Chien Wong
- Ryan Young
- Andreas Zieringer

View File

@ -1,10 +1,12 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
set -e -x

View File

@ -1,6 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: 0BSD
#
#############################################################################
#
# Script meant to be used for Continuous Integration automation for POSIX
@ -10,6 +9,9 @@
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
set -e

View File

@ -1,6 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
#
###############################################################################
#
# Wrapper for GNU groff to convert man pages to a few formats
@ -18,6 +17,9 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
FORMAT=$1

View File

@ -1,6 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
#
#############################################################################
#
# Get the version string from version.h and print it out without
@ -10,6 +9,9 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/

View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# remove-ordinals.cmake
@ -18,6 +16,9 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
file(READ "${INPUT_FILE}" STR)

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
# DEFINITIONS may be an empty string/list but it's fine here. There is

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(TestBigEndian)

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_large_file_support.cmake
#
@ -11,7 +8,9 @@
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
#
@ -9,7 +6,9 @@
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
#
# Author: Lasse Collin
#
#############################################################################
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)

View File

@ -1,12 +1,13 @@
# -*- Autoconf -*-
# SPDX-License-Identifier: 0BSD
# Process this file with autoconf to produce a configure script.
###############################################################################
#
# Process this file with autoconf to produce a configure script.
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# NOTE: Don't add useless checks. autoscan detects this and that, but don't
@ -379,16 +380,6 @@ AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc],
[], [enable_clmul_crc=yes])
############################
# ARM64 CRC32 Instructions #
############################
AC_ARG_ENABLE([arm64-crc32], AS_HELP_STRING([--disable-arm64-crc32],
[Do not use ARM64 CRC32 instructions even if support for it
is detected.]),
[], [enable_arm64_crc32=yes])
#####################
# Size optimization #
#####################
@ -709,80 +700,61 @@ fi
# --with-pic and --without-pic though. As long as neither --with-pic nor
# --without-pic is used then we can use #ifdef PIC to detect if the file is
# being built for a shared library.
AS_IF([test "x$enable_symbol_versions" = xno], [
if test "x$enable_symbol_versions" = xno ; then
enable_symbol_versions=no
AC_MSG_RESULT([no])
], [test "x$enable_shared" = xno], [
elif test "x$enable_shared" = xno ; then
enable_symbol_versions=no
AC_MSG_RESULT([no (not building a shared library)])
], [
# "yes" means that symbol version are to be used but we need to
# autodetect which variant to use.
if test "x$enable_symbol_versions" = xyes ; then
case "$host_cpu-$host_os" in
microblaze*)
# GCC 12 on MicroBlaze doesn't support
# __symver__ attribute. It's simplest and
# safest to use the generic version on that
# platform since then only the linker script
# is needed. The RHEL/CentOS 7 compatibility
# symbols don't matter on MicroBlaze.
enable_symbol_versions=generic
;;
*-linux*)
# NVIDIA HPC Compiler doesn't support symbol
# versioning but the linker script can still
# be used.
AC_EGREP_CPP([use_generic_symbol_versioning],
[#ifdef __NVCOMPILER
use_generic_symbol_versioning
#endif],
[enable_symbol_versions=generic],
[enable_symbol_versions=linux])
;;
*)
enable_symbol_versions=generic
;;
esac
fi
if test "x$enable_symbol_versions" = xlinux ; then
case "$pic_mode-$enable_static" in
default-*)
# Use symvers if PIC is defined.
have_symbol_versions_linux=2
;;
*-no)
# Not building static library.
# Use symvers unconditionally.
have_symbol_versions_linux=1
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([
else
case "$host_cpu-$host_os" in
microblaze*)
# GCC 12 on MicroBlaze doesn't support __symver__
# attribute. It's simplest and safest to use the
# generic version on that platform since then only
# the linker script is needed. The RHEL/CentOS 7
# compatibility symbols don't matter on MicroBlaze.
enable_symbol_versions=generic
;;
*-linux*)
case "$pic_mode-$enable_static" in
default-*)
# Use symvers if PIC is defined.
have_symbol_versions_linux=2
;;
*-no)
# Not building static library.
# Use symvers unconditionally.
have_symbol_versions_linux=1
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([
On GNU/Linux, building both shared and static library at the same time
is not supported if --with-pic or --without-pic is used.
Use either --disable-shared or --disable-static to build one type
of library at a time. If both types are needed, build one at a time,
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
;;
esac
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
[$have_symbol_versions_linux],
[Define to 1 to if GNU/Linux-specific details
are unconditionally wanted for symbol
versioning. Define to 2 to if these are wanted
only if also PIC is defined (allows building
both shared and static liblzma at the same
time with Libtool if neither --with-pic nor
--without-pic is used). This define must be
used together with liblzma_linux.map.])
elif test "x$enable_symbol_versions" != xgeneric ; then
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
fi
;;
esac
enable_symbol_versions=linux
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
[$have_symbol_versions_linux],
[Define to 1 to if GNU/Linux-specific details
are unconditionally wanted for symbol
versioning. Define to 2 to if these are wanted
only if also PIC is defined (allows building
both shared and static liblzma at the same
time with Libtool if neither --with-pic nor
--without-pic is used). This define must be
used together with liblzma_linux.map.])
;;
*)
enable_symbol_versions=generic
;;
esac
AC_MSG_RESULT([yes ($enable_symbol_versions)])
])
fi
AM_CONDITIONAL([COND_SYMVERS_LINUX],
[test "x$enable_symbol_versions" = xlinux])
@ -821,6 +793,8 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
# cpuid.h may be used for detecting x86 processor features at runtime.
AC_CHECK_HEADERS([immintrin.h cpuid.h])
# dirent.h allows for directory parsing in xz.
AC_CHECK_HEADERS([dirent.h])
###############################################################################
# Checks for typedefs, structures, and compiler characteristics.
@ -929,13 +903,6 @@ if test "x$enable_ifunc" = xauto ; then
#endif
static void func(void) { return; }
/*
* The attribute __no_profile_instrument_function__ is
* needed with GCC to prevent improper instrumentation in
* the ifunc resolver.
*/
__attribute__((__no_profile_instrument_function__))
static void (*resolve_func (void)) (void) { return func; }
void func_ifunc (void)
__attribute__((__ifunc__("resolve_func")));
@ -1122,58 +1089,6 @@ __m128i my_clmul(__m128i a)
AC_MSG_RESULT([$enable_clmul_crc])
])
# ARM64 C Language Extensions define CRC32 functions in arm_acle.h.
# These are supported by at least GCC and Clang which both need
# __attribute__((__target__("+crc"))), unless the needed compiler flags
# are used to support the CRC instruction.
AC_MSG_CHECKING([if ARM64 CRC32 instruction is usable])
AS_IF([test "x$enable_arm64_crc32" = xno], [
AC_MSG_RESULT([no, --disable-arm64-crc32 was used])
], [
# Set -Werror here because some versions of Clang (14 and older)
# do not report the unsupported __attribute__((__target__("+crc")))
# or __crc32d() as an error, only as a warning. This does not need
# to be done with CMake because tests will attempt to link and the
# error will be reported then.
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <arm_acle.h>
#include <stdint.h>
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
__attribute__((__target__("+crc")))
#endif
uint32_t my_crc(uint32_t a, uint64_t b)
{
return __crc32d(a, b);
}
]])], [
AC_DEFINE([HAVE_ARM64_CRC32], [1],
[Define to 1 if ARM64 CRC32 instruction is supported.
See configure.ac for details.])
enable_arm64_crc32=yes
], [
enable_arm64_crc32=no
])
AC_MSG_RESULT([$enable_arm64_crc32])
CFLAGS="$OLD_CFLAGS"
])
# Check for ARM64 CRC32 instruction runtime detection.
# getauxval() is supported on Linux, elf_aux_info() on FreeBSD, and
# sysctlbyname("hw.optional.armv8_crc32", ...) is supported on Darwin
# (macOS, iOS, etc.). Note that sysctlbyname() is supported on FreeBSD,
# NetBSD, and possibly others too but the string is specific to Apple OSes.
# The C code is responsible for checking defined(__APPLE__) before using
# sysctlbyname("hw.optional.armv8_crc32", ...).
AS_IF([test "x$enable_arm64_crc32" = xyes], [
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname])
])
# Check for sandbox support. If one is found, set enable_sandbox=found.
#
# About -fsanitize: Of our three sandbox methods, only Landlock is
@ -1198,37 +1113,12 @@ AS_CASE([$enable_sandbox],
)
AS_CASE([$enable_sandbox],
[auto | landlock], [
AC_MSG_CHECKING([if Linux Landlock is usable])
# A compile check is done here because some systems have
# linux/landlock.h, but do not have the syscalls defined
# in order to actually use Linux Landlock.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <linux/landlock.h>
#include <sys/syscall.h>
#include <sys/prctl.h>
void my_sandbox(void)
{
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
(void)SYS_landlock_create_ruleset;
(void)SYS_landlock_restrict_self;
(void)LANDLOCK_CREATE_RULESET_VERSION;
return;
}
]])], [
AC_CHECK_HEADERS([linux/landlock.h], [
enable_sandbox=found
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
AC_DEFINE([HAVE_LINUX_LANDLOCK], [1],
[Define to 1 if Linux Landlock is supported.
See configure.ac for details.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
]
)

View File

@ -1,5 +1,9 @@
## SPDX-License-Identifier: 0BSD
##
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
EXTRA_DIST = \
translation.bash

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32.c
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file full_flush.c
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file hex2bin.c
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file known_sizes.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file memusage.c
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file repeat.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file sync_flush.c
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,5 +1,4 @@
#!/bin/bash
# SPDX-License-Identifier: 0BSD
###############################################################################
#
@ -21,6 +20,9 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
set -e

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 01_compress_easy.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 02_decompress.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 03_compress_custom.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 04_compress_easy_mt.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 11_file_info.c
@ -11,6 +9,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,5 +1,9 @@
# SPDX-License-Identifier: 0BSD
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
CC = c99
CFLAGS = -g

View File

@ -0,0 +1,127 @@
/*
* xz_pipe_comp.c
* A simple example of pipe-only xz compressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
*
* Usage example:
* $ cat some_file | ./xz_pipe_comp > some_file.xz
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* COMPRESSION SETTINGS */
/* analogous to xz CLI options: -0 to -9 */
#define COMPRESSION_LEVEL 6
/* boolean setting, analogous to xz CLI option: -e */
#define COMPRESSION_EXTREME true
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_COMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_compress (FILE *in_file, FILE *out_file)
{
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
lzma_check check = INTEGRITY_CHECK;
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz encoder */
ret_xz = lzma_easy_encoder (&strm, preset, check);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the xz data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending compressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* compress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_COMPRESSION;
} else {
/* write compressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_compress (stdin, stdout);
return ret;
}

View File

@ -0,0 +1,123 @@
/*
* xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation.
* version: 2012-06-14 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
*
* Usage example:
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_DECOMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_decompress (FILE *in_file, FILE *out_file)
{
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz decoder */
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the decompressed data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending decompressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* decompress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_DECOMPRESSION;
} else {
/* write decompressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
/* Bug fix (2012-06-14): If no errors were detected, check
that the last lzma_code() call returned LZMA_STREAM_END.
If not, the file is probably truncated. */
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "Input truncated or corrupt\n");
ret = RET_ERROR_DECOMPRESSION;
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_decompress (stdin, stdout);
return ret;
}

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Makefile to build XZ Utils using DJGPP
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# For debugging, set comment "#define NDEBUG 1" from config.h to enable

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: 0BSD */
/* How many MiB of RAM to assume if the real amount cannot be determined. */
#define ASSUME_RAM 32

View File

@ -3,11 +3,9 @@
<p style="text-align: right;padding-right: 12px;">
XZ logo &copy; 2023 by Jia Tan is licensed under
<a href="COPYING.CC-BY-SA-4.0"
rel="license"
target="_blank"
rel="license noopener noreferrer"
style="display:inline-block;">
CC BY-SA 4.0
</a>
</p>
</body>
</html>

View File

@ -1,6 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
#
#############################################################################
#
# Updates the Doxygen generated documentation files in the source tree.
@ -17,6 +16,9 @@
# Authors: Jia Tan
# Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
set -e

View File

@ -1,6 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: 0BSD
#
#############################################################################
#
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
@ -18,6 +17,9 @@
#
# Author: Lasse Collin <lasse.collin@tukaani.org>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
# You can use 7z or 7za, both will work.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
scanlzma, scan for lzma compressed data in stdin and echo it to stdout.
Copyright (C) 2006 Timo Lindfors

View File

@ -1,5 +1,3 @@
## SPDX-License-Identifier: GPL-2.0-or-later
##
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
##

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt-on-non-glibc compatibility macros.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (basic, portable features only).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (GNU extensions).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (basic, portable features) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (GNU extensions) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Getopt for GNU.
Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,5 +1,3 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Internal declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

1
m4/.gitignore vendored
View File

@ -1,4 +1,3 @@
build-to-host.m4
codeset.m4
extern-inline.m4
fcntl-o.m4

View File

@ -1,5 +1,3 @@
dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================

View File

@ -1,5 +1,3 @@
dnl SPDX-License-Identifier: FSFULLR
# getopt.m4 serial 49 (modified version)
dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation

View File

@ -1,5 +1,3 @@
dnl SPDX-License-Identifier: FSFULLR
# Find a POSIX-conforming shell.
# Copyright (C) 2007-2008 Free Software Foundation, Inc.

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -10,11 +7,13 @@
#
# Common checks for tuklib.
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_COMMON], [
AC_REQUIRE([AC_CANONICAL_HOST])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -20,11 +17,13 @@
# GetSystemInfo() is used on Cygwin)
# - pstat_getdynamic(): HP-UX
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -14,11 +11,13 @@
# - Does the hardware support fast unaligned access to 16-bit, 32-bit,
# and 64-bit integers
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -18,11 +15,13 @@
# functions, but each function is put into a separate .c file so
# that it is possible to pick only what is strictly needed.
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -32,11 +29,13 @@
# - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf().
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,6 +1,3 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -14,11 +11,13 @@
# This .m4 file is needed allow this module to use glibc's
# program_invocation_name.
#
#############################################################################
# COPYING
#
# Author: Lasse Collin
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,5 +1,3 @@
dnl SPDX-License-Identifier: FSFULLR
# visibility.m4 serial 8
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation

113
macosx/build.sh Executable file
View File

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

View File

@ -1,10 +1,4 @@
# SPDX-License-Identifier: FSFUL
# Makefile variables for PO directory in any package using GNU gettext.
#
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation gives
# unlimited permission to use, copy, distribute, and modify it.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
@ -14,7 +8,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@ -24,14 +18,7 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = The XZ Utils authors and contributors
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
COPYRIGHT_HOLDER =
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
@ -53,35 +40,7 @@ MSGID_BUGS_ADDRESS =
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS = --no-wrap
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
#
# Although one may need slightly wider terminal than 80 chars, it is
# much nicer to edit the output of --help when --no-wrap is set.
MSGINIT_OPTIONS = --no-wrap
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes
# Although you may need slightly wider terminal than 80 chars, it is
# much nicer to edit the output of --help when this is set.
XGETTEXT_OPTIONS += --no-wrap
MSGMERGE += --no-wrap

View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: 0BSD
# List of source files which contain translatable strings.
src/xz/args.c
src/xz/coder.c
@ -8,10 +6,8 @@ src/xz/hardware.c
src/xz/list.c
src/xz/main.c
src/xz/message.c
src/xz/mytime.c
src/xz/options.c
src/xz/signals.c
src/xz/suffix.c
src/xz/util.c
src/lzmainfo/lzmainfo.c
src/common/tuklib_exit.c

469
po/de.po

File diff suppressed because it is too large Load Diff

502
po/eo.po

File diff suppressed because it is too large Load Diff

506
po/es.po

File diff suppressed because it is too large Load Diff

652
po/hr.po

File diff suppressed because it is too large Load Diff

556
po/hu.po

File diff suppressed because it is too large Load Diff

597
po/ko.po

File diff suppressed because it is too large Load Diff

481
po/pl.po

File diff suppressed because it is too large Load Diff

532
po/ro.po

File diff suppressed because it is too large Load Diff

498
po/sv.po

File diff suppressed because it is too large Load Diff

509
po/uk.po

File diff suppressed because it is too large Load Diff

511
po/vi.po

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
# SPDX-License-Identifier: 0BSD
#
# SOME DESCRIPTIVE TITLE.
# Copyright (C) The XZ Utils authors and contributors
# This file is published under the BSD Zero Clause License.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#

View File

@ -1,14 +1,14 @@
# Chinese translations for xz package
# xz 软件包的简体中文翻译。
# This file is put in the public domain.
# Boyuan Yang <073plan@gmail.com>, 2019, 2022, 2023, 2024.
# Boyuan Yang <073plan@gmail.com>, 2019, 2022, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.6.0-pre1\n"
"Project-Id-Version: xz 5.4.4-pre1\n"
"Report-Msgid-Bugs-To: xz@tukaani.org\n"
"POT-Creation-Date: 2024-01-26 19:40+0800\n"
"PO-Revision-Date: 2024-02-05 15:15-0500\n"
"POT-Creation-Date: 2023-07-18 23:34+0800\n"
"PO-Revision-Date: 2023-07-19 14:24-0400\n"
"Last-Translator: Boyuan Yang <073plan@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
@ -17,181 +17,144 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Generator: Poedit 3.4.2\n"
"X-Generator: Poedit 3.2.2\n"
#: src/xz/args.c:78
#: src/xz/args.c:77
#, c-format
msgid "%s: Invalid argument to --block-list"
msgstr "%s--block-list 的无效参数"
#: src/xz/args.c:88
#: src/xz/args.c:87
#, c-format
msgid "%s: Too many arguments to --block-list"
msgstr "%s--block-list 得到过多参数"
#: src/xz/args.c:125
#, c-format
msgid "In --block-list, block size is missing after filter chain number '%c:'"
msgstr "在 --block-list 中,块大小在过滤器链编号 '%c:' 之后缺失"
#: src/xz/args.c:151
#: src/xz/args.c:116
msgid "0 can only be used as the last element in --block-list"
msgstr "0 仅可用于 --block-list 的最后一个元素"
#: src/xz/args.c:540
#: src/xz/args.c:451
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s未知文件格式类型"
#: src/xz/args.c:563 src/xz/args.c:571
#: src/xz/args.c:474 src/xz/args.c:482
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s不支持的完整性检查类型"
#: src/xz/args.c:607
msgid "Only one file can be specified with '--files' or '--files0'."
msgstr "仅可使用 '--files' 或 '--files0' 指定单个文件。"
#: src/xz/args.c:518
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "仅可使用“--files”或“--files0”指定一个文件。"
#. TRANSLATORS: This is a translatable
#. string because French needs a space
#. before the colon ("%s : %s").
#: src/xz/args.c:622 src/xz/coder.c:1059 src/xz/coder.c:1075
#: src/xz/coder.c:1375 src/xz/coder.c:1378 src/xz/file_io.c:686
#: src/xz/file_io.c:760 src/xz/file_io.c:850 src/xz/file_io.c:1021
#: src/xz/list.c:369 src/xz/list.c:415 src/xz/list.c:477 src/xz/list.c:591
#: src/xz/list.c:600
#: src/xz/args.c:533 src/xz/coder.c:691 src/xz/coder.c:707 src/xz/coder.c:967
#: src/xz/coder.c:970 src/xz/file_io.c:605 src/xz/file_io.c:679
#: src/xz/file_io.c:769 src/xz/file_io.c:940 src/xz/list.c:369
#: src/xz/list.c:415 src/xz/list.c:477 src/xz/list.c:581 src/xz/list.c:590
#, c-format
msgid "%s: %s"
msgstr "%s%s"
#: src/xz/args.c:678
#: src/xz/args.c:589
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "环境变量 %s 包含过多参数"
#: src/xz/args.c:780
#: src/xz/args.c:691
msgid "Compression support was disabled at build time"
msgstr "压缩支持已在构建时禁用"
#: src/xz/args.c:787
#: src/xz/args.c:698
msgid "Decompression support was disabled at build time"
msgstr "解压支持已在构建时禁用"
#: src/xz/args.c:793
#: src/xz/args.c:704
msgid "Compression of lzip files (.lz) is not supported"
msgstr "不支持对 lzip 文件 (.lz) 的压缩"
#: src/xz/args.c:815
msgid "--block-list is ignored unless compressing to the .xz format"
msgstr "除非压缩为 .xz 格式,--block-list 将被忽略"
#: src/xz/args.c:828 src/xz/args.c:837
#: src/xz/args.c:735
msgid "With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "启用 --format-raw 选项时,必须指定 --suffix=.SUF 获知写入至标准输出"
#: src/xz/coder.c:141
#: src/xz/coder.c:115
msgid "Maximum number of filters is four"
msgstr "过滤器最多数量为四"
#: src/xz/coder.c:179
#, c-format
msgid "Error in --filters%s=FILTERS option:"
msgstr "在 --filters%s=过滤器 选项中出现错误:"
#: src/xz/coder.c:229
#: src/xz/coder.c:134
msgid "Memory usage limit is too low for the given filter setup."
msgstr "内存用量限制对指定过滤器设置过低。"
#: src/xz/coder.c:244
#, c-format
msgid "filter chain %u used by --block-list but not specified with --filters%u="
msgstr "--block-list 使用了过滤器链 %u但未经由 --filters%u= 指定"
#: src/xz/coder.c:375
#: src/xz/coder.c:169
msgid "Using a preset in raw mode is discouraged."
msgstr "不推荐在 raw 模式使用预设等级。"
#: src/xz/coder.c:377
#: src/xz/coder.c:171
msgid "The exact options of the presets may vary between software versions."
msgstr "各个预设等级所使用的准确选项列表在不同软件版本之间可能不同。"
#: src/xz/coder.c:403
#: src/xz/coder.c:194
msgid "The .lzma format supports only the LZMA1 filter"
msgstr ".lzma 格式只支持 LZMA1 过滤器"
#: src/xz/coder.c:411
#: src/xz/coder.c:202
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 无法用于 .xz 格式"
#: src/xz/coder.c:435
#, c-format
msgid "Filter chain %u is incompatible with --flush-timeout"
msgstr "过滤器链 %u 和 --flush-timeout 不兼容"
#: src/xz/coder.c:219
msgid "The filter chain is incompatible with --flush-timeout"
msgstr "过滤器链和 --flush-timeout 不兼容"
#: src/xz/coder.c:444
#: src/xz/coder.c:225
msgid "Switching to single-threaded mode due to --flush-timeout"
msgstr "因 --flush-timeout 而切换至单线程模式"
#: src/xz/coder.c:485
#, c-format
msgid "Unsupported options in filter chain %u"
msgstr "过滤器链 %u 中存在不支持的选项"
#: src/xz/coder.c:516
#: src/xz/coder.c:249
#, c-format
msgid "Using up to %<PRIu32> threads."
msgstr "使用最多 %<PRIu32> 个线程。"
#: src/xz/coder.c:532
#: src/xz/coder.c:265
msgid "Unsupported filter chain or filter options"
msgstr "不支持的过滤器链或过滤器选项"
#: src/xz/coder.c:553
#: src/xz/coder.c:277
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "解压缩需要 %s MiB 的内存。"
#: src/xz/coder.c:585
#: src/xz/coder.c:309
#, c-format
msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
msgstr "已将所使用的线程数从 %s 减小为 %s以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:605
#: src/xz/coder.c:329
#, c-format
msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway."
msgstr "已将所使用的线程数从 %s 减小为 1。这仍然超出了自动的内存使用限制 %s MiB。需要 %s MiB 的内存。继续操作。"
#: src/xz/coder.c:632
#: src/xz/coder.c:356
#, c-format
msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB"
msgstr "正在切换到单线程模式以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:757
#: src/xz/coder.c:411
#, c-format
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "已调整 LZMA%c 字典大小(从 %s MiB 调整为 %s MiB以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:767
#, fuzzy, c-format
#| msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgid "Adjusted LZMA%c dictionary size for --filters%u from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "已调整 LZMA%c 字典大小(从 %s MiB 调整为 %s MiB以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:1141
#, c-format
msgid "Error changing to filter chain %u: %s"
msgstr "更改为过滤器链 %u 时出错:%s"
#: src/xz/file_io.c:137 src/xz/file_io.c:145
#: src/xz/file_io.c:110 src/xz/file_io.c:118
#, c-format
msgid "Error creating a pipe: %s"
msgstr "创建管道时出错:%s"
#: src/xz/file_io.c:333
#: src/xz/file_io.c:252
msgid "Failed to enable the sandbox"
msgstr "沙盒启用失败"
#: src/xz/file_io.c:375
#: src/xz/file_io.c:294
#, c-format
msgid "%s: poll() failed: %s"
msgstr "%spoll() 失败:%s"
@ -206,111 +169,111 @@ msgstr "%spoll() 失败:%s"
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:442
#: src/xz/file_io.c:361
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s文件似乎已移动不再进行删除操作"
#: src/xz/file_io.c:449 src/xz/file_io.c:1005
#: src/xz/file_io.c:368 src/xz/file_io.c:924
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s无法删除%s"
#: src/xz/file_io.c:475
#: src/xz/file_io.c:394
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s无法设置文件所有者%s"
#: src/xz/file_io.c:488
#: src/xz/file_io.c:407
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s无法设置文件所有组%s"
#: src/xz/file_io.c:507
#: src/xz/file_io.c:426
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s无法设置文件权限%s"
#: src/xz/file_io.c:633
#: src/xz/file_io.c:552
#, c-format
msgid "Error getting the file status flags from standard input: %s"
msgstr "从标准输入获取文件状态标志出错:%s"
#: src/xz/file_io.c:691 src/xz/file_io.c:753
#: src/xz/file_io.c:610 src/xz/file_io.c:672
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s是符号链接跳过"
#: src/xz/file_io.c:782
#: src/xz/file_io.c:701
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s是目录跳过"
#: src/xz/file_io.c:788
#: src/xz/file_io.c:707
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s不是标准文件跳过"
#: src/xz/file_io.c:805
#: src/xz/file_io.c:724
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s文件有设置用户ID或设置组ID标识跳过"
#: src/xz/file_io.c:812
#: src/xz/file_io.c:731
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s文件有粘滞位标识跳过"
#: src/xz/file_io.c:819
#: src/xz/file_io.c:738
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s输入文件有多于一个硬链接跳过"
#: src/xz/file_io.c:861
#: src/xz/file_io.c:780
msgid "Empty filename, skipping"
msgstr "空文件名,跳过"
#: src/xz/file_io.c:915
#: src/xz/file_io.c:834
#, c-format
msgid "Error restoring the status flags to standard input: %s"
msgstr "回复标准输入的状态标志时出错:%s"
#: src/xz/file_io.c:963
#: src/xz/file_io.c:882
#, c-format
msgid "Error getting the file status flags from standard output: %s"
msgstr "获取标准输出的文件状态标志时出错:%s"
#: src/xz/file_io.c:1162
#: src/xz/file_io.c:1060
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "恢复标准输出的 O_APPEND 标志时出错:%s"
#: src/xz/file_io.c:1174
#: src/xz/file_io.c:1072
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s关闭文件失败%s"
#: src/xz/file_io.c:1210 src/xz/file_io.c:1472
#: src/xz/file_io.c:1108 src/xz/file_io.c:1371
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s尝试创建稀疏文件时 seek 失败:%s"
#: src/xz/file_io.c:1310
#: src/xz/file_io.c:1209
#, c-format
msgid "%s: Read error: %s"
msgstr "%s读取错误%s"
#: src/xz/file_io.c:1340
#: src/xz/file_io.c:1239
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%sseek 文件时出错:%s"
#: src/xz/file_io.c:1364
#: src/xz/file_io.c:1263
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s未预期的文件结束"
#: src/xz/file_io.c:1423
#: src/xz/file_io.c:1322
#, c-format
msgid "%s: Write error: %s"
msgstr "%s写入错误%s"
@ -529,63 +492,63 @@ msgstr "%s过小而不是有效的 .xz 文件"
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:741
#: src/xz/list.c:731
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " 流 块 压缩大小 解压大小 比例 校验 文件名"
#: src/xz/list.c:1036 src/xz/list.c:1214
#: src/xz/list.c:1026 src/xz/list.c:1204
msgid "Yes"
msgstr "是"
#: src/xz/list.c:1036 src/xz/list.c:1214
#: src/xz/list.c:1026 src/xz/list.c:1204
msgid "No"
msgstr "否"
#: src/xz/list.c:1038 src/xz/list.c:1216
#: src/xz/list.c:1028 src/xz/list.c:1206
#, c-format
msgid " Minimum XZ Utils version: %s\n"
msgstr " 最低 XZ Utils 版本:%s\n"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:1189
#: src/xz/list.c:1179
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s 文件\n"
#: src/xz/list.c:1202
#: src/xz/list.c:1192
msgid "Totals:"
msgstr "总计:"
#: src/xz/list.c:1280
#: src/xz/list.c:1270
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list 仅适用于 .xz 文件(--format=xz 或 --format=auto"
#: src/xz/list.c:1286
#: src/xz/list.c:1276
msgid "--list does not support reading from standard input"
msgstr "--list 不支持从标准输入读取"
#: src/xz/main.c:96
#: src/xz/main.c:89
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s读取文件名列表时出错%s"
#: src/xz/main.c:103
#: src/xz/main.c:96
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s读取文件名列表时遇到未预期的输入结束"
#: src/xz/main.c:127
#: src/xz/main.c:120
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use '--files0' instead of '--files'?"
msgstr "%s读取文件名列表时获得了空字符您可能想要使用 '--files0' 而非 '--files'"
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr "%s读取文件名列表时获得了空字符您可能想要使用“--files0”而非“--files”"
#: src/xz/main.c:207
#: src/xz/main.c:188
msgid "Compression and decompression with --robot are not supported yet."
msgstr "尚不支持带 --robot 的压缩和解压缩。"
#: src/xz/main.c:285
#: src/xz/main.c:266
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "无法同时从标准输入读取数据和文件名列表"
@ -593,68 +556,68 @@ msgstr "无法同时从标准输入读取数据和文件名列表"
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:671 src/xz/message.c:726
#: src/xz/message.c:670 src/xz/message.c:725
#, c-format
msgid "%s: "
msgstr "%s"
#: src/xz/message.c:798 src/xz/message.c:857
#: src/xz/message.c:797 src/xz/message.c:856
msgid "Internal error (bug)"
msgstr "内部错误bug"
#: src/xz/message.c:805
#: src/xz/message.c:804
msgid "Cannot establish signal handlers"
msgstr "无法建立信号处理器"
#: src/xz/message.c:814
#: src/xz/message.c:813
msgid "No integrity check; not verifying file integrity"
msgstr "无完整性检查;将不验证文件完整性"
#: src/xz/message.c:817
#: src/xz/message.c:816
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "不支持的完整性检查类型;将不验证文件完整性"
#: src/xz/message.c:824
#: src/xz/message.c:823
msgid "Memory usage limit reached"
msgstr "达到内存使用限制"
#: src/xz/message.c:827
#: src/xz/message.c:826
msgid "File format not recognized"
msgstr "无法识别文件格式"
#: src/xz/message.c:830
#: src/xz/message.c:829
msgid "Unsupported options"
msgstr "不支持的选项"
#: src/xz/message.c:833
#: src/xz/message.c:832
msgid "Compressed data is corrupt"
msgstr "压缩数据已损坏"
#: src/xz/message.c:836
#: src/xz/message.c:835
msgid "Unexpected end of input"
msgstr "输入意外结束"
#: src/xz/message.c:878
#: src/xz/message.c:877
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "需要 %s MiB 的内存空间。限制已禁用。"
#: src/xz/message.c:906
#: src/xz/message.c:905
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "需要 %s MiB 的内存空间。限制为 %s。"
#: src/xz/message.c:925
#: src/xz/message.c:924
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s过滤器链%s\n"
#: src/xz/message.c:936
#: src/xz/message.c:935
#, c-format
msgid "Try '%s --help' for more information."
msgstr "请尝试执行 '%s --help' 来获取更多信息。"
msgid "Try `%s --help' for more information."
msgstr "请尝试执行“%s --help”来获取更多信息。"
#: src/xz/message.c:962
#: src/xz/message.c:961
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
@ -665,15 +628,15 @@ msgstr ""
"使用 .xz 格式压缩或解压缩文件。\n"
"\n"
#: src/xz/message.c:969
#: src/xz/message.c:968
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr "必选参数对长短选项同时适用。\n"
#: src/xz/message.c:973
#: src/xz/message.c:972
msgid " Operation mode:\n"
msgstr " 操作模式:\n"
#: src/xz/message.c:976
#: src/xz/message.c:975
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
@ -685,7 +648,7 @@ msgstr ""
" -t, --test 测试压缩文件完整性\n"
" -l, --list 列出 .xz 文件的信息"
#: src/xz/message.c:982
#: src/xz/message.c:981
msgid ""
"\n"
" Operation modifiers:\n"
@ -693,7 +656,7 @@ msgstr ""
"\n"
" 操作修饰符:\n"
#: src/xz/message.c:985
#: src/xz/message.c:984
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
@ -703,24 +666,16 @@ msgstr ""
" -f, --force 强制覆写输出文件和(解)压缩链接\n"
" -c, --stdout 向标准输出写入,同时不要删除输入文件"
#: src/xz/message.c:994
#: src/xz/message.c:993
msgid ""
" --single-stream decompress only the first stream, and silently\n"
" ignore possible remaining input data"
msgstr " --single-stream 仅解压缩第一个流,忽略其后可能继续出现的输入数据"
#: src/xz/message.c:997
#, fuzzy
#| msgid ""
#| " --no-sparse do not create sparse files when decompressing\n"
#| " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
#| " --files[=FILE] read filenames to process from FILE; if FILE is\n"
#| " omitted, filenames are read from the standard input;\n"
#| " filenames must be terminated with the newline character\n"
#| " --files0[=FILE] like --files but use the null character as terminator"
#: src/xz/message.c:996
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix '.SUF' on compressed files\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
@ -732,7 +687,7 @@ msgstr ""
" 将从标准输入读取文件名列表;文件名必须使用换行符分隔\n"
" --files0[=文件] 类似 --files但使用空字符进行分隔"
#: src/xz/message.c:1006
#: src/xz/message.c:1005
msgid ""
"\n"
" Basic file format and compression options:\n"
@ -740,18 +695,12 @@ msgstr ""
"\n"
" 基本文件格式和压缩选项:\n"
#: src/xz/message.c:1008
#, fuzzy
#| msgid ""
#| " -F, --format=FMT file format to encode or decode; possible values are\n"
#| " `auto' (default), `xz', `lzma', `lzip', and `raw'\n"
#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n"
#| " `crc32', `crc64' (default), or `sha256'"
#: src/xz/message.c:1007
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" 'auto' (default), 'xz', 'lzma', 'lzip', and 'raw'\n"
" -C, --check=CHECK integrity check type: 'none' (use with caution),\n"
" 'crc32', 'crc64' (default), or 'sha256'"
" `auto' (default), `xz', `lzma', `lzip', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
msgstr ""
" -F, --format=格式 要编码或解码的文件格式;可能的值包括\n"
" “auto”默认、“xz”、“lzma”、\n"
@ -759,11 +708,11 @@ msgstr ""
" -C, --check=类型 完整性检查类型“none”请谨慎使用、\n"
" “crc32”、“crc64”默认或“sha256”"
#: src/xz/message.c:1013
#: src/xz/message.c:1012
msgid " --ignore-check don't verify the integrity check when decompressing"
msgstr " --ignore-check 解压缩时不要进行完整性检查验证"
#: src/xz/message.c:1017
#: src/xz/message.c:1016
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
@ -771,7 +720,7 @@ msgstr ""
" -0 ... -9 压缩预设等级;默认为 6使用 7-9 的等级之前,请先考虑\n"
" 压缩和解压缩所需的内存用量!(会占用大量内存空间)"
#: src/xz/message.c:1021
#: src/xz/message.c:1020
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
@ -779,19 +728,15 @@ msgstr ""
" -e, --extreme 尝试使用更多 CPU 时间来改进压缩比率;\n"
" 不会影响解压缩的内存需求量"
#: src/xz/message.c:1025
#, fuzzy
#| msgid ""
#| " -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
#| " to use as many threads as there are processor cores"
#: src/xz/message.c:1024
msgid ""
" -T, --threads=NUM use at most NUM threads; the default is 0 which uses\n"
" as many threads as there are processor cores"
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
" to use as many threads as there are processor cores"
msgstr ""
" -T, --threads=数量 使用最多指定数量的线程;默认值为 1设置为 0\n"
" 可以使用与处理器内核数量相同的线程数"
#: src/xz/message.c:1030
#: src/xz/message.c:1029
msgid ""
" --block-size=SIZE\n"
" start a new .xz block after every SIZE bytes of input;\n"
@ -801,24 +746,17 @@ msgstr ""
" 输入每读取指定块大小的数据后即开始一个新的 .xz 块;\n"
" 使用该选项可以设置多线程压缩中的块大小"
#: src/xz/message.c:1034
#, fuzzy
#| msgid ""
#| " --block-list=SIZES\n"
#| " start a new .xz block after the given comma-separated\n"
#| " intervals of uncompressed data"
#: src/xz/message.c:1033
msgid ""
" --block-list=BLOCKS\n"
" --block-list=SIZES\n"
" start a new .xz block after the given comma-separated\n"
" intervals of uncompressed data; optionally, specify a\n"
" filter chain number (0-9) followed by a ':' before the\n"
" uncompressed data size"
" intervals of uncompressed data"
msgstr ""
" --block-list=块大小列表\n"
" 在所给出的未压缩数据间隔大小的数据之后开始一个新的\n"
" .xz 块(使用逗号分隔)"
#: src/xz/message.c:1040
#: src/xz/message.c:1037
msgid ""
" --flush-timeout=TIMEOUT\n"
" when compressing, if more than TIMEOUT milliseconds has\n"
@ -829,7 +767,7 @@ msgstr ""
" 进行压缩时,如果从上次刷洗输出之后经过了指定的超时时间\n"
" 且读取更多数据会被阻塞,则刷洗输出所有缓冲数据"
#: src/xz/message.c:1046
#: src/xz/message.c:1043
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@ -848,13 +786,13 @@ msgstr ""
" 所指定限制量单位为字节,或以百分号 % 结尾表示内存比例,\n"
" 或者指定 0 取软件默认值"
#: src/xz/message.c:1055
#: src/xz/message.c:1052
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr " --no-adjust 如果压缩设置超出内存用量限制,不调整设置而直接报错"
#: src/xz/message.c:1061
#: src/xz/message.c:1058
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@ -862,27 +800,7 @@ msgstr ""
"\n"
" 用于压缩的自定义过滤器链(不使用预设等级时的备选用法):"
#: src/xz/message.c:1064
msgid ""
"\n"
" --filters=FILTERS set the filter chain using the liblzma filter string\n"
" syntax; use --filters-help for more information"
msgstr ""
#: src/xz/message.c:1070
msgid ""
" --filters1=FILTERS ... --filters9=FILTERS\n"
" set additional filter chains using the liblzma filter\n"
" string syntax to use with --block-list"
msgstr ""
#: src/xz/message.c:1076
msgid ""
" --filters-help display more information about the liblzma filter string\n"
" syntax and exit."
msgstr ""
#: src/xz/message.c:1087
#: src/xz/message.c:1067
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
@ -911,19 +829,7 @@ msgstr ""
" (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=数字 最大搜索深度; 0=自动(默认)"
#: src/xz/message.c:1102
#, fuzzy
#| msgid ""
#| "\n"
#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
#| " --arm[=OPTS] ARM BCJ filter\n"
#| " --armthumb[=OPTS] ARM-Thumb BCJ filter\n"
#| " --arm64[=OPTS] ARM64 BCJ filter\n"
#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
#| " --sparc[=OPTS] SPARC BCJ filter\n"
#| " Valid OPTS for all BCJ filters:\n"
#| " start=NUM start offset for conversions (default=0)"
#: src/xz/message.c:1082
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@ -933,7 +839,6 @@ msgid ""
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" --riscv[=OPTS] RISC-V BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
@ -948,7 +853,7 @@ msgstr ""
" 所有过滤器可用选项:\n"
" start=数字 转换的起始偏移量(默认=0"
#: src/xz/message.c:1116
#: src/xz/message.c:1095
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@ -959,7 +864,7 @@ msgstr ""
" --delta[=选项] 增量过滤器;有效选项(有效值;默认值):\n"
" dist=NUM 相减的字节之间的距离 (1-256; 1)"
#: src/xz/message.c:1124
#: src/xz/message.c:1103
msgid ""
"\n"
" Other options:\n"
@ -967,7 +872,7 @@ msgstr ""
"\n"
" 其它选项:\n"
#: src/xz/message.c:1127
#: src/xz/message.c:1106
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
@ -975,21 +880,21 @@ msgstr ""
" -q, --quiet 不显示警告信息;指定两次可不显示错误信息\n"
" -v, --verbose 输出详细信息;指定两次可以输出更详细的信息"
#: src/xz/message.c:1132
#: src/xz/message.c:1111
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn 使得警告信息不影响程序退出返回值"
#: src/xz/message.c:1134
#: src/xz/message.c:1113
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot 使用机器可解析的信息(对于脚本有用)"
#: src/xz/message.c:1137
#: src/xz/message.c:1116
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr " --info-memory 显示 RAM 总量和当前配置的内存用量限制,然后退出"
#: src/xz/message.c:1140
#: src/xz/message.c:1119
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@ -997,7 +902,7 @@ msgstr ""
" -h, --help 显示短帮助信息(仅列出基本选项)\n"
" -H, --long-help 显示本长帮助信息"
#: src/xz/message.c:1144
#: src/xz/message.c:1123
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@ -1005,11 +910,11 @@ msgstr ""
" -h, --help 显示本短帮助信息并退出\n"
" -H, --long-help 显示长帮助信息(同时列出高级选项)"
#: src/xz/message.c:1149
#: src/xz/message.c:1128
msgid " -V, --version display the version number and exit"
msgstr " -V, --version 显示软件版本号并退出"
#: src/xz/message.c:1151
#: src/xz/message.c:1130
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@ -1021,7 +926,7 @@ msgstr ""
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1157
#: src/xz/message.c:1136
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
@ -1029,33 +934,19 @@ msgstr ""
"请使用中文向 TP 简体中文翻译团队 <i18n-zh@googlegroups.com>\n"
"报告软件的简体中文翻译错误。\n"
#: src/xz/message.c:1159
#: src/xz/message.c:1138
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s 主页:<%s>\n"
#: src/xz/message.c:1163
#: src/xz/message.c:1142
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
msgstr "这是开发版本,不适用于生产环境使用。"
#: src/xz/message.c:1180
msgid ""
"Filter chains are set using the --filters=FILTERS or\n"
"--filters1=FILTERS ... --filters9=FILTERS options. Each filter in the chain\n"
"can be separated by spaces or '--'. Alternatively a preset <0-9>[e] can be\n"
"specified instead of a filter chain.\n"
msgstr ""
#: src/xz/message.c:1186
#, fuzzy
#| msgid "Unsupported filter chain or filter options"
msgid "The supported filters and their options are:"
msgstr "不支持的过滤器链或过滤器选项"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be 'name=value' pairs separated with commas"
msgstr "%s选项必须按照 '名称=值' 的格式成对出现,使用半角逗号分隔"
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s选项必须按照“名称=值”的格式成对出现,使用半角逗号分隔"
#: src/xz/options.c:93
#, c-format
@ -1067,57 +958,54 @@ msgstr "%s无效的选项名称"
msgid "%s: Invalid option value"
msgstr "%s无效的选项值"
#: src/xz/options.c:248
#: src/xz/options.c:247
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "不支持的 LZMA1/LZMA2 预设等级:%s"
#: src/xz/options.c:356
#: src/xz/options.c:355
msgid "The sum of lc and lp must not exceed 4"
msgstr "lc 和 lp 的和必须不大于 4"
#: src/xz/suffix.c:166
#: src/xz/suffix.c:160
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s文件名有未知后缀跳过"
#: src/xz/suffix.c:187
#: src/xz/suffix.c:181
#, c-format
msgid "%s: File already has '%s' suffix, skipping"
msgstr "%s文件已有 '%s' 后缀名,跳过"
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s文件已有“%s”后缀名,跳过"
#: src/xz/suffix.c:394
#: src/xz/suffix.c:388
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s无效的文件名后缀"
#: src/xz/util.c:107
#: src/xz/util.c:71
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s值不是非负十进制整数"
#: src/xz/util.c:149
#: src/xz/util.c:113
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s无效的乘数后缀"
#: src/xz/util.c:151
#, fuzzy
#| msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgid "Valid suffixes are 'KiB' (2^10), 'MiB' (2^20), and 'GiB' (2^30)."
#: src/xz/util.c:115
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
msgstr "有效的后缀包括“KiB”2^10、“MiB”2^20和“GiB”2^30。"
#: src/xz/util.c:168
#, fuzzy, c-format
#| msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgid "Value of the option '%s' must be in the range [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:132
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "选项“%s”的值必须位于 [%<PRIu64>, %<PRIu64>] 范围内"
#: src/xz/util.c:291
#: src/xz/util.c:269
msgid "Compressed data cannot be read from a terminal"
msgstr "压缩数据不能从终端读取"
#: src/xz/util.c:304
#: src/xz/util.c:282
msgid "Compressed data cannot be written to a terminal"
msgstr "压缩数据不能向终端写入"

1
po4a/.gitignore vendored
View File

@ -1,3 +1,2 @@
/man
/xz-man.pot
/*.po.authors

2115
po4a/de.po

File diff suppressed because it is too large Load Diff

5175
po4a/fr.po

File diff suppressed because it is too large Load Diff

2606
po4a/ko.po

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: 0BSD
# To add a new language, add it to po4a_langs and run "update-po"
# to get a new .po file. After translating the .po file, run
# "update-po" again to generate the translated man pages.
@ -7,10 +5,10 @@
[po4a_langs] de fr ko pt_BR ro uk
[po4a_paths] xz-man.pot $lang:$lang.po
[type: man] ../src/xz/xz.1 $lang:man/$lang/xz.1 add_$lang:?$lang.po.authors
[type: man] ../src/xzdec/xzdec.1 $lang:man/$lang/xzdec.1 add_$lang:?$lang.po.authors
[type: man] ../src/lzmainfo/lzmainfo.1 $lang:man/$lang/lzmainfo.1 add_$lang:?$lang.po.authors
[type: man] ../src/scripts/xzdiff.1 $lang:man/$lang/xzdiff.1 add_$lang:?$lang.po.authors
[type: man] ../src/scripts/xzgrep.1 $lang:man/$lang/xzgrep.1 add_$lang:?$lang.po.authors
[type: man] ../src/scripts/xzless.1 $lang:man/$lang/xzless.1 add_$lang:?$lang.po.authors
[type: man] ../src/scripts/xzmore.1 $lang:man/$lang/xzmore.1 add_$lang:?$lang.po.authors
[type: man] ../src/xz/xz.1 $lang:man/$lang/xz.1
[type: man] ../src/xzdec/xzdec.1 $lang:man/$lang/xzdec.1
[type: man] ../src/lzmainfo/lzmainfo.1 $lang:man/$lang/lzmainfo.1
[type: man] ../src/scripts/xzdiff.1 $lang:man/$lang/xzdiff.1
[type: man] ../src/scripts/xzgrep.1 $lang:man/$lang/xzgrep.1
[type: man] ../src/scripts/xzless.1 $lang:man/$lang/xzless.1
[type: man] ../src/scripts/xzmore.1 $lang:man/$lang/xzmore.1

File diff suppressed because it is too large Load Diff

2964
po4a/ro.po

File diff suppressed because it is too large Load Diff

2603
po4a/uk.po

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,5 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
#
#############################################################################
#
# Updates xz-man.pot and the *.po files, and generates translated man pages.
@ -11,6 +10,9 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
if type po4a > /dev/null 2>&1; then
@ -31,25 +33,6 @@ fi
PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
# Put the author info from the .po files into the header comment of
# the generated man pages.
for FILE in *.po
do
printf '%s\n.\\"\n' \
'PO4A-HEADER: position=^\.\\" Author; mode=after; beginboundary=^\.\\"$' \
> "$FILE.authors"
sed '
/^[^#]/,$d
/: 0BSD$/d
/BSD Zero Clause License/d
/distributed under the same license/d
/in the public domain/d
/The XZ Utils authors and contributors$/d
/^#$/d
s/^#/.\\"/
' "$FILE" >> "$FILE.authors"
done
# Using --force to get up-to-date version numbers in the output files
# when nothing else has changed. This makes it slower but it's fine
# as long as this isn't run every time when "make" is run at the
@ -58,13 +41,5 @@ set -x
po4a --force --verbose \
--package-name="XZ Utils" \
--package-version="$PACKAGE_VERSION" \
--copyright-holder="The XZ Utils authors and contributors" \
--copyright-holder="[See the headers in the input files.]" \
po4a.conf
# Add the customized POT header which contains the SPDX license
# identifier and spells out the license name instead of saying
# "the same license as the XZ Utils package".
mv xz-man.pot xz-man.pot.tmp
cat ../po/xz.pot-header > xz-man.pot
sed '1,/^#$/d' xz-man.pot.tmp >> xz-man.pot
rm xz-man.pot.tmp

View File

@ -1,5 +1,9 @@
## SPDX-License-Identifier: 0BSD
##
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
SUBDIRS = liblzma xzdec

View File

@ -1,7 +1,8 @@
/* SPDX-License-Identifier: 0BSD */
/*
* Author: Lasse Collin
*
* This file has been put into the public domain.
* You can do whatever you want with this file.
*/
#include <winresrc.h>

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file mythread.h
@ -7,6 +5,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef MYTHREAD_H

View File

@ -1,5 +1,3 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file sysdefs.h
@ -10,6 +8,9 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SYSDEFS_H

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