diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/tar.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/archival/tar.c b/archival/tar.c index f16b4d671..3a940128b 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -770,8 +770,8 @@ enum { | |||
770 | OPT_INCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_INCLUDE_FROM)) + 0, // T | 770 | OPT_INCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_INCLUDE_FROM)) + 0, // T |
771 | OPT_EXCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_EXCLUDE_FROM)) + 0, // X | 771 | OPT_EXCLUDE_FROM = IF_FEATURE_TAR_FROM( (1 << OPTBIT_EXCLUDE_FROM)) + 0, // X |
772 | OPT_GZIP = IF_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z | 772 | OPT_GZIP = IF_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z |
773 | OPT_NOPRESERVE_TIME = IF_FEATURE_TAR_NOPRESERVE_TIME((1 << OPTBIT_NOPRESERVE_TIME)) + 0, // m | ||
774 | OPT_COMPRESS = IF_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z | 773 | OPT_COMPRESS = IF_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z |
774 | OPT_NOPRESERVE_TIME = IF_FEATURE_TAR_NOPRESERVE_TIME((1 << OPTBIT_NOPRESERVE_TIME)) + 0, // m | ||
775 | OPT_NUMERIC_OWNER = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NUMERIC_OWNER )) + 0, // numeric-owner | 775 | OPT_NUMERIC_OWNER = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NUMERIC_OWNER )) + 0, // numeric-owner |
776 | OPT_NOPRESERVE_PERM = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NOPRESERVE_PERM)) + 0, // no-same-permissions | 776 | OPT_NOPRESERVE_PERM = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_NOPRESERVE_PERM)) + 0, // no-same-permissions |
777 | OPT_OVERWRITE = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_OVERWRITE )) + 0, // overwrite | 777 | OPT_OVERWRITE = IF_FEATURE_TAR_LONG_OPTIONS((1 << OPTBIT_OVERWRITE )) + 0, // overwrite |
@@ -951,14 +951,12 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
951 | if (opt & OPT_COMPRESS) | 951 | if (opt & OPT_COMPRESS) |
952 | get_header_ptr = get_header_tar_Z; | 952 | get_header_ptr = get_header_tar_Z; |
953 | 953 | ||
954 | #if ENABLE_FEATURE_TAR_NOPRESERVE_TIME | ||
955 | if (opt & OPT_NOPRESERVE_TIME) | 954 | if (opt & OPT_NOPRESERVE_TIME) |
956 | tar_handle->ah_flags &= ~ARCHIVE_RESTORE_DATE; | 955 | tar_handle->ah_flags &= ~ARCHIVE_RESTORE_DATE; |
957 | #endif | ||
958 | 956 | ||
959 | #if ENABLE_FEATURE_TAR_FROM | 957 | #if ENABLE_FEATURE_TAR_FROM |
960 | tar_handle->reject = append_file_list_to_list(tar_handle->reject); | 958 | tar_handle->reject = append_file_list_to_list(tar_handle->reject); |
961 | #if ENABLE_FEATURE_TAR_LONG_OPTIONS | 959 | # if ENABLE_FEATURE_TAR_LONG_OPTIONS |
962 | /* Append excludes to reject */ | 960 | /* Append excludes to reject */ |
963 | while (excludes) { | 961 | while (excludes) { |
964 | llist_t *next = excludes->link; | 962 | llist_t *next = excludes->link; |
@@ -966,12 +964,12 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
966 | tar_handle->reject = excludes; | 964 | tar_handle->reject = excludes; |
967 | excludes = next; | 965 | excludes = next; |
968 | } | 966 | } |
969 | #endif | 967 | # endif |
970 | tar_handle->accept = append_file_list_to_list(tar_handle->accept); | 968 | tar_handle->accept = append_file_list_to_list(tar_handle->accept); |
971 | #endif | 969 | #endif |
972 | 970 | ||
973 | /* Setup an array of filenames to work with */ | 971 | /* Setup an array of filenames to work with */ |
974 | /* TODO: This is the same as in ar, separate function ? */ | 972 | /* TODO: This is the same as in ar, make a separate function? */ |
975 | while (*argv) { | 973 | while (*argv) { |
976 | /* kill trailing '/' unless the string is just "/" */ | 974 | /* kill trailing '/' unless the string is just "/" */ |
977 | char *cp = last_char_is(*argv, '/'); | 975 | char *cp = last_char_is(*argv, '/'); |
@@ -990,7 +988,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
990 | int flags = O_RDONLY; | 988 | int flags = O_RDONLY; |
991 | 989 | ||
992 | if (opt & OPT_CREATE) { | 990 | if (opt & OPT_CREATE) { |
993 | /* Make sure there is at least one file to tar up. */ | 991 | /* Make sure there is at least one file to tar up */ |
994 | if (tar_handle->accept == NULL) | 992 | if (tar_handle->accept == NULL) |
995 | bb_error_msg_and_die("empty archive"); | 993 | bb_error_msg_and_die("empty archive"); |
996 | 994 | ||
@@ -1022,7 +1020,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
1022 | signal(SIGCHLD, handle_SIGCHLD); | 1020 | signal(SIGCHLD, handle_SIGCHLD); |
1023 | #endif | 1021 | #endif |
1024 | 1022 | ||
1025 | /* create an archive */ | 1023 | /* Create an archive */ |
1026 | if (opt & OPT_CREATE) { | 1024 | if (opt & OPT_CREATE) { |
1027 | #if ENABLE_FEATURE_SEAMLESS_GZ || ENABLE_FEATURE_SEAMLESS_BZ2 | 1025 | #if ENABLE_FEATURE_SEAMLESS_GZ || ENABLE_FEATURE_SEAMLESS_BZ2 |
1028 | int zipMode = 0; | 1026 | int zipMode = 0; |