busybox-1.4.1-tar_t.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. --- busybox-1.4.1/archival/tar.c Wed Jan 24 22:49:25 2007
  2. +++ busybox-1.4.1-tar_t/archival/tar.c Sun Feb 25 21:50:35 2007
  3. @@ -760,7 +760,9 @@
  4. const char *tar_filename = "-";
  5. unsigned opt;
  6. int verboseFlag = 0;
  7. +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
  8. llist_t *excludes = NULL;
  9. +#endif
  10. /* Initialise default values */
  11. tar_handle = init_handle();
  12. @@ -773,7 +775,9 @@
  13. "tt:vv:" // count -t,-v
  14. "?:" // bail out with usage instead of error return
  15. "X::T::" // cumulative lists
  16. +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
  17. "\xff::" // cumulative lists for --exclude
  18. +#endif
  19. USE_FEATURE_TAR_CREATE("c:") "t:x:" // at least one of these is reqd
  20. USE_FEATURE_TAR_CREATE("c--tx:t--cx:x--ct") // mutually exclusive
  21. SKIP_FEATURE_TAR_CREATE("t--x:x--t"); // mutually exclusive
  22. @@ -788,14 +792,15 @@
  23. USE_FEATURE_TAR_FROM( "T:X:")
  24. USE_FEATURE_TAR_GZIP( "z" )
  25. USE_FEATURE_TAR_COMPRESS("Z" )
  26. - ,
  27. - &base_dir, // -C dir
  28. - &tar_filename, // -f filename
  29. - USE_FEATURE_TAR_FROM(&(tar_handle->accept),) // T
  30. - USE_FEATURE_TAR_FROM(&(tar_handle->reject),) // X
  31. - USE_FEATURE_TAR_FROM(&excludes ,) // --exclude
  32. - &verboseFlag, // combined count for -t and -v
  33. - &verboseFlag // combined count for -t and -v
  34. + , &base_dir // -C dir
  35. + , &tar_filename // -f filename
  36. + USE_FEATURE_TAR_FROM(, &(tar_handle->accept)) // T
  37. + USE_FEATURE_TAR_FROM(, &(tar_handle->reject)) // X
  38. +#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
  39. + , &excludes // --exclude
  40. +#endif
  41. + , &verboseFlag // combined count for -t and -v
  42. + , &verboseFlag // combined count for -t and -v
  43. );
  44. if (verboseFlag) tar_handle->action_header = header_verbose_list;
  45. @@ -828,17 +833,19 @@
  46. if (opt & OPT_COMPRESS)
  47. get_header_ptr = get_header_tar_Z;
  48. - if (ENABLE_FEATURE_TAR_FROM) {
  49. - tar_handle->reject = append_file_list_to_list(tar_handle->reject);
  50. - /* Append excludes to reject */
  51. - while (excludes) {
  52. - llist_t *temp = excludes->link;
  53. - excludes->link = tar_handle->reject;
  54. - tar_handle->reject = excludes;
  55. - excludes = temp;
  56. - }
  57. - tar_handle->accept = append_file_list_to_list(tar_handle->accept);
  58. +#if ENABLE_FEATURE_TAR_FROM
  59. + tar_handle->reject = append_file_list_to_list(tar_handle->reject);
  60. +#if ENABLE_FEATURE_TAR_LONG_OPTIONS
  61. + /* Append excludes to reject */
  62. + while (excludes) {
  63. + llist_t *next = excludes->link;
  64. + excludes->link = tar_handle->reject;
  65. + tar_handle->reject = excludes;
  66. + excludes = next;
  67. }
  68. +#endif
  69. + tar_handle->accept = append_file_list_to_list(tar_handle->accept);
  70. +#endif
  71. /* Check if we are reading from stdin */
  72. if (argv[optind] && *argv[optind] == '-') {