1 diff -ru tar-1.11.2/ChangeLog tar-1.11.2.1/ChangeLog
2 --- tar-1.11.2/ChangeLog Thu Mar 25 19:54:56 1993
3 +++ tar-1.11.2.1/ChangeLog Mon Oct 3 21:07:15 1994
5 +Sat Jun 19 14:00:00 1994 J"org Weule (weule@cs.uni-duesseldorf.de)
7 + * version.c: version 1.11.2 (added --record-file)
9 + * create.c: print header before incrementing the record #
11 + * tar.c: inserted the option --record-file
13 + * buffer.c: opens the record file
15 + * list.c: writes the record information to rec_files instead of
18 Thu Mar 25 13:32:40 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu)
20 * version.c: Released version 1.11.2.
21 diff -ru tar-1.11.2/buffer.c tar-1.11.2.1/buffer.c
22 --- tar-1.11.2/buffer.c Fri Mar 19 21:05:11 1993
23 +++ tar-1.11.2.1/buffer.c Thu Feb 9 23:01:33 1995
25 /* Either stdout or stderr: The thing we write messages (standard msgs, not
26 errors) to. Stdout unless we're writing a pipe, in which case stderr */
27 FILE *msg_file = stdout;
28 +FILE *rec_file = stdout;
29 +char *rec_file_name = NULL ;
31 #define STDIN 0 /* Standard input file descriptor */
32 #define STDOUT 1 /* Standard output file descriptor */
35 * Record number of the start of this block of records
41 * Error recovery stuff
43 open_archive (reading)
46 - msg_file = f_exstdout ? stderr : stdout;
47 + time_t start_time = time(0);
48 + rec_file = msg_file = f_exstdout ? stderr : stdout;
49 + if ( rec_file_name != NULL )
51 +#define INSERT_TIMESTAMP
52 +#ifdef INSERT_TIMESTAMP
54 + * A record-file name with '%T' will be expanded with a decimal
55 + * value for the timestamp of the archive. This is the time value
56 + * stored in the label record.
57 + * If you are using only one computer, this should be a unique number.
58 + * You are able to create different rec-files for all your archives,
59 + * as well as finding the index of your archive in a reliable way.
61 + * Another way would be to let us set the timestamp by another option.
62 + * tar --timestamp <ts-number> ...
65 + if ( reading == 0 ) {
66 + char*p= rec_file_name ;
69 + while ( p[0] != '\0' ) {
70 + if ( p[0] == '%' && p[1] == 'T' ) {
71 + i += sprintf(rfn+i,"%d",start_time), p += 2 ;
72 + } else { rfn[i++] = *p++ ; }
75 + } else strcpy(rfn,rec_file_name);
77 + char*rfn=rec_file_name;
79 + if ( ( rec_file = fopen(rfn,"w")) == NULL )
81 + fprintf(rec_file,"Cannot open %s.\n",rec_file_name);
92 + if ( ( f_sayblock ) && ( f_volhdr ) )
95 + "loc timestamp is %d \n",
98 + if ( f_sayblock && (blocksize != 10240) )
101 + "loc block length is %d bytes = %d * 512 bytes \n",
102 + blocksize,blocksize>>9);
107 msg ("No archive name given, what should I do?");
109 setmode (archive, O_BINARY);
113 + /* Prints the file number of the archive */
118 + i = ioctl(archive,MTIOCGET,&get);
119 + if (( i == 0 ) && ( get.mt_fileno >= 0 ))
122 + "loc number of the file is %d \n",
128 +#if defined(MTIOCPOS)
129 + /* Prints the tape block number on every Linux SCSI-device */
134 + i = ioctl(archive,MTIOCPOS,&pos);
138 + "loc number of the first block is %d\n",
146 ar_last = ar_block; /* Set up for 1st block = # 0 */
148 strcpy (ar_block->header.arch_name, f_volhdr);
149 current_file_name = ar_block->header.arch_name;
150 ar_block->header.linkflag = LF_VOLHDR;
151 - to_oct (time (0), 1 + 12, ar_block->header.mtime);
152 + to_oct (start_time, 1 + 12, ar_block->header.mtime);
153 finish_header (ar_block);
156 diff -ru tar-1.11.2/create.c tar-1.11.2.1/create.c
157 --- tar-1.11.2/create.c Thu Mar 25 19:32:31 1993
158 +++ tar-1.11.2.1/create.c Mon Oct 3 21:06:01 1994
159 @@ -1340,7 +1340,10 @@
160 to_oct ((long) sum, 8, header->header.chksum);
161 header->header.chksum[6] = '\0'; /* Zap the space */
164 + /* print header first to get the same output with 'tar -tvR'
167 + /* userec (header); */
171 @@ -1353,6 +1356,8 @@
172 head_standard = f_standard;
180 diff -ru tar-1.11.2/list.c tar-1.11.2.1/list.c
181 --- tar-1.11.2/list.c Tue Mar 16 20:56:01 1993
182 +++ tar-1.11.2.1/list.c Wed Oct 12 14:01:01 1994
186 extern FILE *msg_file;
187 +extern FILE *rec_file;
189 long from_oct (); /* Decode octal number */
190 void demode (); /* Print file mode */
195 - fprintf (msg_file, "rec %10d: ", baserec + (ar_record - ar_block));
196 + fprintf (rec_file, "rec %10d: ", baserec + (ar_record - ar_block));
197 /* annofile(msg_file, (char *)NULL); */
201 name = quote_copy_string (current_file_name);
203 name = current_file_name;
204 - fprintf (msg_file, "%s\n", name);
205 + fprintf (rec_file, "%s\n", name);
206 if (name != current_file_name)
210 switch (head->header.linkflag)
213 + /* dirty bug fix to display the header processing
214 + * tar cvvf /dev/null --label 'hello world' blah...
215 + * J"org Weule weule@cs.uni-duesseldorf.de
217 + hstat.st_mtime = from_oct(1 + 12 , head->header.mtime);
222 name = quote_copy_string (current_file_name);
224 name = current_file_name;
225 - fprintf (msg_file, "%s %s/%s %*s%s %s %s %s",
226 + fprintf (rec_file, "%s %s/%s %*s%s %s %s %s",
231 name = quote_copy_string (current_link_name);
233 name = current_link_name;
234 - fprintf (msg_file, " -> %s\n", name);
235 + fprintf (rec_file, " -> %s\n", name);
236 if (name != current_link_name)
239 @@ -716,13 +722,13 @@
240 name = quote_copy_string (current_link_name);
242 name = current_link_name;
243 - fprintf (msg_file, " link to %s\n", current_link_name);
244 + fprintf (rec_file, " link to %s\n", current_link_name);
245 if (name != current_link_name)
250 - fprintf (msg_file, " unknown file type '%c'\n",
251 + fprintf (rec_file, " unknown file type '%c'\n",
252 head->header.linkflag);
255 @@ -735,23 +741,23 @@
259 - putc ('\n', msg_file);
260 + putc ('\n', rec_file);
264 - fprintf (msg_file, "--Volume Header--\n");
265 + fprintf (rec_file, "--Volume Header--\n");
269 - fprintf (msg_file, "--Continued at byte %ld--\n", from_oct (1 + 12, head->header.offset));
270 + fprintf (rec_file, "--Continued at byte %ld--\n", from_oct (1 + 12, head->header.offset));
274 - fprintf (msg_file, "--Mangled file names--\n");
275 + fprintf (rec_file, "--Mangled file names--\n");
284 @@ -774,12 +780,12 @@
285 demode ((unsigned) mode, modes + 1);
288 - fprintf (msg_file, "rec %10d: ", baserec + (ar_record - ar_block));
289 + fprintf (rec_file, "rec %10d: ", baserec + (ar_record - ar_block));
290 /* annofile(msg_file, (char *)NULL); */
291 name = quote_copy_string (pathname);
294 - fprintf (msg_file, "%s %*s %.*s\n",
295 + fprintf (rec_file, "%s %*s %.*s\n",
297 ugswidth + DATEWIDTH,
298 "Creating directory:",
299 diff -ru tar-1.11.2/tar.c tar-1.11.2.1/tar.c
300 --- tar-1.11.2/tar.c Wed Mar 17 16:30:46 1993
301 +++ tar-1.11.2.1/tar.c Thu Oct 13 00:48:14 1994
305 extern FILE *msg_file;
306 +extern FILE *rec_file;
307 +extern char *rec_file_name;
309 int check_exclude ();
313 {"directory", 1, 0, 'C'},
314 {"record-number", 0, &f_sayblock, 1},
315 + {"record-file",1,0,19},
316 {"files-from", 1, 0, 'T'},
317 {"label", 1, 0, 'V'},
318 {"exclude-from", 1, 0, 'X'},
320 f_compressprog = optarg;
324 + rec_file_name = optarg ;
325 + f_sayblock++; /* Print block #s for debug */
328 case 'g': /* We are making a GNU dump; save
329 directories at the beginning of
330 the archive, and include in each
332 ", stdout); /* KLUDGE */
334 -R, --record-number show record number within archive with each message\n\
335 +--record-file print the record information to file, enable -R\n\
336 --remove-files remove files after adding them to the archive\n\
338 --preserve-order list of names to extract is sorted to match archive\n\
339 diff -ru tar-1.11.2/version.c tar-1.11.2.1/version.c
340 --- tar-1.11.2/version.c Thu Mar 25 19:35:25 1993
341 +++ tar-1.11.2.1/version.c Mon Oct 3 16:01:59 1994
343 -char version_string[] = "GNU tar version 1.11.2";
344 +char version_string[] = "GNU tar version 1.11.2 (added --record-file)";