summaryrefslogtreecommitdiff
path: root/cpio
diff options
context:
space:
mode:
authorSean Purcell <me@seanp.xyz>2017-04-26 11:10:17 -0700
committerSean Purcell <iburinoc@gmail.com>2017-05-15 23:06:49 -0400
commitcd63bdcda53a99389d994e5db2e19d8bbd74a62c (patch)
tree0750dce1688e92a280f1abfe6ea6e45f962ae746 /cpio
parent45232160e38fd41827712c0e8577835cb5287fd8 (diff)
downloadlibarchive-cd63bdcda53a99389d994e5db2e19d8bbd74a62c.tar.gz
Fix alphabetical order, other small fixes
Diffstat (limited to 'cpio')
-rw-r--r--cpio/cmdline.c2
-rw-r--r--cpio/cpio.c8
-rw-r--r--cpio/cpio.h4
-rw-r--r--cpio/test/CMakeLists.txt4
-rw-r--r--cpio/test/test_option_zstd.c4
5 files changed, 11 insertions, 11 deletions
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);