diff options
author | Sean Purcell <me@seanp.xyz> | 2017-04-19 16:51:50 -0700 |
---|---|---|
committer | Sean Purcell <iburinoc@gmail.com> | 2017-05-15 23:06:48 -0400 |
commit | f59fec02545917911a632ccff2d2305f0d65b401 (patch) | |
tree | 06e4a5df99c63dd696ee19af241d3c881b923f43 /cpio | |
parent | 26838cf5c17642f57192753cc5c3880b16b65ba3 (diff) | |
download | libarchive-f59fec02545917911a632ccff2d2305f0d65b401.tar.gz |
Add Zstandard write support
Diffstat (limited to 'cpio')
-rw-r--r-- | cpio/bsdcpio.1 | 5 | ||||
-rw-r--r-- | cpio/cmdline.c | 1 | ||||
-rw-r--r-- | cpio/cpio.c | 4 | ||||
-rw-r--r-- | cpio/cpio.h | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1 index e52546e6..786a7170 100644 --- a/cpio/bsdcpio.1 +++ b/cpio/bsdcpio.1 @@ -187,6 +187,11 @@ In input mode, this option is ignored. Compress the archive with lz4-compatible compression before writing it. In input mode, this option is ignored; lz4 compression is recognized automatically on input. +.It Fl Fl zstd +(o mode only) +Compress the archive with zstd-compatible compression before writing it. +In input mode, this option is ignored; zstd compression is recognized +automatically on input. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. diff --git a/cpio/cmdline.c b/cpio/cmdline.c index 0c10b2cd..4f371cee 100644 --- a/cpio/cmdline.c +++ b/cpio/cmdline.c @@ -75,6 +75,7 @@ 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' }, diff --git a/cpio/cpio.c b/cpio/cpio.c index 5beedd0d..17d12ff6 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -267,6 +267,7 @@ 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 */ cpio->compress = opt; @@ -540,6 +541,9 @@ 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; diff --git a/cpio/cpio.h b/cpio/cpio.h index 1036dece..14a77c11 100644 --- a/cpio/cpio.h +++ b/cpio/cpio.h @@ -104,6 +104,7 @@ enum { OPTION_INSECURE, OPTION_LRZIP, OPTION_LZ4, + OPTION_ZSTD, OPTION_LZMA, OPTION_LZOP, OPTION_PASSPHRASE, |