diff options
| author | Daniel O'Callaghan <danny@FreeBSD.org> | 1998-02-04 06:54:00 +0000 |
|---|---|---|
| committer | Daniel O'Callaghan <danny@FreeBSD.org> | 1998-02-04 06:54:00 +0000 |
| commit | df05d108e35f5340a28b4b742c3d75b34fb3dd92 (patch) | |
| tree | fd130acc91738a9a58456d14d3ad0c574a035280 /gnu | |
| parent | 93ba63597f9c086bd19b0cf7f30fd9f2d0d02979 (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/tar/ChangeLog | 6 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/create.c | 6 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/getdate.y | 5 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/tar.1 | 89 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/tar.c | 21 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/tar.h | 4 | ||||
| -rw-r--r-- | gnu/usr.bin/tar/version.c | 2 |
7 files changed, 94 insertions, 39 deletions
diff --git a/gnu/usr.bin/tar/ChangeLog b/gnu/usr.bin/tar/ChangeLog index 7934f2b1b2e3..a4717e9f57b9 100644 --- a/gnu/usr.bin/tar/ChangeLog +++ b/gnu/usr.bin/tar/ChangeLog @@ -1,3 +1,9 @@ +Sun Dec 14 07:47:44 1997 Peter Hawkins (peter@clari.net.au) + + * version.c: Released version 1.11.3. + + * implemented the -n / --norecurse option + Thu Mar 25 13:32:40 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) * version.c: Released version 1.11.2. diff --git a/gnu/usr.bin/tar/create.c b/gnu/usr.bin/tar/create.c index 00e353fe8672..793dca278452 100644 --- a/gnu/usr.bin/tar/create.c +++ b/gnu/usr.bin/tar/create.c @@ -148,7 +148,7 @@ create_archive () while (p = name_from_list ()) dump_file (p, -1, 1); - /* if(!f_dironly) { */ + if(!f_dironly) { blank_name_list (); while (p = name_from_list ()) { @@ -165,7 +165,7 @@ create_archive () } } } - /* } */ + } free (buf); } else @@ -764,10 +764,8 @@ dump_file (p, curdev, toplevel) } /* Now output all the files in the directory */ -#if 0 if (f_dironly) return; /* Unless the cmdline said not to */ -#endif /* * See if we are crossing from one file system to another, * and avoid doing so if the user only wants to dump one file system. diff --git a/gnu/usr.bin/tar/getdate.y b/gnu/usr.bin/tar/getdate.y index aa8f6b512a33..b53e784ca1eb 100644 --- a/gnu/usr.bin/tar/getdate.y +++ b/gnu/usr.bin/tar/getdate.y @@ -1,5 +1,5 @@ %{ -/* $Revision: 1.1.1.1 $ +/* $Revision: 1.3 $ ** ** Originally written by Steven M. Bellovin <smb@research.att.com> while ** at the University of North Carolina at Chapel Hill. Later tweaked by @@ -98,7 +98,7 @@ extern struct tm *localtime(); #if !defined(lint) && !defined(SABER) static char RCS[] = - "$Header: /home/ncvs/src/gnu/usr.bin/tar/getdate.y,v 1.1.1.1 1993/06/18 04:22:21 jkh Exp $"; + "$Header: /home/ncvs/src/gnu/usr.bin/tar/getdate.y,v 1.3 1998/01/05 11:32:38 danny Exp $"; #endif /* !defined(lint) && !defined(SABER) */ @@ -478,6 +478,7 @@ static TABLE const TimezoneTable[] = { { "nt", tZONE, HOUR(11) }, /* Nome */ { "idlw", tZONE, HOUR(12) }, /* International Date Line West */ { "cet", tZONE, -HOUR(1) }, /* Central European */ + { "cest", tDAYZONE, -HOUR(1) }, /* Central European Summer */ { "met", tZONE, -HOUR(1) }, /* Middle European */ { "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */ { "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */ diff --git a/gnu/usr.bin/tar/tar.1 b/gnu/usr.bin/tar/tar.1 index ff630f5e7a3d..ba72a7cc5e2f 100644 --- a/gnu/usr.bin/tar/tar.1 +++ b/gnu/usr.bin/tar/tar.1 @@ -2,10 +2,11 @@ .\" See /usr/src/gnu/COPYING for conditions of redistribution .\" .\" Written by John F. Woods <jfw@jfwhome.funhouse.com> +.\" Updated by Robert Eckardt <roberte@mep.ruhr-uni-bochum.de> .\" -.\" $Id: tar.1,v 1.6 1996/08/13 00:13:49 chuckr Exp $ +.\" $Id: tar.1,v 1.12 1998/01/05 11:32:38 danny Exp $ .\" -.Dd 6 August 1994 +.Dd 25 August 1997 .Os FreeBSD .Dt TAR 1 .Sh NAME @@ -13,17 +14,16 @@ .Nd tape archiver; manipulate "tar" archive files .Sh SYNOPSIS -.Nm -.Op Cm Bq - -.Op Cm bundled-options -.Op Ar [gnu-style-flags] +.Nm tar +.Op [-] Ns Ar bundled-options +.Op Ar gnu-style-flags .Op Ar tarfile .Op Ar blocksize .Op Ar exclude-file .Op Ar filenames .Op Fl C Ar directory-name .Sh DESCRIPTION -.Nm +.Nm Tar is short for .Dq tape archiver, so named for historical reasons; the @@ -123,13 +123,16 @@ below). .Bl -tag -width "--preserve-permissions" -compact .It Fl -help Prints a message listing and briefly describing all the command -options to tar. +options to +.Nm tar. .It Fl -atime-preserve Restore the access times on files which are written to tape (note that this will change the inode-change time!). .It Fl b .It Fl -block-size Ar number -Sets the block size for reading or writing to N 512-byte blocks. +Sets the block size for reading or writing to +.Ar number +* 512-byte blocks. .It Fl B .It Fl -read-full-blocks Re-assemble short reads into full blocks (for reading 4.2BSD pipes). @@ -139,7 +142,7 @@ Change to .Ar directory for extraction. .It Fl -checkpoint -Print directory names while reading the archive. +Print number of buffer reads/writes while reading/writing the archive. .It Fl f Ar [hostname:]file .It Fl -file Ar [hostname:]file Read or write the specified @@ -154,6 +157,8 @@ to read or write the specified .Ar file on a remote machine. "-" may be used is a filename, for reading or writing to/from stdin/stdout. +.It Fl -force-local +Archive file is local even if it has a colon .It Fl F Ar file .It Fl -info-script Ar file .It Fl -new-volume-script Ar file @@ -190,17 +195,27 @@ Stay in local filesystem when creating an archive (do not cross mount points). .It Fl L Ar number .It Fl -tape-length Ar number -Change tapes after writing N*1024 bytes. +Change tapes after writing +.Ar number +* 1024 bytes. .It Fl m .It Fl -modification-time Don't extract file modified time. .It Fl M .It Fl -multi-volume Create/list/extract multi-volume archive. +.It Fl n +.It Fl -norecurse +Don't recurse into subdirectories when creating. +.It Fl -volno-file Ar file +File name with volume number to start with. .It Fl N Ar date .It Fl -after-date Ar date .It Fl -newer Ar date -Only store files newer than +Only store files with creation time newer than +.Ar date . +.It Fl -newer-mtime Ar date +Only store files with modifiction time newer than .Ar date . .It Fl o .It Fl -old-archive @@ -228,6 +243,8 @@ Remove files after adding them to the archive. .It Fl -same-order .It Fl -preserve-order List of names to extract is sorted to match archive. +.It Fl -show-omitted-dirs +Show directories which were omitted while processing the archive. .It Fl S .It Fl -sparse Handle "sparse" files efficiently. @@ -242,17 +259,24 @@ Modifies behavior of to expect null-terminated names; disables .Fl C. .It Fl -totals -Prints total bytes written with --create. +Prints total bytes written with +.Fl -create. .It Fl v .It Fl -verbose -Lists files written to archive with --create or extracted with --extract; -lists file protection information along with file names with --list. +Lists files written to archive with +.Fl -create +or extracted with +.Fl -extract; +lists file protection information along with file names with +.Fl -list. .It Fl V Ar volume-name .It Fl -label Ar volume-name Create archive with the given .Ar volume-name . .It Fl -version -Print tar program version number. +Print +.Nm tar +program version number. .It Fl w .It Fl -interactive .It Fl -confirmation @@ -289,8 +313,6 @@ Block the output of compression program for tapes or floppies (otherwise writes will be of odd length, which device drivers may reject). .It Fl [0-7][lmh] Specify tape drive and density. -.It Fl -norecurse -Don't recurse into subdirectories when creating. .It Fl -unlink Unlink files before creating them. .El @@ -299,7 +321,7 @@ To create an archive on tape drive /dev/rst0 with a block size of 20 blocks, containing files named "bert" and "ernie", you can enter .Dl tar cfb /dev/rst0 20 bert ernie or -.Dl tar --create --file /dev/rst0 --block-size 20 bert ernie +.Dl tar\ --create\ --file\ /dev/rst0\ --block-size\ 20\ bert\ ernie Note that the .Fl f and @@ -313,7 +335,7 @@ size, the above example could have simply been .Pp To extract all the C sources and headers from an archive named "backup.tar", type -.Dl tar xf backup.tar "*.[ch]" +.Dl tar xf backup.tar '*.[ch]' Note that the pattern must be quoted to prevent the shell from attempting to expand it according the files in the current working directory (the shell does not have access to the list of files in @@ -326,6 +348,7 @@ tar -cf - -C srcdir . | tar xpf - -C destdir .Pp To create a compressed archive on diskette, using gzip, use a command-line like .Dl tar --block-compress -z -c -v -f /dev/rfd1a -b 36 tar/ +.Pp Note that you cannot mix bundled flags and --style flags; you can use single-letter flags in the manner above, rather than having to type .Dl tar --block-compress --gzip --verbose --file /dev/rfd1a --block-size 20 tar/ @@ -339,12 +362,28 @@ which will add the files contained in archive2.tar onto the end of archive1.tar (note that this can't be done by simply typing .Dl cat archive2.tar >> archive1.tar because of the end-of-file block at the end of a tar archive). +.Pp +To archive all files from the directory srcdir, which were modified +after Feb. 9th 1997, 13:00 h, use +.Dl tar\ -c\ -f\ backup.tar\ --newer-mtime\ 'Feb\ 9\ 13:15\ 1997'\ srcdir/ +.Pp +Other possible time specifications are '02/09/97 13:15', +'1997-02-09 13:15', '13:15 9 Feb 1997', '9 Feb 1997 13:15', +'Feb. 9, 1997 1:15pm', '09-Feb', '3 weeks ago' or 'May first Sunday'. +To specify the correct time zone use either e.g. `13:15 CEST' or `13:15+200'. + .Sh ENVIRONMENT -The tar program examines the following environment variables. +The +.Nm tar +program examines the following environment variables. .Bl -tag -width "POSIXLY-CORRECT" .It POSIXLY-CORRECT -Normally, tar will process flag arguments that appear in the file list -If set in the environment, this causes tar to consider the first +Normally, +.Nm tar +will process flag arguments that appear in the file list. +If set in the environment, this causes +.Nm tar +to consider the first non-flag argument to terminate flag processing, as per the POSIX specification. .It SHELL In interactive mode, a permissible response to the prompt is to @@ -372,7 +411,9 @@ The default tape drive. .\" .Sh STANDARDS .Sh HISTORY The tar format has a rich history, dating back to Sixth Edition UNIX. -The current implementation of tar is the GNU implementation, which +The current implementation of +.Nm tar +is the GNU implementation, which originated as the public-domain tar written by John Gilmore. .Sh AUTHORS A cast of thousands, including [as listed in the ChangeLog file in the diff --git a/gnu/usr.bin/tar/tar.c b/gnu/usr.bin/tar/tar.c index 8fa092384300..c71202b12117 100644 --- a/gnu/usr.bin/tar/tar.c +++ b/gnu/usr.bin/tar/tar.c @@ -187,6 +187,7 @@ struct option long_options[] = {"unlink", 0, &f_unlink, 1}, {"fast-read", 0, &f_fast_read, 1}, + {"norecurse", 0, 0, 'n'}, {0, 0, 0, 0} }; @@ -313,7 +314,7 @@ options (argc, argv) /* Parse options */ while ((c = getoldopt (argc, argv, - "-01234567Ab:BcC:df:F:g:GhikK:lL:mMN:oOpPrRsStT:uvV:wWxX:zZ", + "-01234567Ab:BcC:df:F:g:GhikK:lL:mMnN:oOpPrRsStT:uvV:wWxX:zZ", long_options, &ind)) != EOF) { switch (c) @@ -535,6 +536,12 @@ options (argc, argv) f_multivol++; break; + case 'n': /* don't recurse into subdirectories */ + if (f_oldarch) + goto badopt; + f_dironly++; + break; + case 'N': /* Only write files newer than X */ get_newer: f_new_files++; @@ -547,7 +554,7 @@ options (argc, argv) break; case 'o': /* Generate old archive */ - if (f_gnudump /* || f_dironly */ ) + if (f_gnudump || f_dironly) goto badopt; f_oldarch++; break; @@ -708,13 +715,13 @@ Other options:\n\ fputs ("\ -B, --read-full-blocks reblock as we read (for reading 4.2BSD pipes)\n\ -C, --directory DIR change to directory DIR\n\ ---checkpoint print directory names while reading the archive\n\ +--checkpoint print number of buffer reads/writes\n\ ", stdout); /* KLUDGE */ fprintf (stdout, "\ -f, --file [HOSTNAME:]F use archive file or device F (default %s)\n", DEF_AR_FILE); fputs ("\ ---force-local archive file is local even if has a colon\n\ +--force-local archive file is local even if it has a colon\n\ -F, --info-script F\n\ --new-volume-script F run script at end of each tape (implies -M)\n\ -G, --incremental create/list/extract old GNU-format incremental backup\n\ @@ -730,8 +737,11 @@ Other options:\n\ fputs ("\ -m, --modification-time don't extract file modified time\n\ -M, --multi-volume create/list/extract multi-volume archive\n\ +-n, --norecurse don't recurse into subdircectories\n\ +--volno-file F use volume number to start with from file F\n\ -N, --after-date DATE,\n\ - --newer DATE only store files newer than DATE\n\ + --newer DATE only store files with creation time newer than DATE\n\ +--newer-mtime DATE only store files with modification time newer than DATE\n\ -o, --old-archive,\n\ --portability write a V7 format archive, rather than ANSI format\n\ -O, --to-stdout extract files to standard output\n\ @@ -746,6 +756,7 @@ Other options:\n\ -s, --same-order,\n\ --preserve-order list of names to extract is sorted to match archive\n\ --same-owner create extracted files with the same ownership \n\ +--show-omitted-dirs show omitted directories while processing the archive.\n\ -S, --sparse handle sparse files efficiently\n\ -T, --files-from F get names to extract or create from file F\n\ --null -T reads null-terminated names, disable -C\n\ diff --git a/gnu/usr.bin/tar/tar.h b/gnu/usr.bin/tar/tar.h index 21c5d52e1850..72b190cfae64 100644 --- a/gnu/usr.bin/tar/tar.h +++ b/gnu/usr.bin/tar/tar.h @@ -193,9 +193,7 @@ TAR_EXTERN int cmd_mode; TAR_EXTERN int f_reblock; /* -B */ -#if 0 -TAR_EXTERN char f_dironly; /* -D */ -#endif +TAR_EXTERN int f_dironly; /* -n */ TAR_EXTERN int f_run_script_at_end; /* -F */ TAR_EXTERN int f_gnudump; /* -G */ TAR_EXTERN int f_follow_links; /* -h */ diff --git a/gnu/usr.bin/tar/version.c b/gnu/usr.bin/tar/version.c index 4454f62c8e98..c5561580cf78 100644 --- a/gnu/usr.bin/tar/version.c +++ b/gnu/usr.bin/tar/version.c @@ -1 +1 @@ -char version_string[] = "GNU tar version 1.11.2"; +char version_string[] = "GNU tar version 1.11.3"; |
