home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / compress / 3102 < prev    next >
Encoding:
Text File  |  1992-08-26  |  4.2 KB  |  128 lines

  1. Newsgroups: comp.compression
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!eel!tam
  3. From: tam@eel.ocgy.ubc.ca (Joe Tam)
  4. Subject: Patch to make gnutar 1.10 use zip compression
  5. Message-ID: <1992Aug26.221347.3551@unixg.ubc.ca>
  6. Sender: tam@eel (Joe Tam)
  7. Nntp-Posting-Host: eel.ocgy.ubc.ca
  8. Reply-To: tam@ocgy.ubc.ca
  9. Organization: University of British Columbia, Vancouver, B.C., Canada
  10. Date: Wed, 26 Aug 1992 22:13:47 GMT
  11. Lines: 115
  12.  
  13. Here's a patch I whipped for gnutar 1.10 to use with zip 1.9 and unzip
  14. 5.0.  If you specify the 'z' option instead of the 'Z' option, it will
  15. pipe the archive through the zip compressor/decompressor instead on
  16. Unix's compress.  The default compression is -9 (I figure that if you
  17. go through all the trouble to apply this patch to gnutar, you probably
  18. want maximum compression).
  19.  
  20.  
  21. One note:  funzip (the decompression filter that is packaged with unzip
  22. 5.0) will exit with status=1 and the new gnutar will complain about
  23. it.  To get rid of this, just put in a "exit(0);" statement at the end
  24. of the main() routine (next to the last line) in funzip.c.
  25.  
  26. The new gnutar expects zip and funzip to be in your binary search
  27. path.
  28.  
  29. ----------------------- Cut here ------------------------------------
  30. gnutar1.10/patch.zip
  31. diff -c ./buffer.c ../ziptar/buffer.c
  32. *** ./buffer.c    Mon Jul  1 11:15:53 1991
  33. --- ../ziptar/buffer.c    Wed Aug 26 11:44:37 1992
  34. ***************
  35. *** 464,473 ****
  36.           }
  37.       }
  38.           /* So we should exec compress (-d) */
  39. !     if(ar_reading)
  40. !         execlp("compress", "compress", "-d", (char *)0);
  41. !     else
  42. !         execlp("compress", "compress", (char *)0);
  43.       msg_perror("can't exec compress");
  44.       _exit(EX_SYSTEM);
  45.   }
  46. --- 464,480 ----
  47.           }
  48.       }
  49.           /* So we should exec compress (-d) */
  50. !     if (f_zip) {
  51. !         if(ar_reading)
  52. !             execlp("funzip", "funzip", (char *)0);
  53. !         else
  54. !             execlp("zip", "zip", "-q9", (char *)0);
  55. !     } else {
  56. !         if(ar_reading)
  57. !             execlp("compress", "compress", "-d", (char *)0);
  58. !         else
  59. !             execlp("compress", "compress", (char *)0);
  60. !     }
  61.       msg_perror("can't exec compress");
  62.       _exit(EX_SYSTEM);
  63.   }
  64. Only in .: patch.zip
  65. diff -c ./tar.c ../ziptar/tar.c
  66. *** ./tar.c    Wed Jun  5 11:56:34 1991
  67. --- ../ziptar/tar.c    Wed Aug 26 11:40:29 1992
  68. ***************
  69. *** 585,590 ****
  70. --- 585,591 ----
  71.               break;
  72.   
  73.           case 'z':        /* Easy to type */
  74. +             f_zip++;
  75.           case 'Z':        /* Like the filename extension .Z */
  76.               f_compress++;
  77.               break;
  78. ***************
  79. *** 673,679 ****
  80.   -W, +verify        attempt to verify the archive after writing it\n\
  81.   -X, +exclude FILE    exclude file FILE\n\
  82.   +exclude-from FILE    exclude files listed in FILE\n\
  83. ! -z, -Z, +compress,\n\
  84.       +uncompress          filter the archive through compress\n\
  85.   -[0-7][lmh]        specify drive and density\n\
  86.   ", stderr);
  87. --- 674,681 ----
  88.   -W, +verify        attempt to verify the archive after writing it\n\
  89.   -X, +exclude FILE    exclude file FILE\n\
  90.   +exclude-from FILE    exclude files listed in FILE\n\
  91. ! -z                      Use zip compression\n\
  92. ! -Z, +compress,\n\
  93.       +uncompress          filter the archive through compress\n\
  94.   -[0-7][lmh]        specify drive and density\n\
  95.   ", stderr);
  96. diff -c ./tar.h ../ziptar/tar.h
  97. *** ./tar.h    Thu Jun 20 17:14:30 1991
  98. --- ../ziptar/tar.h    Wed Aug 26 11:35:07 1992
  99. ***************
  100. *** 227,234 ****
  101.   TAR_EXTERN int  f_verify;        /* -W */
  102.               /* CMD_EXTRACT     -x */
  103.   TAR_EXTERN int  f_exclude;        /* -X */
  104. ! TAR_EXTERN int     f_compress;        /* -z */
  105. !                     /* -Z */
  106.   TAR_EXTERN int    f_do_chown;        /* +do-chown */
  107.   TAR_EXTERN int  f_totals;        /* +totals */
  108.   
  109. --- 227,234 ----
  110.   TAR_EXTERN int  f_verify;        /* -W */
  111.               /* CMD_EXTRACT     -x */
  112.   TAR_EXTERN int  f_exclude;        /* -X */
  113. ! TAR_EXTERN int  f_zip;            /* -z */
  114. ! TAR_EXTERN int     f_compress;        /* -Z */
  115.   TAR_EXTERN int    f_do_chown;        /* +do-chown */
  116.   TAR_EXTERN int  f_totals;        /* +totals */
  117.   
  118. ----------------------- Cut here ------------------------------------
  119. Joseph Tam <tam@ocgy.ubc.ca>   \___ \___________
  120. Department of Oceanography     \___ \___________
  121. University of British Columbia \___ \___________
  122. Vancouver, BC, Canada          \___     \___
  123. V6T 1W5                \___    \___     \___
  124.                        \___    \___     \___
  125. Phone: (604) 822-3911   \_________  \__ \___ \__
  126. Fax:   (604) 822-6091    \______    \__ \___ \__
  127.  
  128.