diff options
author | Sean Purcell <me@seanp.xyz> | 2017-04-26 11:10:17 -0700 |
---|---|---|
committer | Sean Purcell <iburinoc@gmail.com> | 2017-05-15 23:06:49 -0400 |
commit | cd63bdcda53a99389d994e5db2e19d8bbd74a62c (patch) | |
tree | 0750dce1688e92a280f1abfe6ea6e45f962ae746 | |
parent | 45232160e38fd41827712c0e8577835cb5287fd8 (diff) | |
download | libarchive-cd63bdcda53a99389d994e5db2e19d8bbd74a62c.tar.gz |
Fix alphabetical order, other small fixes
-rw-r--r-- | Makefile.am | 22 | ||||
-rw-r--r-- | build/cmake/config.h.in | 12 | ||||
-rw-r--r-- | cat/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | contrib/android/Android.mk | 4 | ||||
-rw-r--r-- | cpio/cmdline.c | 2 | ||||
-rw-r--r-- | cpio/cpio.c | 8 | ||||
-rw-r--r-- | cpio/cpio.h | 4 | ||||
-rw-r--r-- | cpio/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | cpio/test/test_option_zstd.c | 4 | ||||
-rw-r--r-- | libarchive/CMakeLists.txt | 4 | ||||
-rw-r--r-- | libarchive/archive.h | 4 | ||||
-rw-r--r-- | libarchive/archive_read_filter.3 | 10 | ||||
-rw-r--r-- | libarchive/archive_write_add_filter.c | 2 | ||||
-rw-r--r-- | libarchive/archive_write_add_filter_by_name.c | 2 | ||||
-rw-r--r-- | libarchive/archive_write_filter.3 | 10 | ||||
-rw-r--r-- | libarchive/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | libarchive/test/test_archive_write_add_filter_by_name.c | 10 | ||||
-rw-r--r-- | tar/bsdtar.c | 4 | ||||
-rw-r--r-- | tar/bsdtar.h | 4 | ||||
-rw-r--r-- | tar/cmdline.c | 2 | ||||
-rw-r--r-- | tar/creation_set.c | 2 | ||||
-rw-r--r-- | tar/test/CMakeLists.txt | 4 |
22 files changed, 63 insertions, 63 deletions
diff --git a/Makefile.am b/Makefile.am index 687f9d67..6569d8e1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -161,13 +161,13 @@ libarchive_la_SOURCES= \ libarchive/archive_read_support_filter_gzip.c \ libarchive/archive_read_support_filter_lrzip.c \ libarchive/archive_read_support_filter_lz4.c \ - libarchive/archive_read_support_filter_zstd.c \ libarchive/archive_read_support_filter_lzop.c \ libarchive/archive_read_support_filter_none.c \ libarchive/archive_read_support_filter_program.c \ libarchive/archive_read_support_filter_rpm.c \ libarchive/archive_read_support_filter_uu.c \ libarchive/archive_read_support_filter_xz.c \ + libarchive/archive_read_support_filter_zstd.c \ libarchive/archive_read_support_format_7zip.c \ libarchive/archive_read_support_format_all.c \ libarchive/archive_read_support_format_ar.c \ @@ -209,12 +209,12 @@ libarchive_la_SOURCES= \ libarchive/archive_write_add_filter_gzip.c \ libarchive/archive_write_add_filter_lrzip.c \ libarchive/archive_write_add_filter_lz4.c \ - libarchive/archive_write_add_filter_zstd.c \ libarchive/archive_write_add_filter_lzop.c \ libarchive/archive_write_add_filter_none.c \ libarchive/archive_write_add_filter_program.c \ libarchive/archive_write_add_filter_uuencode.c \ libarchive/archive_write_add_filter_xz.c \ + libarchive/archive_write_add_filter_zstd.c \ libarchive/archive_write_set_format.c \ libarchive/archive_write_set_format_7zip.c \ libarchive/archive_write_set_format_ar.c \ @@ -389,7 +389,6 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_gtar.c \ libarchive/test/test_compat_gzip.c \ libarchive/test/test_compat_lz4.c \ - libarchive/test/test_compat_zstd.c \ libarchive/test/test_compat_lzip.c \ libarchive/test/test_compat_lzma.c \ libarchive/test/test_compat_lzop.c \ @@ -405,6 +404,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_uudecode_large.c \ libarchive/test/test_compat_xz.c \ libarchive/test/test_compat_zip.c \ + libarchive/test/test_compat_zstd.c \ libarchive/test/test_empty_write.c \ libarchive/test/test_entry.c \ libarchive/test/test_entry_strmode.c \ @@ -556,13 +556,13 @@ libarchive_test_SOURCES= \ libarchive/test/test_write_filter_gzip_timestamp.c \ libarchive/test/test_write_filter_lrzip.c \ libarchive/test/test_write_filter_lz4.c \ - libarchive/test/test_write_filter_zstd.c \ libarchive/test/test_write_filter_lzip.c \ libarchive/test/test_write_filter_lzma.c \ libarchive/test/test_write_filter_lzop.c \ libarchive/test/test_write_filter_program.c \ libarchive/test/test_write_filter_uuencode.c \ libarchive/test/test_write_filter_xz.c \ + libarchive/test/test_write_filter_zstd.c \ libarchive/test/test_write_format_7zip.c \ libarchive/test/test_write_format_7zip_empty.c \ libarchive/test/test_write_format_7zip_large.c \ @@ -653,7 +653,6 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_lz4_B6BD.tar.lz4.uu \ libarchive/test/test_compat_lz4_B7.tar.lz4.uu \ libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu \ - libarchive/test/test_compat_zstd_1.tar.zst.uu \ libarchive/test/test_compat_lzip_1.tlz.uu \ libarchive/test/test_compat_lzip_2.tlz.uu \ libarchive/test/test_compat_lzma_1.tlz.uu \ @@ -682,6 +681,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_zip_5.zip.uu \ libarchive/test/test_compat_zip_6.zip.uu \ libarchive/test/test_compat_zip_7.xps.uu \ + libarchive/test/test_compat_zstd_1.tar.zst.uu \ libarchive/test/test_fuzz.cab.uu \ libarchive/test/test_fuzz.lzh.uu \ libarchive/test/test_fuzz_1.iso.Z.uu \ @@ -962,10 +962,10 @@ bsdtar_test_SOURCES= \ tar/test/test_extract_tar_lrz.c \ tar/test/test_extract_tar_lz.c \ tar/test/test_extract_tar_lz4.c \ - tar/test/test_extract_tar_zstd.c \ tar/test/test_extract_tar_lzma.c \ tar/test/test_extract_tar_lzo.c \ tar/test/test_extract_tar_xz.c \ + tar/test/test_extract_tar_zstd.c \ tar/test/test_format_newc.c \ tar/test/test_help.c \ tar/test/test_leading_slash.c \ @@ -990,7 +990,6 @@ bsdtar_test_SOURCES= \ tar/test/test_option_keep_newer_files.c \ tar/test/test_option_lrzip.c \ tar/test/test_option_lz4.c \ - tar/test/test_option_zstd.c \ tar/test/test_option_lzma.c \ tar/test/test_option_lzop.c \ tar/test/test_option_n.c \ @@ -1006,6 +1005,7 @@ bsdtar_test_SOURCES= \ tar/test/test_option_xattrs.c \ tar/test/test_option_xz.c \ tar/test/test_option_z.c \ + tar/test/test_option_zstd.c \ tar/test/test_patterns.c \ tar/test/test_print_longpath.c \ tar/test/test_stdio.c \ @@ -1125,10 +1125,10 @@ bsdcpio_test_SOURCES= \ cpio/test/test_extract_cpio_lrz.c \ cpio/test/test_extract_cpio_lz.c \ cpio/test/test_extract_cpio_lz4.c \ - cpio/test/test_extract_cpio_zstd.c \ cpio/test/test_extract_cpio_lzma.c \ cpio/test/test_extract_cpio_lzo.c \ cpio/test/test_extract_cpio_xz.c \ + cpio/test/test_extract_cpio_zstd.c \ cpio/test/test_format_newc.c \ cpio/test/test_gcpio_compat.c \ cpio/test/test_missing_file.c \ @@ -1148,7 +1148,6 @@ bsdcpio_test_SOURCES= \ cpio/test/test_option_l.c \ cpio/test/test_option_lrzip.c \ cpio/test/test_option_lz4.c \ - cpio/test/test_option_zstd.c \ cpio/test/test_option_lzma.c \ cpio/test/test_option_lzop.c \ cpio/test/test_option_m.c \ @@ -1160,6 +1159,7 @@ bsdcpio_test_SOURCES= \ cpio/test/test_option_xz.c \ cpio/test/test_option_y.c \ cpio/test/test_option_z.c \ + cpio/test/test_option_zstd.c \ cpio/test/test_owner_parse.c \ cpio/test/test_passthrough_dotdot.c \ cpio/test/test_passthrough_reverse.c @@ -1268,18 +1268,18 @@ bsdcat_test_SOURCES= \ cat/test/test_0.c \ cat/test/test_empty_gz.c \ cat/test/test_empty_lz4.c \ - cat/test/test_empty_zstd.c \ cat/test/test_empty_xz.c \ + cat/test/test_empty_zstd.c \ cat/test/test_error.c \ cat/test/test_error_mixed.c \ cat/test/test_expand_Z.c \ cat/test/test_expand_bz2.c \ cat/test/test_expand_gz.c \ cat/test/test_expand_lz4.c \ - cat/test/test_expand_zstd.c \ cat/test/test_expand_mixed.c \ cat/test/test_expand_plain.c \ cat/test/test_expand_xz.c \ + cat/test/test_expand_zstd.c \ cat/test/test_help.c \ cat/test/test_version.c diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index fd5e5ec5..50978ce9 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -695,9 +695,6 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `lz4' library (-llz4). */ #cmakedefine HAVE_LIBLZ4 1 -/* Define to 1 if you have the `zstd' library (-lzstd). */ -#cmakedefine HAVE_LIBZSTD 1 - /* Define to 1 if you have the `lzma' library (-llzma). */ #cmakedefine HAVE_LIBLZMA 1 @@ -728,6 +725,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine HAVE_LIBZ 1 +/* Define to 1 if you have the `zstd' library (-lzstd). */ +#cmakedefine HAVE_LIBZSTD 1 + /* Define to 1 if you have the <limits.h> header file. */ #cmakedefine HAVE_LIMITS_H 1 @@ -795,9 +795,6 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the <lz4.h> header file. */ #cmakedefine HAVE_LZ4_H 1 -/* Define to 1 if you have the <zstd.h> header file. */ -#cmakedefine HAVE_ZSTD_H 1 - /* Define to 1 if you have the <lzmadec.h> header file. */ #cmakedefine HAVE_LZMADEC_H 1 @@ -1185,6 +1182,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the <zlib.h> header file. */ #cmakedefine HAVE_ZLIB_H 1 +/* Define to 1 if you have the <zstd.h> header file. */ +#cmakedefine HAVE_ZSTD_H 1 + /* Define to 1 if you have the `_ctime64_s' function. */ #cmakedefine HAVE__CTIME64_S 1 diff --git a/cat/test/CMakeLists.txt b/cat/test/CMakeLists.txt index e76e92e6..4652ff37 100644 --- a/cat/test/CMakeLists.txt +++ b/cat/test/CMakeLists.txt @@ -11,18 +11,18 @@ IF(ENABLE_CAT AND ENABLE_TEST) test_0.c test_empty_gz.c test_empty_lz4.c - test_empty_zstd.c test_empty_xz.c + test_empty_zstd.c test_error.c test_error_mixed.c test_expand_Z.c test_expand_bz2.c test_expand_gz.c test_expand_lz4.c - test_expand_zstd.c test_expand_mixed.c test_expand_plain.c test_expand_xz.c + test_expand_zstd.c test_help.c test_version.c ) diff --git a/contrib/android/Android.mk b/contrib/android/Android.mk index 0d67f7ac..2f2cf563 100644 --- a/contrib/android/Android.mk +++ b/contrib/android/Android.mk @@ -68,13 +68,13 @@ libarchive_src_files := libarchive/archive_acl.c \ libarchive/archive_read_support_filter_gzip.c \ libarchive/archive_read_support_filter_lrzip.c \ libarchive/archive_read_support_filter_lz4.c \ - libarchive/archive_read_support_filter_zstd.c \ libarchive/archive_read_support_filter_lzop.c \ libarchive/archive_read_support_filter_none.c \ libarchive/archive_read_support_filter_program.c \ libarchive/archive_read_support_filter_rpm.c \ libarchive/archive_read_support_filter_uu.c \ libarchive/archive_read_support_filter_xz.c \ + libarchive/archive_read_support_filter_zstd.c \ libarchive/archive_read_support_format_7zip.c \ libarchive/archive_read_support_format_all.c \ libarchive/archive_read_support_format_ar.c \ @@ -112,12 +112,12 @@ libarchive_src_files := libarchive/archive_acl.c \ libarchive/archive_write_add_filter_gzip.c \ libarchive/archive_write_add_filter_lrzip.c \ libarchive/archive_write_add_filter_lz4.c \ - libarchive/archive_write_add_filter_zstd.c \ libarchive/archive_write_add_filter_lzop.c \ libarchive/archive_write_add_filter_none.c \ libarchive/archive_write_add_filter_program.c \ libarchive/archive_write_add_filter_uuencode.c \ libarchive/archive_write_add_filter_xz.c \ + libarchive/archive_write_add_filter_zstd.c \ libarchive/archive_write_set_format.c \ libarchive/archive_write_set_format_7zip.c \ libarchive/archive_write_set_format_ar.c \ diff --git a/cpio/cmdline.c b/cpio/cmdline.c index 4f371cee..c8fc30ea 100644 --- a/cpio/cmdline.c +++ b/cpio/cmdline.c @@ -75,7 +75,6 @@ static const struct option { { "list", 0, 't' }, { "lrzip", 0, OPTION_LRZIP }, { "lz4", 0, OPTION_LZ4 }, - { "zstd", 0, OPTION_ZSTD }, { "lzma", 0, OPTION_LZMA }, { "lzop", 0, OPTION_LZOP }, { "make-directories", 0, 'd' }, @@ -93,6 +92,7 @@ static const struct option { { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, + { "zstd", 0, OPTION_ZSTD }, { NULL, 0, 0 } }; diff --git a/cpio/cpio.c b/cpio/cpio.c index 17d12ff6..e80a0f3b 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -267,9 +267,9 @@ main(int argc, char *argv[]) break; case OPTION_LRZIP: case OPTION_LZ4: - case OPTION_ZSTD: case OPTION_LZMA: /* GNU tar, others */ case OPTION_LZOP: /* GNU tar, others */ + case OPTION_ZSTD: cpio->compress = opt; break; case 'm': /* POSIX 1997 */ @@ -541,15 +541,15 @@ mode_out(struct cpio *cpio) case OPTION_LZ4: r = archive_write_add_filter_lz4(cpio->archive); break; - case OPTION_ZSTD: - r = archive_write_add_filter_zstd(cpio->archive); - break; case OPTION_LZMA: r = archive_write_add_filter_lzma(cpio->archive); break; case OPTION_LZOP: r = archive_write_add_filter_lzop(cpio->archive); break; + case OPTION_ZSTD: + r = archive_write_add_filter_zstd(cpio->archive); + break; case 'j': case 'y': r = archive_write_add_filter_bzip2(cpio->archive); break; diff --git a/cpio/cpio.h b/cpio/cpio.h index 14a77c11..abf3628b 100644 --- a/cpio/cpio.h +++ b/cpio/cpio.h @@ -104,7 +104,6 @@ enum { OPTION_INSECURE, OPTION_LRZIP, OPTION_LZ4, - OPTION_ZSTD, OPTION_LZMA, OPTION_LZOP, OPTION_PASSPHRASE, @@ -112,7 +111,8 @@ enum { OPTION_PRESERVE_OWNER, OPTION_QUIET, OPTION_UUENCODE, - OPTION_VERSION + OPTION_VERSION, + OPTION_ZSTD, }; int cpio_getopt(struct cpio *cpio); diff --git a/cpio/test/CMakeLists.txt b/cpio/test/CMakeLists.txt index 3c0e661e..d0927a81 100644 --- a/cpio/test/CMakeLists.txt +++ b/cpio/test/CMakeLists.txt @@ -20,10 +20,10 @@ IF(ENABLE_CPIO AND ENABLE_TEST) test_extract_cpio_lrz test_extract_cpio_lz test_extract_cpio_lz4 - test_extract_cpio_zstd test_extract_cpio_lzma test_extract_cpio_lzo test_extract_cpio_xz + test_extract_cpio_zstd test_format_newc.c test_gcpio_compat.c test_missing_file.c @@ -43,7 +43,6 @@ IF(ENABLE_CPIO AND ENABLE_TEST) test_option_l.c test_option_lrzip.c test_option_lz4.c - test_option_zstd.c test_option_lzma.c test_option_lzop.c test_option_m.c @@ -55,6 +54,7 @@ IF(ENABLE_CPIO AND ENABLE_TEST) test_option_xz.c test_option_y.c test_option_z.c + test_option_zstd.c test_owner_parse.c test_passthrough_dotdot.c test_passthrough_reverse.c diff --git a/cpio/test/test_option_zstd.c b/cpio/test/test_option_zstd.c index 228356a7..29b8c78b 100644 --- a/cpio/test/test_option_zstd.c +++ b/cpio/test/test_option_zstd.c @@ -34,7 +34,7 @@ DEFINE_TEST(test_option_zstd) /* Create a file. */ assertMakeFile("f", 0644, "a"); - /* Archive it with lz4 compression. */ + /* Archive it with zstd compression. */ r = systemf("echo f | %s -o --zstd >archive.out 2>archive.err", testprog); p = slurpfile(&s, "archive.err"); @@ -75,7 +75,7 @@ DEFINE_TEST(test_option_zstd) goto done; } free(p); - /* Check that the archive file has an lz4 signature. */ + /* Check that the archive file has an zstd signature. */ p = slurpfile(&s, "archive.out"); assert(s > 2); assertEqualMem(p, "\x28\xb5\x2f\xfd", 4); diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index 1e561f3f..82dd56c9 100644 --- a/libarchive/CMakeLists.txt +++ b/libarchive/CMakeLists.txt @@ -82,13 +82,13 @@ SET(libarchive_SOURCES archive_read_support_filter_grzip.c archive_read_support_filter_lrzip.c archive_read_support_filter_lz4.c - archive_read_support_filter_zstd.c archive_read_support_filter_lzop.c archive_read_support_filter_none.c archive_read_support_filter_program.c archive_read_support_filter_rpm.c archive_read_support_filter_uu.c archive_read_support_filter_xz.c + archive_read_support_filter_zstd.c archive_read_support_format_7zip.c archive_read_support_format_all.c archive_read_support_format_ar.c @@ -130,12 +130,12 @@ SET(libarchive_SOURCES archive_write_add_filter_gzip.c archive_write_add_filter_lrzip.c archive_write_add_filter_lz4.c - archive_write_add_filter_zstd.c archive_write_add_filter_lzop.c archive_write_add_filter_none.c archive_write_add_filter_program.c archive_write_add_filter_uuencode.c archive_write_add_filter_xz.c + archive_write_add_filter_zstd.c archive_write_set_format.c archive_write_set_format_7zip.c archive_write_set_format_ar.c diff --git a/libarchive/archive.h b/libarchive/archive.h index 31807e43..f6f684ea 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -423,7 +423,6 @@ __LA_DECL int archive_read_support_filter_gzip(struct archive *); __LA_DECL int archive_read_support_filter_grzip(struct archive *); __LA_DECL int archive_read_support_filter_lrzip(struct archive *); __LA_DECL int archive_read_support_filter_lz4(struct archive *); -__LA_DECL int archive_read_support_filter_zstd(struct archive *); __LA_DECL int archive_read_support_filter_lzip(struct archive *); __LA_DECL int archive_read_support_filter_lzma(struct archive *); __LA_DECL int archive_read_support_filter_lzop(struct archive *); @@ -436,6 +435,7 @@ __LA_DECL int archive_read_support_filter_program_signature __LA_DECL int archive_read_support_filter_rpm(struct archive *); __LA_DECL int archive_read_support_filter_uu(struct archive *); __LA_DECL int archive_read_support_filter_xz(struct archive *); +__LA_DECL int archive_read_support_filter_zstd(struct archive *); __LA_DECL int archive_read_support_format_7zip(struct archive *); __LA_DECL int archive_read_support_format_all(struct archive *); @@ -773,7 +773,6 @@ __LA_DECL int archive_write_add_filter_grzip(struct archive *); __LA_DECL int archive_write_add_filter_gzip(struct archive *); __LA_DECL int archive_write_add_filter_lrzip(struct archive *); __LA_DECL int archive_write_add_filter_lz4(struct archive *); -__LA_DECL int archive_write_add_filter_zstd(struct archive *); __LA_DECL int archive_write_add_filter_lzip(struct archive *); __LA_DECL int archive_write_add_filter_lzma(struct archive *); __LA_DECL int archive_write_add_filter_lzop(struct archive *); @@ -782,6 +781,7 @@ __LA_DECL int archive_write_add_filter_program(struct archive *, const char *cmd); __LA_DECL int archive_write_add_filter_uuencode(struct archive *); __LA_DECL int archive_write_add_filter_xz(struct archive *); +__LA_DECL int archive_write_add_filter_zstd(struct archive *); /* A convenience function to set the format based on the code or name. */ diff --git a/libarchive/archive_read_filter.3 b/libarchive/archive_read_filter.3 index d07e940a..ef0a7017 100644 --- a/libarchive/archive_read_filter.3 +++ b/libarchive/archive_read_filter.3 @@ -33,12 +33,12 @@ .Nm archive_read_support_filter_compress , .Nm archive_read_support_filter_gzip , .Nm archive_read_support_filter_lz4 , -.Nm archive_read_support_filter_zstd , .Nm archive_read_support_filter_lzma , .Nm archive_read_support_filter_none , .Nm archive_read_support_filter_rpm , .Nm archive_read_support_filter_uu , .Nm archive_read_support_filter_xz , +.Nm archive_read_support_filter_zstd , .Nm archive_read_support_filter_program , .Nm archive_read_support_filter_program_signature .Nd functions for reading streaming archives @@ -62,8 +62,6 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_lz4 "struct archive *" .Ft int -.Fn archive_read_support_filter_zstd "struct archive *" -.Ft int .Fn archive_read_support_filter_lzma "struct archive *" .Ft int .Fn archive_read_support_filter_lzop "struct archive *" @@ -76,6 +74,8 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_xz "struct archive *" .Ft int +.Fn archive_read_support_filter_zstd "struct archive *" +.Ft int .Fo archive_read_support_filter_program .Fa "struct archive *" .Fa "const char *cmd" @@ -97,13 +97,13 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_read_support_filter_gzip , .Fn archive_read_support_filter_lrzip , .Fn archive_read_support_filter_lz4 , -.Fn archive_read_support_filter_zstd , .Fn archive_read_support_filter_lzma , .Fn archive_read_support_filter_lzop , .Fn archive_read_support_filter_none , .Fn archive_read_support_filter_rpm , .Fn archive_read_support_filter_uu , -.Fn archive_read_support_filter_xz +.Fn archive_read_support_filter_xz , +.Fn archive_read_support_filter_zstd , .Xc Enables auto-detection code and decompression support for the specified compression. diff --git a/libarchive/archive_write_add_filter.c b/libarchive/archive_write_add_filter.c index acefc69e..203f4142 100644 --- a/libarchive/archive_write_add_filter.c +++ b/libarchive/archive_write_add_filter.c @@ -48,12 +48,12 @@ struct { int code; int (*setter)(struct archive *); } codes[] = { ARCHIVE_FILTER_GRZIP, archive_write_add_filter_grzip }, { ARCHIVE_FILTER_LRZIP, archive_write_add_filter_lrzip }, { ARCHIVE_FILTER_LZ4, archive_write_add_filter_lz4 }, - { ARCHIVE_FILTER_ZSTD, archive_write_add_filter_zstd }, { ARCHIVE_FILTER_LZIP, archive_write_add_filter_lzip }, { ARCHIVE_FILTER_LZMA, archive_write_add_filter_lzma }, { ARCHIVE_FILTER_LZOP, archive_write_add_filter_lzip }, { ARCHIVE_FILTER_UU, archive_write_add_filter_uuencode }, { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, + { ARCHIVE_FILTER_ZSTD, archive_write_add_filter_zstd }, { -1, NULL } }; diff --git a/libarchive/archive_write_add_filter_by_name.c b/libarchive/archive_write_add_filter_by_name.c index f3971bf5..ffa633c9 100644 --- a/libarchive/archive_write_add_filter_by_name.c +++ b/libarchive/archive_write_add_filter_by_name.c @@ -52,12 +52,12 @@ struct { const char *name; int (*setter)(struct archive *); } names[] = { "gzip", archive_write_add_filter_gzip }, { "lrzip", archive_write_add_filter_lrzip }, { "lz4", archive_write_add_filter_lz4 }, - { "zstd", archive_write_add_filter_zstd }, { "lzip", archive_write_add_filter_lzip }, { "lzma", archive_write_add_filter_lzma }, { "lzop", archive_write_add_filter_lzop }, { "uuencode", archive_write_add_filter_uuencode }, { "xz", archive_write_add_filter_xz }, + { "zstd", archive_write_add_filter_zstd }, { NULL, NULL } }; diff --git a/libarchive/archive_write_filter.3 b/libarchive/archive_write_filter.3 index 896cd242..d6fa0713 100644 --- a/libarchive/archive_write_filter.3 +++ b/libarchive/archive_write_filter.3 @@ -36,14 +36,14 @@ .Nm archive_write_add_filter_gzip , .Nm archive_write_add_filter_lrzip , .Nm archive_write_add_filter_lz4 , -.Nm archive_write_add_filter_zstd , .Nm archive_write_add_filter_lzip , .Nm archive_write_add_filter_lzma , .Nm archive_write_add_filter_lzop , .Nm archive_write_add_filter_none , .Nm archive_write_add_filter_program , .Nm archive_write_add_filter_uuencode , -.Nm archive_write_add_filter_xz +.Nm archive_write_add_filter_xz , +.Nm archive_write_add_filter_zstd , .Nd functions enabling output filters .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -64,8 +64,6 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_write_add_filter_lz4 "struct archive *" .Ft int -.Fn archive_write_add_filter_zstd "struct archive *" -.Ft int .Fn archive_write_add_filter_lzip "struct archive *" .Ft int .Fn archive_write_add_filter_lzma "struct archive *" @@ -79,6 +77,8 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_write_add_filter_uuencode "struct archive *" .Ft int .Fn archive_write_add_filter_xz "struct archive *" +.Ft int +.Fn archive_write_add_filter_zstd "struct archive *" .Sh DESCRIPTION .Bl -tag -width indent .It Xo @@ -88,11 +88,11 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_write_add_filter_gzip , .Fn archive_write_add_filter_lrzip , .Fn archive_write_add_filter_lz4 , -.Fn archive_write_add_filter_zstd , .Fn archive_write_add_filter_lzip , .Fn archive_write_add_filter_lzma , .Fn archive_write_add_filter_lzop , .Fn archive_write_add_filter_xz , +.Fn archive_write_add_filter_zstd , .Xc The resulting archive will be compressed as specified. Note that the compressed output is always properly blocked. diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt index 93bab3f0..3bc8b775 100644 --- a/libarchive/test/CMakeLists.txt +++ b/libarchive/test/CMakeLists.txt @@ -54,7 +54,6 @@ IF(ENABLE_TEST) test_compat_gtar.c test_compat_gzip.c test_compat_lz4.c - test_compat_zstd.c test_compat_lzip.c test_compat_lzma.c test_compat_lzop.c @@ -70,6 +69,7 @@ IF(ENABLE_TEST) test_compat_uudecode_large.c test_compat_xz.c test_compat_zip.c + test_compat_zstd.c test_empty_write.c test_entry.c test_entry_strmode.c @@ -221,13 +221,13 @@ IF(ENABLE_TEST) test_write_filter_gzip_timestamp.c test_write_filter_lrzip.c test_write_filter_lz4.c - test_write_filter_zstd.c test_write_filter_lzip.c test_write_filter_lzma.c test_write_filter_lzop.c test_write_filter_program.c test_write_filter_uuencode.c test_write_filter_xz.c + test_write_filter_zstd.c test_write_format_7zip.c test_write_format_7zip_empty.c test_write_format_7zip_large.c diff --git a/libarchive/test/test_archive_write_add_filter_by_name.c b/libarchive/test/test_archive_write_add_filter_by_name.c index f2ec2e7b..d962af92 100644 --- a/libarchive/test/test_archive_write_add_filter_by_name.c +++ b/libarchive/test/test_archive_write_add_filter_by_name.c @@ -183,11 +183,6 @@ DEFINE_TEST(test_archive_write_add_filter_by_name_lz4) test_filter_by_name("lz4", ARCHIVE_FILTER_LZ4, canLz4); } -DEFINE_TEST(test_archive_write_add_filter_by_name_zstd) -{ - test_filter_by_name("zstd", ARCHIVE_FILTER_ZSTD, canZstd); -} - DEFINE_TEST(test_archive_write_add_filter_by_name_lzip) { test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, cannot); @@ -212,3 +207,8 @@ DEFINE_TEST(test_archive_write_add_filter_by_name_xz) { test_filter_by_name("xz", ARCHIVE_FILTER_XZ, cannot); } + +DEFINE_TEST(test_archive_write_add_filter_by_name_zstd) +{ + test_filter_by_name("zstd", ARCHIVE_FILTER_ZSTD, canZstd); +} diff --git a/tar/bsdtar.c b/tar/bsdtar.c index 1b9851f9..11dedbf9 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -416,10 +416,10 @@ main(int argc, char **argv) break; case OPTION_LRZIP: case OPTION_LZ4: - case OPTION_ZSTD: case OPTION_LZIP: /* GNU tar beginning with 1.23 */ case OPTION_LZMA: /* GNU tar beginning with 1.20 */ case OPTION_LZOP: /* GNU tar beginning with 1.21 */ + case OPTION_ZSTD: if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, @@ -428,10 +428,10 @@ main(int argc, char **argv) switch (opt) { case OPTION_LRZIP: compression_name = "lrzip"; break; case OPTION_LZ4: compression_name = "lz4"; break; - case OPTION_ZSTD: compression_name = "zstd"; break; case OPTION_LZIP: compression_name = "lzip"; break; case OPTION_LZMA: compression_name = "lzma"; break; case OPTION_LZOP: compression_name = "lzop"; break; + case OPTION_ZSTD: compression_name = "zstd"; break; } break; case 'm': /* SUSv2 */ diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 304fb568..543a228c 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -147,7 +147,6 @@ enum { OPTION_KEEP_NEWER_FILES, OPTION_LRZIP, OPTION_LZ4, - OPTION_ZSTD, OPTION_LZIP, OPTION_LZMA, OPTION_LZOP, @@ -182,7 +181,8 @@ enum { OPTION_USE_COMPRESS_PROGRAM, OPTION_UUENCODE, OPTION_VERSION, - OPTION_XATTRS + OPTION_XATTRS, + OPTION_ZSTD, }; int bsdtar_getopt(struct bsdtar *); diff --git a/tar/cmdline.c b/tar/cmdline.c index 23388db0..66cf4c2d 100644 --- a/tar/cmdline.c +++ b/tar/cmdline.c @@ -107,7 +107,6 @@ static const struct bsdtar_option { { "list", 0, 't' }, { "lrzip", 0, OPTION_LRZIP }, { "lz4", 0, OPTION_LZ4 }, - { "zstd", 0, OPTION_ZSTD }, { "lzip", 0, OPTION_LZIP }, { "lzma", 0, OPTION_LZMA }, { "lzop", 0, OPTION_LZOP }, @@ -161,6 +160,7 @@ static const struct bsdtar_option { { "version", 0, OPTION_VERSION }, { "xattrs", 0, OPTION_XATTRS }, { "xz", 0, 'J' }, + { "zstd", 0, OPTION_ZSTD }, { NULL, 0, 0 } }; diff --git a/tar/creation_set.c b/tar/creation_set.c index 42ce127e..d3c4d215 100644 --- a/tar/creation_set.c +++ b/tar/creation_set.c @@ -76,11 +76,11 @@ get_filter_code(const char *suffix) { ".lrz", "lrzip" }, { ".lz", "lzip" }, { ".lz4", "lz4" }, - { ".zst", "zstd"}, { ".lzo", "lzop" }, { ".lzma", "lzma" }, { ".uu", "uuencode" }, { ".xz", "xz" }, + { ".zst", "zstd"}, { NULL, NULL } }; diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt index fb9dfee7..eacbabef 100644 --- a/tar/test/CMakeLists.txt +++ b/tar/test/CMakeLists.txt @@ -19,10 +19,10 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_extract_tar_lrz.c test_extract_tar_lz.c test_extract_tar_lz4.c - test_extract_tar_zstd.c test_extract_tar_lzma.c test_extract_tar_lzo.c test_extract_tar_xz.c + test_extract_tar_zstd.c test_format_newc.c test_help.c test_leading_slash.c @@ -47,7 +47,6 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_option_keep_newer_files.c test_option_lrzip.c test_option_lz4.c - test_option_zstd.c test_option_lzma.c test_option_lzop.c test_option_n.c @@ -63,6 +62,7 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_option_xattrs.c test_option_xz.c test_option_z.c + test_option_zstd.c test_patterns.c test_print_longpath.c test_stdio.c |