wok view busybox/stuff/busybox-1.22-zmodules.u @ rev 17367

get-foxit-reader: add cups to depends
author Richard Dunbar <mojo@slitaz.org>
date Thu Nov 20 21:01:38 2014 -0500 (2014-11-20)
parents e10394d67dd1
children
line source
1 Add LZMA_DEFAULT_MAGIC support
2 --- busybox-1.20/archival/libarchive/open_transformer.c
3 +++ busybox-1.20/archival/libarchive/open_transformer.c
4 @@ -132,6 +132,21 @@
5 /* .gz and .bz2 both have 2-byte signature, and their
6 * unpack_XXX_stream wants this header skipped. */
7 xread(fd, magic.b16, sizeof(magic.b16[0]));
8 +#if 1
9 +// SliTaz uses .gz suffix for lzma'd kernel modules
10 +#if BB_BIG_ENDIAN
11 +#define LZMA_DEFAULT_MAGIC 0x5d00
12 +#else
13 +#define LZMA_DEFAULT_MAGIC 0x5d
14 +#endif
15 + if (ENABLE_FEATURE_SEAMLESS_LZMA
16 + && magic.b16[0] == LZMA_DEFAULT_MAGIC
17 + ) {
18 + xlseek(fd, offset, SEEK_CUR);
19 + open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
20 + return 0;
21 + }
22 +#endif
23 if (ENABLE_FEATURE_SEAMLESS_GZ
24 && magic.b16[0] == GZIP_MAGIC
25 ) {
26 @@ -190,17 +205,17 @@
27 return fd;
29 sfx = strrchr(fname, '.');
30 - if (sfx) {
31 - sfx++;
32 - if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
33 - /* .lzma has no header/signature, just trust it */
34 - open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
35 - else
36 - if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
37 - || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
38 - || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
39 + if (sfx++ && ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0) {
40 + /* .lzma has no header/signature, just trust it */
41 + open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
42 + }
43 + else {
44 + if ((ENABLE_FEATURE_SEAMLESS_GZ)
45 + || (ENABLE_FEATURE_SEAMLESS_BZ2)
46 + || (ENABLE_FEATURE_SEAMLESS_LZMA)
47 + || (ENABLE_FEATURE_SEAMLESS_XZ)
48 ) {
49 - setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
50 + setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 0);
51 }
52 }