From: Sergey Poznyakoff Date: Fri, 2 Jun 2006 08:01:33 +0000 (+0000) Subject: Update X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=commitdiff_plain;h=7bfcbd6a27e5b5c7f61cc5a54d6cc0414b7e72c6 Update --- diff --git a/NEWS b/NEWS index 76917fb..f502944 100644 --- a/NEWS +++ b/NEWS @@ -53,10 +53,28 @@ with UNIX98. This ends the transition period started with version 1.14. * New features +** New option --transform allows to transform file names before storing them +in the archive or member names before extracting. The option takes a +sed replace expression as its argument. For example, + + tar cf foo.tar --transform 's,^,prefix/' + +will add 'prefix/' to all file names stored in foo.tar. + +** --strip-components option works when deleting and comparing. + +** New option --show-transformed-names enables display of transformed file +or archive. In particular, when creating archive in verbose mode, +the option lists member names as stored in the archive. It +generalizes --show-stored-names option, introduced in 1.15.90. In +particular, when creating an archive in verbose mode, it lists member +names as stored in the archive, i.e., with any eventual prefixes +removed and file name transformations applied. The option is useful, +for example, while comparing `tar cv' and `tar tv' outputs. + ** New incremental snapshot file format keeps information about file names as well as that about directories. - version 1.15.90 - Sergey Poznyakoff, 2006-02-19 diff --git a/TODO b/TODO index f5ca51b..6b0dbc6 100644 --- a/TODO +++ b/TODO @@ -17,18 +17,6 @@ so that the GNU extensions (--incremental, --label and * Add support for a 'pax' command that conforms to POSIX 1003.1-2001. This would unify paxutils with tar. -* Remove command-line incompatibilities between GNU tar and UNIX tar - as specified by UNIX98. The main problem is: - - l GNU tar doesn't cross filesystem boundaries. - UNIX98 tar warns if all links cannot be resolved. - (GNU tar --check-links option) - - Currently tar prints a warning when this option is used. Sometime - in the future its semantics will be changed to that of --check-links. - In the meanwhile we should announce a phase-in period where "l" - changes in semantics. - * Interoperate better with Joerg Schilling's star implementation. * Add an option to remove files that compare successfully. diff --git a/doc/tar.texi b/doc/tar.texi index 74f585b..332269a 100644 --- a/doc/tar.texi +++ b/doc/tar.texi @@ -195,6 +195,7 @@ Advanced @GNUTAR{} Operations * concatenate:: * delete:: * compare:: +* quoting styles:: How to Add Files to Existing Archives: @option{--append} @@ -2593,7 +2594,7 @@ code. @xref{Writing to an External Program}. @opindex no-quote-chars, summary @item --no-quote-chars=@var{string} Do not quote characters from @var{string}, even if the selected -quoting style implies they should be quoted (@FIXME-pxref{Quoting Styles}). +quoting style implies they should be quoted (@pxref{quoting styles}). @opindex no-recursion, summary @item --no-recursion @@ -2715,12 +2716,12 @@ This option does not affect extraction from archives. @opindex quote-chars, summary @item --quote-chars=@var{string} Always quote characters from @var{string}, even if the selected -quoting style would not quote them (@FIXME-pxref{Quoting Styles}). +quoting style would not quote them (@pxref{quoting styles}). @opindex quoting-style, summary @item --quoting-style=@var{style} Set quoting style to use when printing member and file names -(@FIXME-pxref{Quoting Styles}). Valid @var{style} values are: +(@pxref{quoting styles}). Valid @var{style} values are: @code{literal}, @code{shell}, @code{shell-always}, @code{c}, @code{escape}, @code{locale}, and @code{clocale}. Default quoting style is @code{escape}, unless overridden while configuring the @@ -3670,6 +3671,7 @@ it still introduces the info in the chapter correctly : ).} * concatenate:: * delete:: * compare:: +* quoting styles:: @end menu @node Operations @@ -4175,6 +4177,117 @@ The spirit behind the @option{--compare} (@option{--diff}, @option{-d}) option i archive represents the current state of files on disk, more than validating the integrity of the archive media. For this later goal, @xref{verify}. +@node quoting styles +@subsection Quoting Member Names +@UNREVISED{} + +@smallexample +@group +$ @kbd{ls} +a\ttab +a\nnewline +a\ space +a"double"quote +a'single'quote +a\\backslash +$ @kbd{tar cf arch .} +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=literal} +./ +./a space +./a'single'quote +./a"double"quote +./a\backslash +./a tab +./a +newline +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=shell} +./ +'./a space' +'./a'\''single'\''quote' +'./a"double"quote' +'./a\backslash' +'./a tab' +'./a +newline' +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=shell-always} +'./' +'./a space' +'./a'\''single'\''quote' +'./a"double"quote' +'./a\backslash' +'./a tab' +'./a +newline' +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=c} +"./" +"./a space" +"./a'single'quote" +"./a\"double\"quote" +"./a\\backslash" +"./a\ttab" +"./a\nnewline" +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=escape} +./ +./a space +./a'single'quote +./a"double"quote +./a\\backslash +./a\ttab +./a\nnewline +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=locale} +`./' +`./a space' +`./a\'single\'quote' +`./a"double"quote' +`./a\\backslash' +`./a\ttab' +`./a\nnewline' +@end group +@end smallexample + +@smallexample +@group +$ @kbd{tar tf arch --quoting-style=clocale} +"./" +"./a space" +"./a'single'quote" +"./a\"double\"quote" +"./a\\backslash" +"./a\ttab" +"./a\nnewline" +@end group +@end smallexample + @node create options @section Options Used by @option{--create}