1 --- busybox.old/archival/tar.c 2007/02/03 17:28:39 17740
2 +++ busybox.dev/archival/tar.c 2007/02/04 21:30:35 17772
4 const char *tar_filename = "-";
7 +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
8 llist_t *excludes = NULL;
11 /* Initialise default values */
12 tar_handle = init_handle();
14 "tt:vv:" // count -t,-v
15 "?:" // bail out with usage instead of error return
16 "X::T::" // cumulative lists
17 +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
18 "\xff::" // cumulative lists for --exclude
20 USE_FEATURE_TAR_CREATE("c:") "t:x:" // at least one of these is reqd
21 USE_FEATURE_TAR_CREATE("c--tx:t--cx:x--ct") // mutually exclusive
22 SKIP_FEATURE_TAR_CREATE("t--x:x--t"); // mutually exclusive
24 USE_FEATURE_TAR_FROM( "T:X:")
25 USE_FEATURE_TAR_GZIP( "z" )
26 USE_FEATURE_TAR_COMPRESS("Z" )
28 - &base_dir, // -C dir
29 - &tar_filename, // -f filename
30 - USE_FEATURE_TAR_FROM(&(tar_handle->accept),) // T
31 - USE_FEATURE_TAR_FROM(&(tar_handle->reject),) // X
32 - USE_FEATURE_TAR_FROM(&excludes ,) // --exclude
33 - &verboseFlag, // combined count for -t and -v
34 - &verboseFlag // combined count for -t and -v
35 + , &base_dir // -C dir
36 + , &tar_filename // -f filename
37 + USE_FEATURE_TAR_FROM(, &(tar_handle->accept)) // T
38 + USE_FEATURE_TAR_FROM(, &(tar_handle->reject)) // X
39 +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
40 + , &excludes // --exclude
42 + , &verboseFlag // combined count for -t and -v
43 + , &verboseFlag // combined count for -t and -v
46 if (verboseFlag) tar_handle->action_header = header_verbose_list;
48 if (opt & OPT_COMPRESS)
49 get_header_ptr = get_header_tar_Z;
51 - if (ENABLE_FEATURE_TAR_FROM) {
52 - tar_handle->reject = append_file_list_to_list(tar_handle->reject);
53 - /* Append excludes to reject */
55 - llist_t *temp = excludes->link;
56 - excludes->link = tar_handle->reject;
57 - tar_handle->reject = excludes;
60 - tar_handle->accept = append_file_list_to_list(tar_handle->accept);
61 +#if ENABLE_FEATURE_TAR_FROM
62 + tar_handle->reject = append_file_list_to_list(tar_handle->reject);
63 +#if ENABLE_FEATURE_TAR_LONG_OPTIONS
64 + /* Append excludes to reject */
66 + llist_t *next = excludes->link;
67 + excludes->link = tar_handle->reject;
68 + tar_handle->reject = excludes;
72 + tar_handle->accept = append_file_list_to_list(tar_handle->accept);
75 /* Check if we are reading from stdin */
76 if (argv[optind] && *argv[optind] == '-') {