home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / compress / gnuzip_.zip / GZIP-TAR.PAT < prev    next >
Text File  |  1993-03-28  |  4KB  |  122 lines

  1. This is a *NON official* patch to GNU tar 1.11.1 to support gzip. With
  2. this patch, tar -cz invokes gzip, tar -cZ invokes compress. You can
  3. use tar -xz to extract both compressed and gzip'ed tar files.
  4. Future versions of GNU tar will support gzip.
  5.  
  6. tar and gzip are available on all GNU archive sites, such as
  7. prep.ai.mit.edu:/pub/gnu and its mirrors.
  8.  
  9. Jean-loup Gailly
  10. jloup@chorus.fr
  11.  
  12. diff -c bak/buffer.c ./buffer.c
  13. *** bak/buffer.c    Mon Sep 14 22:56:39 1992
  14. --- ./buffer.c    Mon Dec 28 19:07:52 1992
  15. ***************
  16. *** 452,459 ****
  17.           }
  18.       }
  19.           /* So we should exec compress (-d) */
  20. !     if(ar_reading)
  21.           execlp("compress", "compress", "-d", (char *)0);
  22.       else
  23.           execlp("compress", "compress", (char *)0);
  24.       msg_perror("can't exec compress");
  25. --- 452,463 ----
  26.           }
  27.       }
  28.           /* So we should exec compress (-d) */
  29. !     if(ar_reading) {
  30. !         execlp("gzip", "gzip", "-d", (char *)0);
  31. !         /* Try uncompress if gunzip fails */
  32.           execlp("compress", "compress", "-d", (char *)0);
  33. +     } else if (f_zip)
  34. +         execlp("gzip", "gzip", "-8", (char *)0);
  35.       else
  36.           execlp("compress", "compress", (char *)0);
  37.       msg_perror("can't exec compress");
  38. diff -c bak/tar.c ./tar.c
  39. *** bak/tar.c    Mon Sep 14 23:31:38 1992
  40. --- ./tar.c    Mon Dec 28 19:14:29 1992
  41. ***************
  42. *** 158,163 ****
  43. --- 158,164 ----
  44.       {"ignore-zeros",    0,    &f_ignorez,        1},
  45.       {"keep-old-files",    0,    0,            'k'},
  46.       {"uncompress",        0,    &f_compress,        1},
  47. +         {"unzip",        0,    0,            'z'},
  48.       {"same-permissions",    0,    &f_use_protection,    1},
  49.       {"preserve-permissions",0,    &f_use_protection,    1},
  50.       {"modification-time",    0,    &f_modified,        1},
  51. ***************
  52. *** 183,188 ****
  53. --- 184,190 ----
  54.       {"old-archive",        0,    0,            'o'},
  55.       {"portability",        0,    0,            'o'},
  56.       {"compress",        0,    &f_compress,        1},
  57. +         {"zip",            0,    0,            'z'},
  58.       {"compress-block",    0,    &f_compress,        2},
  59.       {"sparse",        0,    &f_sparse_files,    1},
  60.       {"tape-length",        1,    0,            'L'},
  61. ***************
  62. *** 609,615 ****
  63.               add_exclude_file(optarg);
  64.               break;
  65.   
  66. !         case 'z':        /* Easy to type */
  67.           case 'Z':        /* Like the filename extension .Z */
  68.               f_compress++;
  69.               break;
  70. --- 611,621 ----
  71.               add_exclude_file(optarg);
  72.               break;
  73.   
  74. !         case 'z':        /* Like the filename extension .z */
  75. !             f_zip++;
  76. !             f_compress++;
  77. !             break;
  78.           case 'Z':        /* Like the filename extension .Z */
  79.               f_compress++;
  80.               break;
  81. ***************
  82. *** 716,722 ****
  83.   -W, --verify        attempt to verify the archive after writing it\n\
  84.   --exclude FILE        exclude file FILE\n\
  85.   -X, --exclude-from FILE    exclude files listed in FILE\n\
  86. ! -z, -Z, --compress,\n\
  87.       --uncompress          filter the archive through compress\n\
  88.   -[0-7][lmh]        specify drive and density\n\
  89.   ", stdout);
  90. --- 722,729 ----
  91.   -W, --verify        attempt to verify the archive after writing it\n\
  92.   --exclude FILE        exclude file FILE\n\
  93.   -X, --exclude-from FILE    exclude files listed in FILE\n\
  94. ! -z, --zip, --unzip    filter the archive through gzip\n\
  95. ! -Z, --compress,\n\
  96.       --uncompress          filter the archive through compress\n\
  97.   -[0-7][lmh]        specify drive and density\n\
  98.   ", stdout);
  99. diff -c bak/tar.h ./tar.h
  100. *** bak/tar.h    Tue Sep  8 21:45:34 1992
  101. --- ./tar.h    Mon Dec 28 19:06:40 1992
  102. ***************
  103. *** 224,231 ****
  104.   TAR_EXTERN int  f_verify;        /* -W */
  105.               /* CMD_EXTRACT     -x */
  106.   TAR_EXTERN int  f_exclude;        /* -X */
  107. ! TAR_EXTERN int     f_compress;        /* -z */
  108. !                     /* -Z */
  109.   TAR_EXTERN int    f_do_chown;        /* --do-chown */
  110.   TAR_EXTERN int  f_totals;        /* --totals */
  111.   TAR_EXTERN int    f_remove_files;        /* --remove-files */
  112. --- 224,231 ----
  113.   TAR_EXTERN int  f_verify;        /* -W */
  114.               /* CMD_EXTRACT     -x */
  115.   TAR_EXTERN int  f_exclude;        /* -X */
  116. ! TAR_EXTERN int     f_zip;            /* -z */
  117. ! TAR_EXTERN int     f_compress;        /* -Z */
  118.   TAR_EXTERN int    f_do_chown;        /* --do-chown */
  119.   TAR_EXTERN int  f_totals;        /* --totals */
  120.   TAR_EXTERN int    f_remove_files;        /* --remove-files */
  121.