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