aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2016-07-07 14:28:08 +0100
committerRon Yorston <rmy@pobox.com>2016-07-07 14:58:55 +0100
commit613f46218c53c8cabdbf0435653e74e0e0e91e1c (patch)
treeca06a7e7a3e4c861441acb4ea20648d7827fa6ae /archival/tar.c
parenta0c61c9492723dd31681f878f9c68c92817a476d (diff)
parent237bedd499c58034a1355484d6d4d906f0180308 (diff)
downloadbusybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.tar.gz
busybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.tar.bz2
busybox-w32-613f46218c53c8cabdbf0435653e74e0e0e91e1c.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/archival/tar.c b/archival/tar.c
index c88957734..c87d23597 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -1009,7 +1009,6 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1009 /* Prepend '-' to the first argument if required */ 1009 /* Prepend '-' to the first argument if required */
1010 opt_complementary = "--:" // first arg is options 1010 opt_complementary = "--:" // first arg is options
1011 "tt:vv:" // count -t,-v 1011 "tt:vv:" // count -t,-v
1012 IF_FEATURE_TAR_FROM("X::T::") // cumulative lists
1013#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM 1012#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
1014 "\xff::" // --exclude=PATTERN is a list 1013 "\xff::" // --exclude=PATTERN is a list
1015#endif 1014#endif
@@ -1061,13 +1060,13 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1061#endif 1060#endif
1062 opt = getopt32(argv, 1061 opt = getopt32(argv,
1063 "txC:f:Oopvk" 1062 "txC:f:Oopvk"
1064 IF_FEATURE_TAR_CREATE( "ch" ) 1063 IF_FEATURE_TAR_CREATE( "ch" )
1065 IF_FEATURE_SEAMLESS_BZ2( "j" ) 1064 IF_FEATURE_SEAMLESS_BZ2( "j" )
1066 IF_FEATURE_SEAMLESS_LZMA("a" ) 1065 IF_FEATURE_SEAMLESS_LZMA("a" )
1067 IF_FEATURE_TAR_FROM( "T:X:") 1066 IF_FEATURE_TAR_FROM( "T:*X:*")
1068 IF_FEATURE_SEAMLESS_GZ( "z" ) 1067 IF_FEATURE_SEAMLESS_GZ( "z" )
1069 IF_FEATURE_SEAMLESS_XZ( "J" ) 1068 IF_FEATURE_SEAMLESS_XZ( "J" )
1070 IF_FEATURE_SEAMLESS_Z( "Z" ) 1069 IF_FEATURE_SEAMLESS_Z( "Z" )
1071 IF_FEATURE_TAR_NOPRESERVE_TIME("m") 1070 IF_FEATURE_TAR_NOPRESERVE_TIME("m")
1072 IF_FEATURE_TAR_LONG_OPTIONS("\xf9:") // --strip-components 1071 IF_FEATURE_TAR_LONG_OPTIONS("\xf9:") // --strip-components
1073 , &base_dir // -C dir 1072 , &base_dir // -C dir
@@ -1228,9 +1227,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1228 // /* We need to know whether child (gzip/bzip/etc) exits abnormally */ 1227 // /* We need to know whether child (gzip/bzip/etc) exits abnormally */
1229 // signal(SIGCHLD, check_errors_in_children); 1228 // signal(SIGCHLD, check_errors_in_children);
1230 1229
1230#if ENABLE_FEATURE_TAR_CREATE
1231 /* Create an archive */ 1231 /* Create an archive */
1232 if (opt & OPT_CREATE) { 1232 if (opt & OPT_CREATE) {
1233#if SEAMLESS_COMPRESSION 1233# if SEAMLESS_COMPRESSION
1234 const char *zipMode = NULL; 1234 const char *zipMode = NULL;
1235 if (opt & OPT_COMPRESS) 1235 if (opt & OPT_COMPRESS)
1236 zipMode = "compress"; 1236 zipMode = "compress";
@@ -1242,7 +1242,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1242 zipMode = "lzma"; 1242 zipMode = "lzma";
1243 if (opt & OPT_XZ) 1243 if (opt & OPT_XZ)
1244 zipMode = "xz"; 1244 zipMode = "xz";
1245#endif 1245# endif
1246 /* NB: writeTarFile() closes tar_handle->src_fd */ 1246 /* NB: writeTarFile() closes tar_handle->src_fd */
1247 return writeTarFile(tar_handle->src_fd, verboseFlag, 1247 return writeTarFile(tar_handle->src_fd, verboseFlag,
1248 (opt & OPT_DEREFERENCE ? ACTION_FOLLOWLINKS : 0) 1248 (opt & OPT_DEREFERENCE ? ACTION_FOLLOWLINKS : 0)
@@ -1250,6 +1250,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
1250 tar_handle->accept, 1250 tar_handle->accept,
1251 tar_handle->reject, zipMode); 1251 tar_handle->reject, zipMode);
1252 } 1252 }
1253#endif
1253 1254
1254 if (opt & OPT_ANY_COMPRESS) { 1255 if (opt & OPT_ANY_COMPRESS) {
1255 USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_state_t *xstate);) 1256 USE_FOR_MMU(IF_DESKTOP(long long) int FAST_FUNC (*xformer)(transformer_state_t *xstate);)