Compare commits

..

185 Commits

Author SHA1 Message Date
Jia Tan af071ef770 Docs: Simplify SECURITY.md. 2024-03-26 03:38:12 +08:00
Lasse Collin 0b99783d63 liblzma: memcmplen.h: Add a comment why subtraction is used. 2024-03-22 17:46:30 +02:00
Lasse Collin 8a25ba024d INSTALL: Document arguments of --enable-symbol-versions. 2024-03-15 18:04:10 +02:00
Lasse Collin 49324b711f Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.
This does the previous commit with CMake.

AC_EGREP_CPP uses AC_REQUIRE so the outermost if-commands must
be changed to AS_IF to ensure that things wont break some day.
See 5a5bd7f871.
2024-03-15 18:04:10 +02:00
Lasse Collin c273123ed0 CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.
It doesn't support the __symver__ attribute or __asm__(".symver ...").
The generic symbol versioning can still be used since it only needs
linker support.
2024-03-15 18:04:10 +02:00
Lasse Collin df7f487648 Update THANKS. 2024-03-15 18:04:10 +02:00
Lasse Collin 3217b82b3e liblzma: Minor comment edits. 2024-03-15 18:03:47 +02:00
Sergey Kosukhin 096bc0e3f8 liblzma: Fix building with NVHPC (NVIDIA HPC SDK).
NVHPC compiler has several issues that make it impossible to
build liblzma:
  - the compiler cannot handle unions that contain pointers that
    are not the first members;
  - the compiler cannot handle the assembler code in range_decoder.h
    (LZMA_RANGE_DECODER_CONFIG has to be set to zero);
  - the compiler fails to produce valid code for delta_decode if the
    vectorization is enabled, which results in failed tests.

This introduces NVHPC-specific workarounds that address the issues.
2024-03-15 17:30:50 +02:00
Lasse Collin 2ad7fad670 CMake: Disable symbol versioning on non-glibc Linux.
This better matches what configure.ac does. For example, musl has
only basic symbol versioning support:

https://wiki.musl-libc.org/functional-differences-from-glibc.html#Symbol_versioning

configure.ac tries to enable symbol versioning only with glibc
so now CMake does the same.
2024-03-15 17:30:50 +02:00
Lasse Collin 82f0c0d39e CMake: Make symbol versioning configurable. 2024-03-15 17:30:50 +02:00
Lasse Collin 45d33bfc45 Build: Style tweaks to configure.ac.
The AC_MSG_ERROR line is overlong anyway as are a few other
AC_MSG_ERROR lines already.
2024-03-13 22:00:23 +02:00
Sergey Kosukhin f56ed6fac6 Build: Let the users override the symbol versioning variant.
There are cases when the users want to decide themselves whether
they want to have the generic (even on GNU/Linux) or the linux
(even if we do not recommend that) symbol versioning variant.
The former might be needed to circumvent compiler issues (i.e.
the compiler does not support all features that are required
for the linux versioning), the latter might help in overriding
the assumptions made in the configure script.
2024-03-13 21:59:55 +02:00
Jia Tan a4f2e20d84 Add NEWS for 5.6.1 2024-03-09 11:27:27 +08:00
Jia Tan f01be8ad75 Translations: Add missing --riscv option to man page translations. 2024-03-09 10:43:20 +08:00
Jia Tan 6e636819e8 Tests: Update two test files.
The original files were generated with random local to my machine.
To better reproduce these files in the future, a constant seed was used
to recreate these files.
2024-03-09 10:18:29 +08:00
Jia Tan a3a29bbd5d Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz.
The first stream in this file is valid, so this tests that xz properly
stops after decompressing it.
2024-03-09 10:08:32 +08:00
Jia Tan 0b4ccc9145 Tests: Update RISC-V test files.
This increases code coverage and tests for possible shifting bugs.
2024-03-09 10:05:32 +08:00
Jia Tan 8c9b8b2063 liblzma: Fix typos in crc32_fast.c and crc64_fast.c. 2024-03-09 09:52:32 +08:00
Jia Tan b93a8d7631 Tests: Replace HAVE_MICROLZMA usage in CMake and Autotools builds.
This reverts commit adaacafde6.
2024-03-09 09:49:55 +08:00
Jia Tan 82ecc53819 liblzma: Fix false Valgrind error report with GCC.
With GCC and a certain combination of flags, Valgrind will falsely
trigger an invalid write. This appears to be due to the omission of
instructions to properly save, set up, and restore the frame pointer.

The IFUNC resolver is a leaf function since it only calls a function
that is inlined. So sometimes GCC omits the frame pointer instructions
in the resolver unless this optimization is explictly disabled.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2267598.
2024-03-09 09:20:57 +08:00
Lasse Collin 3007e74ef2 liblzma: Fix a typo in a comment in the RISC-V filter. 2024-03-05 23:23:16 +02:00
Jia Tan 72d2933bfa liblzma: Use attribute no_profile_instrument_function with ifunc.
Thanks to Sam James for determining this was the attribute needed to
workaround the GCC bug and for his version of the patch in Gentoo.
2024-03-05 01:54:30 +08:00
Jia Tan e5faaebbcf Build: Require attribute no_profile_instrument_function for ifunc usage.
Using __attribute__((__no_profile_instrument_function__)) on the ifunc
resolver works around a bug in GCC -fprofile-generate:
it adds profiling code even to ifunc resolvers which can make
the ifunc resolver crash at program startup. This attribute
was not introduced until GCC 7 and Clang 13, so ifunc won't
be used with prior versions of these compilers.

This bug was brought to our attention by:

    https://bugs.gentoo.org/925415

And was reported to upstream GCC by:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11411
2024-03-05 01:54:30 +08:00
Lasse Collin 7eeadd279a liblzma: Fix a comment in the RISC-V filter. 2024-03-04 19:23:18 +02:00
Lasse Collin 5f3d059529 CMake: Warn if translated man pages are missing. 2024-02-29 16:37:19 +02:00
Lasse Collin 4cd1042ee7 CMake: Warn if gettext tools and pre-created .gmo files are missing.
It's only done with CMake >= 3.20 and if library support
for translation was already found.

Sort of fixes: https://github.com/tukaani-project/xz/issues/82
2024-02-29 16:37:19 +02:00
Lasse Collin a94b42362c xz: Add comments. 2024-02-28 18:26:25 +02:00
Jia Tan bbf112e323 xz: Change logging level for thread reduction to highest verbosity only.
Now that multi threaded encoding is the default, users do not need to
see a warning message everytime the number of threads is reduced. On
some machines, this could happen very often. It is not unreasonable for
users to need to set double verbose mode to see this kind of
information.

To see these warning messages -vv or --verbose --verbose must be passed
to set xz into the highest possible verbosity mode.

These warnings had caused automated testing frameworks to fail when they
expected no output to stderr.

Thanks to Sebastian Andrzej Siewior for reporting this and for the
initial version of the patch.
2024-02-29 00:05:50 +08:00
Lasse Collin 649f644744 Fix sorting in THANKS. 2024-02-26 23:06:13 +02:00
Jia Tan 1255b7d849 Update THANKS. 2024-02-26 23:40:50 +08:00
Chien Wong eee579fff5 xz: Add missing RISC-V on the filter list in the man page
Signed-off-by: Chien Wong <m@xv97.com>
2024-02-26 23:36:04 +08:00
Jia Tan 328c52da8a Build: Fix Linux Landlock feature test in Autotools and CMake builds.
The previous Linux Landlock feature test assumed that having the
linux/landlock.h header file was enough. The new feature tests also
requires that prctl() and the required Landlock system calls are
supported.
2024-02-26 23:27:44 +08:00
Jia Tan eb8ad59e9b Tests: Add test_microlzma to .gitignore and CMakeLists.txt. 2024-02-26 20:06:10 +08:00
Jia Tan 9eed1b9a3a Tests: Correct license header in test_microlzma.c. 2024-02-26 19:56:25 +08:00
Jia Tan 8bf9f72ee1 Fix typos in NEWS and CMakeLists. 2024-02-25 21:41:55 +08:00
Jia Tan 5d8d915ebe Bump version and soname for 5.7.0alpha.
Like 5.5.0alpha, 5.7.0alpha won't be released, it's just to mark that
the branch is not stable.

Once again there is no API/ABI stability for new features in devel
versions. The major soname won't be bumped even if API/ABI of new
features breaks between devel releases.
2024-02-24 16:30:06 +08:00
Jia Tan a18fb1edef Add NEWS for 5.6.0. 2024-02-24 15:50:36 +08:00
Jia Tan 24355c5280 Translations: Remove obsolete and fuzzy matches from some translations.
The French and Brazilian Portuguese man page translations have not been
updated since the switch from public domain to 0BSD. The old GPLv2
strings have now been removed from these files.
2024-02-22 22:27:01 +08:00
Jia Tan 02ca4a7d7b Translations: Patch man pages to avoid fuzzy matches.
This will be fixed in the next round of translations, but this avoids
having a fuzzy match or not fixing the English version.
2024-02-21 00:31:54 +08:00
Jia Tan 898aad9fc7 xzmore: Fix typo in xzmore.1.
Thanks to Yuri Chornoivan.
2024-02-21 00:30:43 +08:00
Jia Tan 5631aa206c Translations: Update the Vietnamese translation. 2024-02-24 12:12:16 +08:00
Jia Tan a65fd7ce9d Translations: Update the Esperanto translation. 2024-02-24 12:06:40 +08:00
Jia Tan cf44e4b7f5 Tests: Add a few test files. 2024-02-23 23:09:59 +08:00
Jia Tan 39f4a1a86a Tests: Add MicroLZMA test. 2024-02-23 20:58:36 +08:00
Jia Tan adaacafde6 Build: Define HAVE_MICROLZMA when it is configured. 2024-02-23 20:57:59 +08:00
Jia Tan eea78216d2 xz: Fix Capsicum sandbox compile error.
user_abort_pipe[] was still being used instead of the parameters.
2024-02-23 20:27:15 +08:00
Jia Tan 32b0a3ce19 Build: Fix ARM64 CRC32 instruction feature test.
Old versions of Clang reported the unsupported function attribute and
__crc32d() function as warnings instead of errors, so the feature test
passed when it shouldn't have, causing a compile error at build time.
-Werror was added to this feature test to fix this. The change is not
needed for CMake because check_c_source_compiles() also performs
linking and the error is caught then.

Thanks to Sebastian Andrzej Siewior for reporting this.
2024-02-23 16:12:32 +08:00
Lasse Collin 4c81c9611f CMake: Add LOCALEDIR to the windres workaround.
LOCALEDIR may contain spaces like in "C:\Program Files".
2024-02-22 19:16:35 +02:00
Lasse Collin de4337fd89 xz: Landlock: Fix error message if input file is a directory.
If xz is given a directory, it should look like this:

    $ xz /usr/bin
    xz: /usr/bin: Is a directory, skipping

The Landlock rules didn't allow opening directories for reading:

    $ xz /usr/bin
    xz: /usr/bin: Permission denied

The simplest fix was to allow opening directories for reading.
While it's a bit silly to allow it solely for the error message,
it shouldn't make the sandbox significantly weaker.

The single-file use case (like when called from GNU tar) is
still as strict as possible: all Landlock restrictions are
enabled before (de)compression starts.
2024-02-22 15:18:25 +02:00
Lasse Collin 120da10ae1 liblzma: Disable branchless C version in range decoder.
Thanks to Sebastian Andrzej Siewior and Sam James for
benchmarking on various systems.
2024-02-22 14:41:29 +02:00
Lasse Collin 00440f52be INSTALL: Clarify that --disable-assembler affects only 32-bit x86. 2024-02-21 17:41:32 +02:00
Lasse Collin 11405be84e Windows: build.bash: Include COPYING.0BSD in the package. 2024-02-21 16:57:20 +02:00
Lasse Collin c27cf64e3e Windows: build.bash: include liblzma-crt-mixing.txt in the package. 2024-02-21 16:57:20 +02:00
Lasse Collin 8d38941bae Windows: Major update to Windows build instructions. 2024-02-21 16:57:20 +02:00
Lasse Collin 4b5b0d3523 Windows: Update windows/README-Windows.txt.
It's for binary packages built with windows/build.bash.
2024-02-21 16:57:20 +02:00
Lasse Collin 1ee716f740 Windows: Update windows/build.bash.
Support for the old MinGW was dropped. Only MinGW-w64 with GCC
is supported now.

The script now supports also cross-compilation from GNU/Linux
(tests are not run). MSYS2 and also the old MSYS 1.0.11 work
for building on Windows. The i686 and x86_64 toolchains must
be in PATH to build both 32-bit and 64-bit versions.

Parallel builds are done if "nproc" from GNU coreutils is available.

MinGW-w64 runtime copyright information file was renamed from
COPYING-Windows.txt to COPYING.MinGW-w64-runtime.txt which
is the filename used by MinGW-w64 itself. Its existence
is now mandatory, it's checked at the beginning of the script.

The file TODO is no longer copied to the package.
2024-02-20 21:04:29 +02:00
Jia Tan 60462e4260 Translations: Update the Romanian man page translations. 2024-02-20 23:32:22 +08:00
Jia Tan 10d733e5b8 Translations: Update the Korean man page translations. 2024-02-20 23:30:25 +08:00
Jia Tan 797a34b72a Translations: Update the Spanish translation. 2024-02-20 21:03:53 +08:00
Jia Tan 5c3751d019 Translations: Update the Romanian translation. 2024-02-20 20:18:07 +08:00
Jia Tan e2d31154ec Translations: Update the Croatian translation. 2024-02-20 20:15:50 +08:00
Jia Tan 704500f994 Translations: Update the German man page translations. 2024-02-20 20:05:44 +08:00
Jia Tan 1cfd3dca3f Translations: Update the German translation. 2024-02-20 19:58:25 +08:00
Jia Tan 28b9b3f16c Translations: Update the Hungarian translation. 2024-02-20 19:56:52 +08:00
Lasse Collin 00b06cd0af CMake: Fix building of lzmainfo when translations are enabled. 2024-02-19 16:48:18 +02:00
Lasse Collin b0d1422b60 CMake: Don't assume that -fvisibility=hidden is supported outside Windows.
The original code was good enough for supporting GNU/Linux
and a few others but it wasn't very portable.

CMake doesn't support Solaris Studio's -xldscope=hidden.
If it ever does, things should still work with this commit
as Solaris Studio supports not only its own __global but also
the GNU C __attribute__((visibility("default"))). Support for the
attribute was added in 2007 to Sun Studio 12 compiler version 5.9.
2024-02-19 16:28:49 +02:00
Lasse Collin 2ced9d34be CMake: Revise the component splitting. 2024-02-19 16:28:49 +02:00
Lasse Collin 426bdc709c CMake: Update the main comment and document CMAKE_BUILD_TYPE=Release. 2024-02-19 16:28:49 +02:00
Lasse Collin 4430e075f7 CMake: Use -O2 instead of -O3 in CMAKE_BUILD_TYPE=Release.
-O3 doesn't seem useful for speed but it makes the code bigger.
CMake makes is difficult for users to simply override the
optimization level: CFLAGS / CMAKE_C_FLAGS aren't helpful because
they go before CMAKE_C_FLAGS_RELEASE. Of course, users can override
CMAKE_C_FLAGS_RELEASE directly but then they have to remember to
add also -DNDEBUG to disable assertions.

This commit changes -O3 to -O2 in CMAKE_C_FLAGS_RELEASE if and only if
CMAKE_C_FLAGS_RELEASE cache variable doesn't already exist. So if
a custom value is passed on the command line (or reconfiguring an
already-configured build), the cache variable won't be modified.
2024-02-19 16:28:49 +02:00
Lasse Collin 025eb6d787 CMake: Handle symbol versioning on MicroBlaze specially.
This is to match configure.ac.
2024-02-19 16:28:49 +02:00
Lasse Collin 2edd1a35b2 CMake: Keep build working even if lib/*.[ch] are removed. 2024-02-19 12:21:37 +02:00
Lasse Collin d753e2ce47 CMake: Install documentation. 2024-02-19 12:21:37 +02:00
Lasse Collin 7a0405bea9 CMake: Bump maximum policy version to 3.28.
CMP0154 doesn't affect us since we don't use FILE_SET.
2024-02-19 12:21:37 +02:00
Lasse Collin c2264ffbe3 CMake: Build lzmainfo. 2024-02-19 12:21:37 +02:00
Lasse Collin 998d0b2953 CMake: Build lzmadec. 2024-02-19 12:21:37 +02:00
Lasse Collin 74e8bc7417 CMake: Add test_scripts.sh to the tests.
In contrast to Automake, skipping of this test when decoders
are disabled is handled at CMake side instead of test_scripts.sh
because CMake-build doesn't create config.h.
2024-02-19 12:21:37 +02:00
Lasse Collin 4808f238a7 CMake: Install scripts.
Compared to the Autotools-based build, this has simpler handling
for the shell (@POSIX_SHELL@) and extra PATH entry for the scripts
(configure has --enable-path-for-scripts=PREFIX). The simpler
metho should be enough for non-ancient systems and Solaris.
2024-02-19 12:21:37 +02:00
Lasse Collin 3462362ebd Scripts: Use @PACKAGE_VERSION@ instead of @VERSION@.
PACKAGE_VERSION was already used in liblzma.pc.in.
This way only one version @foo@ is used.
2024-02-19 12:21:37 +02:00
Lasse Collin 67610c245b CMake: Simplify symlink creation and install translated man pages.
It helps that cmake_install.cmake doesn't parallelize installation
so symlinks can be created so that the target is always known to
exist (a requirement on Windows in some cases).

This bumps the minimum CMake version from 3.13 to 3.14 to use
file(CREATE_LINK ...). It could be made to work on 3.13 by
calling "cmake -E create_symlink" but it's uglier code and
slower in "make install". 3.14 should be a reasonable version
to require nowadays, especially since the Autotools build
is still the primary build system for most OSes.
2024-02-19 12:21:37 +02:00
Lasse Collin 50cc1d8a5a CMake: Add support for building and installing xz with translations.
If gettext tools are available, the .po files listed in po/LINGUAS
are converted using msgfmt. This allows building with translations
directly from xz.git without Autotools.

If gettext tools aren't available, the Autotools-created .gmo files
in the "po" directory will be used. This allows CMake-based build
to use translations from Autotools-generated tarball.

If translation support is found (Intl_FOUND) but both the
gettext tools and the pre-generated .gmo files are missing,
then "make" will fail.
2024-02-19 12:21:37 +02:00
Lasse Collin 746c471643 liblzma: Remove commented-out code. 2024-02-19 11:58:33 +02:00
Lasse Collin 4ce300ce08 xz: Delete old commented-out code. 2024-02-17 23:07:35 +02:00
Lasse Collin cae9a5e0bf xz: Use stricter pledge(2) and Landlock sandbox.
This makes these sandboxing methods stricter when no files are
created or deleted. That is, it's a middle ground between the
initial sandbox and the strictest single-file-to-stdout sandbox:
this allows opening files for reading but output has to go to stdout.
2024-02-17 23:07:35 +02:00
Lasse Collin 02e3505991 xz: Support Landlock ABI version 4.
Linux 6.7 added support for ABI version 4 which restricts
TCP connections which xz won't need and thus those can be
forbidden now. Since the ABI version is handled at runtime,
supporting version 4 won't cause any compatibility issues.

Note that new enough kernel headers are required to get
version 4 support enabled at build time.
2024-02-17 23:07:35 +02:00
Lasse Collin 374868d81d xz: Move sandboxing code to sandbox.c and improve Landlock sandbox.
Landlock is now always used just like pledge(2) is: first in more
permissive mode and later (under certain common conditions) in
a strict mode that doesn't allow opening more files.

I put pledge(2) first in sandbox.c because it's the simplest API
to use and still somewhat fine-grained for basic applications.
So it's the simplest thing to understand for anyone reading sandbox.c.
2024-02-17 23:07:35 +02:00
Lasse Collin 7312dfbb02 xz: Tweak comments. 2024-02-17 23:07:35 +02:00
Lasse Collin c701a5909a xz: Fix message_init() description.
Also explicitly initialize progress_automatic to make it clear
that it can be read before message_init() sets it. Static variable
was initialized to false by default already so this is only for
clarity.
2024-02-17 23:07:35 +02:00
Lasse Collin 9466306719 Build: Makefile.am: Sort EXTRA_DIST.
Dirs first, then files in case-sensitive ASCII order.
2024-02-17 19:42:30 +02:00
Lasse Collin f3440e78c9 Build: Don't install TODO. 2024-02-17 19:42:30 +02:00
Jia Tan a7a3b62e2a Translations: Update the Korean man page translations. 2024-02-18 01:09:11 +08:00
Jia Tan 9b315db2d5 Translations: Update the Korean translation. 2024-02-18 01:08:32 +08:00
Lasse Collin 56246607df Build: Install translated lzmainfo man pages.
All other translated man pages were being installed but
lzmainfo had been forgotten.
2024-02-17 16:23:14 +02:00
Lasse Collin f1d6b88aef liblzma: Avoid implementation-defined behavior in the RISC-V filter.
GCC docs promise that it works and a few other compilers do
too. Clang/LLVM is documented source code only but unsurprisingly
it behaves the same as others on x86-64 at least. But the
certainly-portable way is good enough here so use that.
2024-02-17 16:01:32 +02:00
Lasse Collin 843ddc5f61 liblzma: Wrap a line exceeding 80 chars. 2024-02-17 15:50:21 +02:00
Sebastian Andrzej Siewior e9053c9072 liblzma/rangecoder: Exclude x32 from the x86-64 optimisation.
The x32 port has a x86-64 ABI in term of all registers but uses only
32bit pointer like x86-32. The assembly optimisation fails to compile on
x32. Given the state of x32 I suggest to exclude it from the
optimisation rather than trying to fix it.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2024-02-17 15:50:21 +02:00
Jia Tan 3d198fb13b Translations: Update the Spanish translation. 2024-02-17 21:05:07 +08:00
Jia Tan cf278bfe60 Translations: Update the Swedish translation. 2024-02-17 20:43:29 +08:00
Jia Tan b0f1a41be5 Translations: Update the Polish translation. 2024-02-17 20:41:38 +08:00
Jia Tan d74ed48b30 Translations: Update the Ukrainian translation. 2024-02-17 20:41:02 +08:00
Lasse Collin 711e22d5c5 Translations: Use the same sentence in xz.pot-header that the TP uses. 2024-02-16 17:53:34 +02:00
Jia Tan fb5f6aaf18 Fix typos discovered by codespell. 2024-02-16 22:54:59 +08:00
Jia Tan c64723bbb0 Translations: Update the Ukrainian man page translations. 2024-02-16 22:54:59 +08:00
Jia Tan 2895195ed0 Translations: Update the Ukrainian translation. 2024-02-16 22:54:59 +08:00
Lasse Collin 4c20781f4c Translations: Omit the generic copyright line from man page headers. 2024-02-15 22:33:49 +02:00
Jia Tan 4323bc3e0c Update m4/.gitignore. 2024-02-15 22:26:43 +08:00
Lasse Collin 5394a1665b Tests: tuktest.h: Treat Clang separately from GCC.
Don't assume that Clang defines __GNUC__ as the extensions
are available in clang-cl as well (and possibly in some other
Clang variants?).
2024-02-14 21:12:58 +02:00
Lasse Collin cce7330b9f Tests: tuktest.h: Add a missing word to a comment. 2024-02-14 21:11:03 +02:00
Lasse Collin 5dd8fc9452 Tests: tuktest.h: Fix the comment about STest. 2024-02-14 21:10:10 +02:00
Jia Tan 6f1790254a Bump version for 5.5.2beta. 2024-02-15 01:53:40 +08:00
Lasse Collin 924fdeedf4 liblzma: Fix validate_map.sh.
Adding the SPDX license identifier changed the line numbers.
2024-02-14 19:46:11 +02:00
Lasse Collin 22140a2df6 Build: Start the generated ChangeLog from around 5.4.0 instead of 5.2.0. 2024-02-14 19:38:34 +02:00
Lasse Collin 0b8cefa136 Fixed NEWS for 5.5.2beta. 2024-02-14 19:27:46 +02:00
Lasse Collin a4557bad96 liblzma: Silence warnings in --enable-small build. 2024-02-14 19:21:45 +02:00
Lasse Collin 38edf47323 Build: Install COPYING.0BSD as part of docs. 2024-02-14 19:15:58 +02:00
Lasse Collin b74e10bd83 Docs: List COPYING.0BSD in README. 2024-02-14 19:15:34 +02:00
Lasse Collin dfdb60ffe9 Docs: Include doc/examples/11_file_info.c in tarballs.
It was added in 2017 in c2e29f06a7
but it never got into any release tarballs because it was
forgotten to be added to Makefile.am.
2024-02-14 19:11:48 +02:00
Lasse Collin 160b686264 liblzma: Silence a warning. 2024-02-14 19:05:58 +02:00
Lasse Collin eeedd4d092 Add NEWS for 5.5.2beta. 2024-02-14 18:32:27 +02:00
Lasse Collin 8af7db854f xz: Mention lzmainfo if trying to use 'lzma --list'.
This kind of fixes the problem reported here:
https://bugs.launchpad.net/ubuntu/+source/xz-utils/+bug/1291020
2024-02-14 18:31:16 +02:00
Lasse Collin 0668907ff7 liblzma: Add comments. 2024-02-14 18:31:16 +02:00
Lasse Collin 109f1913d4 Scripts: Add lz4 support to xzgrep and xzdiff. 2024-02-14 18:31:16 +02:00
Lasse Collin de55485cb2 liblzma: Choose the range decoder variants using a bitmask macro. 2024-02-14 18:31:16 +02:00
Lasse Collin 0709c2b2d7 xz: Fix outdated threading related info on the man page. 2024-02-14 18:31:16 +02:00
Lasse Collin 3182a330c1 liblzma: Range decoder: Add x86-64 inline assembly.
It's compatible with GCC and Clang.
2024-02-14 18:31:16 +02:00
Lasse Collin cba2edc991 liblzma: Range decoder: Add branchless C code.
It's used only for basic bittrees and fixed-size reverse bittree
because those showed a clear benefit on x86-64 with GCC and Clang.
The other methods were more mixed and thus are commented out but
they should be tested on other archs.
2024-02-14 18:31:16 +02:00
Lasse Collin e290a72d6d liblzma: Clarify a comment. 2024-02-14 18:31:16 +02:00
Lasse Collin 5e04706b91 liblzma: LZMA decoder: Optimize loop comparison.
But now it needs one more local variable.
2024-02-14 18:31:16 +02:00
Lasse Collin 88276f9f2c liblzma: Optimize literal_subcoder() macro slightly. 2024-02-14 18:31:16 +02:00
Lasse Collin 5938f6de4d liblzma: LZ decoder: Add unlikely(). 2024-02-14 18:31:16 +02:00
Lasse Collin 9c252e3ed0 liblzma: LZ decoder: Remove a useless unlikely(). 2024-02-14 18:31:16 +02:00
Lasse Collin f3872a5947 liblzma: Optimize LZ decoder slightly.
Now extra buffer space is reserved so that repeating bytes for
any single match will never need to copy from two places (both
the beginning and the end of the buffer). This simplifies
dict_repeat() and helps a little with speed.

This seems to reduce .lzma decompression time about 2 %, so
with .xz and CRC it could be slightly less. The small things
add up still.
2024-02-14 18:31:16 +02:00
Lasse Collin eb518446e5 liblzma: LZMA decoder: Get rid of next_state[].
It's not completely obvious if this is better in the decoder.
It should be good if compiler can avoid creating a branch
(like using CMOV on x86).

This also makes lzma_encoder.c use the new macros.
2024-02-14 18:31:16 +02:00
Lasse Collin e0c0ee475c liblzma: LZMA decoder improvements.
This adds macros for bittree decoding which prepares the code
for alternative C versions and inline assembly.
2024-02-14 18:31:16 +02:00
Jia Tan de5c5e4176 liblzma: Creates Non-resumable and Resumable modes for lzma_decoder.
The new decoder resumes the first decoder loop in the Resumable mode.
Then, the code executes in Non-resumable mode until it detects that it
cannot guarantee to have enough input/output to decode another symbol.

The Resumable mode is how the decoder has always worked. Before decoding
every input bit, it checks if there is enough space and will save its
location to be resumed later. When the decoder has more input/output,
it jumps back to the correct sequence in the Resumable mode code.

When the input/output buffers are large, the Resumable mode is much
slower than the Non-resumable because it has more branches and is harder
for the compiler to optimize since it is in a large switch block.

Early benchmarking shows significant time improvement (8-10% on gcc and
clang x86) by using the Non-resumable code as much as possible.
2024-02-14 18:31:16 +02:00
Jia Tan e446ab7a18 liblzma: Creates separate "safe" range decoder mode.
The new "safe" range decoder mode is the same as old range decoder, but
now the default behavior of the range decoder will not check if there is
enough input or output to complete the operation. When the buffers are
close to fully consumed, the "safe" operations must be used instead. This
will improve speed because it will reduce the number of branches needed
for most of the range decoder operations.
2024-02-14 18:31:16 +02:00
Lasse Collin 7f6d9ca329 doxygen/footer.html: Add missing closing tags and don't open a new tab.
The footer template from Doxygen has the closing </body> </html>
as Doxygen doesn't add them otherwise.

target="_blank" was omitted as it's not useful here but
it can be slightly annoying as one cannot just go back
in the browser history.

Since the footer links to the license file in the same
directory and not to CC website, the rel attributes
can be omitted.
2024-02-14 18:31:16 +02:00
Lasse Collin 26d1527d34 Tweak the expressions in AUTHORS. 2024-02-14 18:31:16 +02:00
Lasse Collin d231d56580 Translations: Add the man page translators into man page header comment.
It looked odd to only have the original English authors listed
in the header comments of the translated files.
2024-02-14 18:31:16 +02:00
Lasse Collin 6d35fcb936 Translations: Translate also messages of lzmainfo.
lzmainfo has had translation support since 2009 at least but
it was never added to po/POTFILES.in so the messages weren't
translated. It's a very rarely needed tool so it's not too bad.

This also adds src/xz/mytime.c to po/POTFILES.in although there
are no translatable strings. It's simpler this way so that it
won't be forgotten if strings were ever added to that file.
2024-02-14 18:31:16 +02:00
Lasse Collin a9f369dd54 Translations: Add custom .pot header with SPDX license identifier.
The same is used for both po/xz.pot and po4a/xz-man.pot.
2024-02-14 18:31:16 +02:00
Lasse Collin 469cd6653b Translations: po4a/update-po: Add copyright notice to xz-man.pot.
All man pages are under 0BSD now so this is simple now.
2024-02-14 18:31:16 +02:00
Lasse Collin 28ce45e38f Update COPYING about the man pages of the scripts. 2024-02-14 18:31:16 +02:00
Lasse Collin e48287bf51 xzdiff, xzgrep, and xzmore: Rewrite the man pages.
The main reason is a kind of silly one:

xz-man.pot contains strings from all man pages in XZ Utils.
The man pages of xzdiff, xzgrep, and xzmore were under GPLv2
and the rest under 0BSD. Thus xz-man.pot contained strings
under two licences. po4a creates the translated man pages
from the combined 0BSD+GPLv2 xz-man.pot.

I haven't liked this mixing in xz-man.pot but the
Translation Project requires that all man pages must be
in the same .pot file. So a separate xz-man-gpl.pot
wasn't an option.

Since these man pages are short, rewriting them was quick enough.
Now xz-man.pot is entirely under 0BSD and marking the per-file
licenses is simpler.

As a bonus, some wording hopefully is now slightly better
although it's perhaps a matter of taste.

NOTE: In xzgrep.1, the EXIT STATUS section was written by me
in the commit d796b6d7fd so that's
why that section could be taken as is from the old xzgrep.1.
2024-02-14 18:31:16 +02:00
Lasse Collin 3e551b111b xzless: Update man page slightly.
The xz tool can decompress three file formats and xzless
has always supported uncompressed files too.
2024-02-14 18:31:16 +02:00
Lasse Collin 40f36da226 Translations: Change po/Makevars to add a copyright notice to po/xz.pot. 2024-02-14 18:31:16 +02:00
Lasse Collin 24192854e2 Translations: Update po/Makevars to use the template from gettext 0.22.4.
Also add SPDX license identifier now that there is a known license.
2024-02-14 18:31:16 +02:00
Lasse Collin b941549573 liblzma: Include the SPDX license identifier 0BSD to generated files.
Perhaps the generated files aren't even copyrightable but
using the same license for them as for the rest of the liblzma
keeps things more consistent for tools that look for license info.
2024-02-14 18:31:16 +02:00
Lasse Collin 8e4ec79483 liblzma: Fix compilation of price_tablegen.c.
It is built and run only manually so this didn't matter
unless one wanted to regenerate the price_table.c.
2024-02-14 18:31:16 +02:00
Lasse Collin e99bff3ffb Add SPDX license identifiers to GPL, LGPL, and FSFULLR files. 2024-02-14 18:31:16 +02:00
Lasse Collin 22af94128b Add SPDX license identifier into 0BSD source code files. 2024-02-14 18:31:16 +02:00
Lasse Collin 23de53421e liblzma: Sync the AUTHORS fix about SHA-256 to lzma.h. 2024-02-14 18:31:16 +02:00
Lasse Collin 689e0228ba Change most public domain parts to 0BSD.
Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt
were not touched.

COPYING.0BSD was added.
2024-02-14 18:31:12 +02:00
Lasse Collin 76946dc433 Fix SHA-256 authors.
The initial commit 5d018dc035
in 2007 had a comment in sha256.c that the code is based on
Crypto++ Library 5.5.1. In 2009 the Authors list in sha256.c
and the AUTHORS file was updated with information that the
code had come from Crypto++ but via 7-Zip. I know I had viewed
7-Zip's SHA-256 code but back then the C code has been identical
enough with Crypto++, so I don't why I thought the author info
would need that extra step via 7-Zip for this single file.

Another error is that I had mixed sha.* and shacal2.* files
when checking for author info in Crypto++. The shacal2.* files
aren't related to liblzma's sha256.c and thus Kevin Springle's
code in Crypto++ isn't either.
2024-02-14 15:23:00 +02:00
Lasse Collin 21d9cbae9e Remove macosx/build.sh.
It was last updated in 2013.
2024-02-14 15:23:00 +02:00
Lasse Collin eac2c3c67f Doc: Remove doc/examples_old.
It was good to keep these around in parallel with the newer examples
but I think it's OK to remove the old ones at this point.
2024-02-14 15:23:00 +02:00
Jia Tan 89ea1a22f4 Tests: Add RISC-V filter support in a few places. 2024-02-13 23:33:27 +08:00
Jia Tan 45663443eb liblzma: Fix build error if only RISC-V BCJ filter is enabled.
If any other BCJ filter was enabled for encoding or decoding, then this
was not a problem.
2024-02-13 23:33:21 +08:00
Jia Tan 2f15597d67 Translations: Update the Korean translation. 2024-02-13 23:26:55 +08:00
Jia Tan df873143ad Translations: Update the Korean man page translations. 2024-02-13 01:55:53 +08:00
Jia Tan b3f415eddb Translations: Update the Chinese (simplified) translation. 2024-02-13 01:53:33 +08:00
Lasse Collin 9860d418d2 xzless: Use ||- in LESSOPEN with with "less" 451 and newer. 2024-02-09 23:21:01 +02:00
Lasse Collin fd0692b052 xzless: Use --show-preproc-errors with "less" 632 and newer.
This makes "less" show a warning if a decompression error occurred.
2024-02-09 23:00:05 +02:00
Jia Tan adb073da76 liblzma: Fix typo discovered by codespell. 2024-02-09 23:59:54 +08:00
Jia Tan 55d9fc883d Translations: Update the Swedish translation. 2024-02-09 20:01:06 +08:00
Jia Tan 55ba4a1ea3 Translations: Update the Spanish translation. 2024-02-08 20:09:04 +08:00
Jia Tan 7f2293cd80 Translations: Update the Spanish translation. 2024-02-07 21:34:35 +08:00
Jia Tan f4af2036bc Translations: Update the Polish translation. 2024-02-07 21:28:32 +08:00
Jia Tan e5e93bb816 Translations: Update the German translation. 2024-02-07 19:40:12 +08:00
Jia Tan 28f18ff8e2 Translations: Update the German man page translations. 2024-02-07 19:27:25 +08:00
Jia Tan cabfbc7947 Translations: Update the Romanian translation. 2024-02-06 23:44:06 +08:00
Jia Tan bf20c94f5d Translations: Update the Romanian man page translations. 2024-02-06 23:45:02 +08:00
Jia Tan 7c25ec9feb Translations: Update the Ukrainian translation. 2024-02-07 20:56:57 +08:00
Jia Tan b3523250e9 Translations: Update the Ukrainian man page translations. 2024-02-06 23:30:03 +08:00
Jia Tan a5c177f514 Update AUTHORS. 2024-02-02 01:39:28 +08:00
Jia Tan 7f68a68c19 liblzma: Update Authors list in crc32_arm64.h. 2024-02-02 01:38:51 +08:00
Jia Tan 97f9ba50b8 liblzma: Check HAVE_USABLE_CLMUL before omitting CRC32 table.
This was split from the prior commit so it could be easily applied to
the 5.4 branch.

Closes: https://github.com/tukaani-project/xz/pull/77
2024-02-01 20:09:11 +08:00
Jia Tan ca9015f4de liblzma: Check HAVE_USABLE_CLMUL before omitting CRC64 table.
If liblzma is configured with --disable-clmul-crc
CFLAGS="-msse4.1 -mpclmul", then it will fail to compile because the
generic version must be used but the CRC tables were not included.
2024-02-01 20:09:11 +08:00
Jia Tan 2f1552a91c liblzma: Only use ifunc in crcXX_fast.c if its needed.
The code was using HAVE_FUNC_ATTRIBUTE_IFUNC instead of CRC_USE_IFUNC.
With ARM64, ifunc is incompatible because it requires non-inline
function calls for runtime detection.
2024-02-01 20:09:11 +08:00
Jia Tan 30a25f3742 Docs: Add --disable-arm64-crc32 description to INSTALL. 2024-02-01 20:09:11 +08:00
Jia Tan 1940f0ec28 liblzma: Omit CRC tables when not needed with ARM64 optimizations.
This is similar to the existing x86-64 CLMUL conditions to omit the
tables. They were slightly refactored to improve readability.
2024-02-01 20:09:11 +08:00
Jia Tan 761f5b69a4 liblzma: Rename crc32_aarch64.h to crc32_arm64.h.
Even though the proper name for the architecture is aarch64, this
project uses ARM64 throughout. So the rename is for consistency.

Additionally, crc32_arm64.h was slightly refactored for the following
changes:

   * Added MSVC, FreeBSD, and macOS support in
     is_arch_extension_supported().

   * crc32_arch_optimized() now checks the size when aligning the
     buffer.

   * crc32_arch_optimized() loop conditions were slightly modified to
     avoid both decrementing the size and incrementing the buffer
     pointer.

   * Use the intrinsic wrappers defined in <arm_acle.h> because GCC and
     Clang name them differently.

   * Minor spacing and comment changes.
2024-02-01 20:09:11 +08:00
Jia Tan 455a08609c liblzma: Refactor crc_common.h.
The CRC_GENERIC is now split into CRC32_GENERIC and CRC64_GENERIC, since
the ARM64 optimizations will be different between CRC32 and CRC64.

For the same reason, CRC_ARCH_OPTIMIZED is split into
CRC32_ARCH_OPTIMIZED and CRC64_ARCH_OPTIMIZED.

ifunc will only be used with x86-64 CLMUL because the runtime detection
methods needed with ARM64 are not compatible with ifunc.
2024-02-01 20:09:11 +08:00
Jia Tan 61908e8160 CMake: Add support for ARM64 CRC32 instruction detection. 2024-02-01 20:09:11 +08:00
Jia Tan c5f6d79cc9 Build: Add support for ARM64 CRC32 instruction detection.
This adds --enable-arm64-crc32/--disable-arm64-crc32 (enabled by
default) for using the ARM64 CRC32 instruction. This can be disabled if
one knows the binary will never need to run on an ARM64 machine
with this instruction extension.
2024-02-01 20:09:09 +08:00
Chenxi Mao 849d0f282a Speed up CRC32 calculation on ARM64
The CRC32 instructions in ARM64 can calculate the CRC32 result
for 8 bytes in a single operation, making the use of ARM64
instructions much faster compared to the general CRC32 algorithm.

Optimized CRC32 will be enabled if ARM64 has CRC extension
running on Linux.

Signed-off-by: Chenxi Mao <chenxi.mao2013@gmail.com>
2024-01-27 21:49:26 +08:00
378 changed files with 21150 additions and 12975 deletions

8
.github/SECURITY.md vendored
View File

@ -16,13 +16,7 @@ the chance that the exploit will be used before a patch is released.
You may submit a report by emailing us at You may submit a report by emailing us at
[xz@tukaani.org](mailto:xz@tukaani.org), or through [xz@tukaani.org](mailto:xz@tukaani.org), or through
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new). [Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
While both options are available, we prefer email. In any case, please While both options are available, we prefer email.
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 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 basis. As such, please give us 90 days to work on a fix before

View File

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

View File

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

1
.gitignore vendored
View File

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

40
AUTHORS
View File

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

File diff suppressed because it is too large Load Diff

108
COPYING
View File

@ -6,77 +6,95 @@ XZ Utils Licensing
is a rough summary of which licenses apply to which parts of this is a rough summary of which licenses apply to which parts of this
package (but check the individual files to be sure!): package (but check the individual files to be sure!):
- liblzma is in the public domain. - liblzma is under the BSD Zero Clause License (0BSD).
- xz, xzdec, and lzmadec command line tools are in the public - The command line tools xz, xzdec, lzmadec, and lzmainfo are
domain unless GNU getopt_long had to be compiled and linked under 0BSD except that, on systems that don't have a usable
in from the lib directory. The getopt_long code is under getopt_long, GNU getopt_long is compiled and linked in from the
GNU LGPLv2.1+. 'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been - The scripts to grep, diff, and view compressed files have been
adapted from gzip. These scripts and their documentation are adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
under GNU GPLv2+. 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.
- All the documentation in the doc directory and most of the - Most of the XZ Utils specific documentation that is in
XZ Utils specific documentation files in other directories plain text files (like README, INSTALL, PACKAGERS, NEWS,
are in the public domain. 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.
Note: The JavaScript files (under the MIT license) have Note: The JavaScript files (under the MIT license) have
been removed from the Doxygen-generated HTML version of the been removed from the Doxygen output.
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:
"Documents produced by doxygen are derivative works - The XZ logo (xz-logo.png) included in the Doxygen-generated
derived from the input used in their production; documentation is under the Creative Commons BY-SA 4.0 license.
they are not affected by this license."
- The XZ logo included in the Doxygen documentation is under - Translated messages and man pages are under 0BSD except that
the Creative Commons BY-SA 4.0 license. some old translations are in the public domain.
- Translated messages are in the public domain. - Test files and test code in the 'tests' directory, and
debugging utilities in the 'debug' directory are under
the BSD Zero Clause License (0BSD).
- The build system contains public domain files, and files that - The GNU Autotools based build system contains files that are
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses.
in the binaries being built. These files don't affect the licensing of the binaries being
built.
- Test files and test code in the tests directory, and debugging - The extra directory contain files that are under various
utilities in the debug directory are in the public domain. free software licenses.
- The extra directory may contain public domain files, and files For the files under the BSD Zero Clause License (0BSD), if
that are under various free software licenses. a copyright notice is needed, the following is sufficient:
You can do whatever you want with the files that have been put into Copyright (C) The XZ Utils authors and contributors
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.
As usual, this software is provided "as is", without any warranty. If you copy significant amounts of 0BSD-licensed code from XZ Utils
If you copy significant amounts of public domain code from XZ Utils
into your project, acknowledging this somewhere in your software is into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but polite (especially if it is proprietary, non-free software), but
naturally it is not legally required. Here is an example of a good it is not legally required by the license terms. Here is an example
notice to put into "about box" or into documentation: of a good notice to put into "about box" or into documentation:
This software includes code from XZ Utils This software includes code from XZ Utils
<https://xz.tukaani.org/xz-utils/>. <https://xz.tukaani.org/xz-utils/>.
The following license texts are included in the following files: 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.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2 - COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3 - COPYING.GPLv3: GNU General Public License version 3
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0 - COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
International Public License International Public License
Note that the toolchain (compiler, linker etc.) may add some code A note about old XZ Utils releases:
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.
If you have questions, don't hesitate to ask the author(s) for more XZ Utils releases 5.4.6 and older and 5.5.1alpha have a
information. 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.

11
COPYING.0BSD Normal file
View File

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

View File

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

233
NEWS
View File

@ -2,6 +2,239 @@
XZ Utils Release Notes 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) 5.5.1alpha (2024-01-26)
* Added a new filter for RISC-V binaries. The filter can be used * Added a new filter for RISC-V binaries. The filter can be used

View File

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

1
README
View File

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

4
THANKS
View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# # SPDX-License-Identifier: 0BSD
############################################################################# #############################################################################
# #
# Get the version string from version.h and print it out without # Get the version string from version.h and print it out without
@ -9,9 +10,6 @@
# #
# Author: Lasse Collin # 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/ sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/

View File

@ -1,3 +1,5 @@
# SPDX-License-Identifier: 0BSD
############################################################################# #############################################################################
# #
# remove-ordinals.cmake # remove-ordinals.cmake
@ -16,9 +18,6 @@
# #
# Author: Lasse Collin # 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) file(READ "${INPUT_FILE}" STR)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files # tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
# #
# Author: Lasse Collin # 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) function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
# DEFINITIONS may be an empty string/list but it's fine here. There is # DEFINITIONS may be an empty string/list but it's fine here. There is

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments # tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles) include(CheckCSourceCompiles)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments # tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(TestBigEndian) include(TestBigEndian)

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_large_file_support.cmake # tuklib_large_file_support.cmake
# #
@ -8,9 +11,7 @@
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles) include(CheckCSourceCompiles)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments # tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists) include(CheckSymbolExists)

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments # tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
# #
@ -6,9 +9,7 @@
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles) include(CheckCSourceCompiles)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments # tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
# #
# Author: Lasse Collin # 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("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists) include(CheckSymbolExists)

View File

@ -1,12 +1,11 @@
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # SPDX-License-Identifier: 0BSD
############################################################################### ###############################################################################
# #
# Author: Lasse Collin # Process this file with autoconf to produce a configure script.
# #
# This file has been put into the public domain. # Author: Lasse Collin
# You can do whatever you want with this file.
# #
############################################################################### ###############################################################################
@ -380,6 +379,16 @@ AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc],
[], [enable_clmul_crc=yes]) [], [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 # # Size optimization #
##################### #####################
@ -700,61 +709,80 @@ fi
# --with-pic and --without-pic though. As long as neither --with-pic nor # --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 # --without-pic is used then we can use #ifdef PIC to detect if the file is
# being built for a shared library. # being built for a shared library.
if test "x$enable_symbol_versions" = xno ; then AS_IF([test "x$enable_symbol_versions" = xno], [
enable_symbol_versions=no enable_symbol_versions=no
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
elif test "x$enable_shared" = xno ; then ], [test "x$enable_shared" = xno], [
enable_symbol_versions=no enable_symbol_versions=no
AC_MSG_RESULT([no (not building a shared library)]) AC_MSG_RESULT([no (not building a shared library)])
else ], [
case "$host_cpu-$host_os" in # "yes" means that symbol version are to be used but we need to
microblaze*) # autodetect which variant to use.
# GCC 12 on MicroBlaze doesn't support __symver__ if test "x$enable_symbol_versions" = xyes ; then
# attribute. It's simplest and safest to use the case "$host_cpu-$host_os" in
# generic version on that platform since then only microblaze*)
# the linker script is needed. The RHEL/CentOS 7 # GCC 12 on MicroBlaze doesn't support
# compatibility symbols don't matter on MicroBlaze. # __symver__ attribute. It's simplest and
enable_symbol_versions=generic # safest to use the generic version on that
;; # platform since then only the linker script
*-linux*) # is needed. The RHEL/CentOS 7 compatibility
case "$pic_mode-$enable_static" in # symbols don't matter on MicroBlaze.
default-*) enable_symbol_versions=generic
# Use symvers if PIC is defined. ;;
have_symbol_versions_linux=2 *-linux*)
;; # NVIDIA HPC Compiler doesn't support symbol
*-no) # versioning but the linker script can still
# Not building static library. # be used.
# Use symvers unconditionally. AC_EGREP_CPP([use_generic_symbol_versioning],
have_symbol_versions_linux=1 [#ifdef __NVCOMPILER
;; use_generic_symbol_versioning
*) #endif],
AC_MSG_RESULT([]) [enable_symbol_versions=generic],
AC_MSG_ERROR([ [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([
On GNU/Linux, building both shared and static library at the same time On GNU/Linux, building both shared and static library at the same time
is not supported if --with-pic or --without-pic is used. is not supported if --with-pic or --without-pic is used.
Use either --disable-shared or --disable-static to build one type 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, 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.]) possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
;; ;;
esac esac
enable_symbol_versions=linux AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX], [$have_symbol_versions_linux],
[$have_symbol_versions_linux], [Define to 1 to if GNU/Linux-specific details
[Define to 1 to if GNU/Linux-specific details are unconditionally wanted for symbol
are unconditionally wanted for symbol versioning. Define to 2 to if these are wanted
versioning. Define to 2 to if these are wanted only if also PIC is defined (allows building
only if also PIC is defined (allows building both shared and static liblzma at the same
both shared and static liblzma at the same time with Libtool if neither --with-pic nor
time with Libtool if neither --with-pic nor --without-pic is used). This define must be
--without-pic is used). This define must be used together with liblzma_linux.map.])
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'])
enable_symbol_versions=generic fi
;;
esac
AC_MSG_RESULT([yes ($enable_symbol_versions)]) AC_MSG_RESULT([yes ($enable_symbol_versions)])
fi ])
AM_CONDITIONAL([COND_SYMVERS_LINUX], AM_CONDITIONAL([COND_SYMVERS_LINUX],
[test "x$enable_symbol_versions" = xlinux]) [test "x$enable_symbol_versions" = xlinux])
@ -793,8 +821,6 @@ AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
# cpuid.h may be used for detecting x86 processor features at runtime. # cpuid.h may be used for detecting x86 processor features at runtime.
AC_CHECK_HEADERS([immintrin.h cpuid.h]) 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. # Checks for typedefs, structures, and compiler characteristics.
@ -903,6 +929,13 @@ if test "x$enable_ifunc" = xauto ; then
#endif #endif
static void func(void) { return; } 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; } static void (*resolve_func (void)) (void) { return func; }
void func_ifunc (void) void func_ifunc (void)
__attribute__((__ifunc__("resolve_func"))); __attribute__((__ifunc__("resolve_func")));
@ -1089,6 +1122,58 @@ __m128i my_clmul(__m128i a)
AC_MSG_RESULT([$enable_clmul_crc]) 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. # Check for sandbox support. If one is found, set enable_sandbox=found.
# #
# About -fsanitize: Of our three sandbox methods, only Landlock is # About -fsanitize: Of our three sandbox methods, only Landlock is
@ -1113,12 +1198,37 @@ AS_CASE([$enable_sandbox],
) )
AS_CASE([$enable_sandbox], AS_CASE([$enable_sandbox],
[auto | landlock], [ [auto | landlock], [
AC_CHECK_HEADERS([linux/landlock.h], [ 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;
}
]])], [
enable_sandbox=found enable_sandbox=found
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([ AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
sandboxing. Use --disable-sandbox when using '-fsanitize'.])]) 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,9 +1,5 @@
## ## SPDX-License-Identifier: 0BSD
## Author: Lasse Collin ## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
EXTRA_DIST = \ EXTRA_DIST = \
translation.bash translation.bash

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,127 +0,0 @@
/*
* 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

@ -1,123 +0,0 @@
/*
* 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,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
############################################################################### ###############################################################################
# #
# Makefile to build XZ Utils using DJGPP # Makefile to build XZ Utils using DJGPP
# #
# Author: Lasse Collin # 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 # For debugging, set comment "#define NDEBUG 1" from config.h to enable

View File

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

View File

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

View File

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

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
# # SPDX-License-Identifier: 0BSD
############################################################################# #############################################################################
# #
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must # 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
@ -17,9 +18,6 @@
# #
# Author: Lasse Collin <lasse.collin@tukaani.org> # 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. # You can use 7z or 7za, both will work.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

1
m4/.gitignore vendored
View File

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

View File

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

View File

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

View File

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

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -7,13 +10,11 @@
# #
# Common checks for tuklib. # 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_DEFUN_ONCE([TUKLIB_COMMON], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -17,13 +20,11 @@
# GetSystemInfo() is used on Cygwin) # GetSystemInfo() is used on Cygwin)
# - pstat_getdynamic(): HP-UX # - 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_DEFUN_ONCE([TUKLIB_CPUCORES], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -11,13 +14,11 @@
# - Does the hardware support fast unaligned access to 16-bit, 32-bit, # - Does the hardware support fast unaligned access to 16-bit, 32-bit,
# and 64-bit integers # 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_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -15,13 +18,11 @@
# functions, but each function is put into a separate .c file so # functions, but each function is put into a separate .c file so
# that it is possible to pick only what is strictly needed. # 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_DEFUN_ONCE([TUKLIB_MBSTR], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -29,13 +32,11 @@
# - sysinfo() works on Linux/dietlibc and probably on other Linux # - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf(). # 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_DEFUN_ONCE([TUKLIB_PHYSMEM], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
# #
# SYNOPSIS # SYNOPSIS
# #
@ -11,13 +14,11 @@
# This .m4 file is needed allow this module to use glibc's # This .m4 file is needed allow this module to use glibc's
# program_invocation_name. # 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_DEFUN_ONCE([TUKLIB_PROGNAME], [
AC_REQUIRE([TUKLIB_COMMON]) AC_REQUIRE([TUKLIB_COMMON])

View File

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

View File

@ -1,113 +0,0 @@
#!/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,4 +1,10 @@
# SPDX-License-Identifier: FSFUL
# Makefile variables for PO directory in any package using GNU gettext. # 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. # Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE) DOMAIN = $(PACKAGE)
@ -8,7 +14,7 @@ subdir = po
top_builddir = .. top_builddir = ..
# These options get passed to xgettext. # These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
# This is the copyright holder that gets inserted into the header of the # 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 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@ -18,7 +24,14 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# or entity, or to disclaim their copyright. The empty string stands for # or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim # the public domain; in this case the translators are expected to disclaim
# their copyright. # their copyright.
COPYRIGHT_HOLDER = 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
# This is the email address or URL to which the translators shall report # This is the email address or URL to which the translators shall report
# bugs in the untranslated strings: # bugs in the untranslated strings:
@ -40,7 +53,35 @@ MSGID_BUGS_ADDRESS =
# message catalogs shall be used. It is usually empty. # message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES = EXTRA_LOCALE_CATEGORIES =
# Although you may need slightly wider terminal than 80 chars, it is # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# much nicer to edit the output of --help when this is set. # context. Possible values are "yes" and "no". Set this to yes if the
XGETTEXT_OPTIONS += --no-wrap # package uses functions taking also a message context, like pgettext(), or
MSGMERGE += --no-wrap # 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

View File

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

469
po/de.po

File diff suppressed because it is too large Load Diff

504
po/eo.po

File diff suppressed because it is too large Load Diff

510
po/es.po

File diff suppressed because it is too large Load Diff

650
po/hr.po

File diff suppressed because it is too large Load Diff

558
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

483
po/pl.po

File diff suppressed because it is too large Load Diff

534
po/ro.po

File diff suppressed because it is too large Load Diff

500
po/sv.po

File diff suppressed because it is too large Load Diff

511
po/uk.po

File diff suppressed because it is too large Load Diff

509
po/vi.po

File diff suppressed because it is too large Load Diff

7
po/xz.pot-header Normal file
View File

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

1
po4a/.gitignore vendored
View File

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

2115
po4a/de.po

File diff suppressed because it is too large Load Diff

4747
po4a/fr.po

File diff suppressed because it is too large Load Diff

2122
po4a/ko.po

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

2498
po4a/ro.po

File diff suppressed because it is too large Load Diff

2117
po4a/uk.po

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# # SPDX-License-Identifier: 0BSD
############################################################################# #############################################################################
# #
# Updates xz-man.pot and the *.po files, and generates translated man pages. # Updates xz-man.pot and the *.po files, and generates translated man pages.
@ -10,9 +11,6 @@
# #
# Author: Lasse Collin # 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 if type po4a > /dev/null 2>&1; then
@ -33,6 +31,25 @@ fi
PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1 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 # 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 # 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 # as long as this isn't run every time when "make" is run at the
@ -41,5 +58,13 @@ set -x
po4a --force --verbose \ po4a --force --verbose \
--package-name="XZ Utils" \ --package-name="XZ Utils" \
--package-version="$PACKAGE_VERSION" \ --package-version="$PACKAGE_VERSION" \
--copyright-holder="[See the headers in the input files.]" \ --copyright-holder="The XZ Utils authors and contributors" \
po4a.conf 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,9 +1,5 @@
## ## SPDX-License-Identifier: 0BSD
## Author: Lasse Collin ## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
SUBDIRS = liblzma xzdec SUBDIRS = liblzma xzdec

View File

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

View File

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

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file sysdefs.h /// \file sysdefs.h
@ -8,9 +10,6 @@
// //
// Author: Lasse Collin // 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 #ifndef LZMA_SYSDEFS_H

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