]> Dogcows Code - chaz/tar/commitdiff
Supply more information to the --to-command script.
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 25 Feb 2010 08:34:29 +0000 (10:34 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 25 Feb 2010 08:41:18 +0000 (10:41 +0200)
* src/system.c (stat_to_env): Pass information about the current
volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
TAR_FORMAT.
* doc/tar.texi: Document new environment variables.
* NEWS: Likewise.
* configure.ac: Version number 1.22.91.

NEWS
configure.ac
doc/tar.texi
src/system.c

diff --git a/NEWS b/NEWS
index a6b55cb489bbca17faad93476089669d9f82899f..5705bd7a8080a745cfea80516cc052dc51721c5f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,8 @@
-GNU tar NEWS - User visible changes. 2010-01-26
+GNU tar NEWS - User visible changes. 2010-02-25
 Please send GNU tar bug reports to <bug-tar@gnu.org>
 
 \f
-version 1.22.90 (Git)
+version 1.22.91 (Git)
 
 * Record size autodetection
 
@@ -86,6 +86,17 @@ chapter 7, "Date input formats", of the Tar manual, or as a name of
 an existing file, starting with `/' or `.'.  In the latter
 case, the value is replaced with the modification time of that file.
 
+* Environment of --to-command script.
+
+The environment passed to the --to-command script is extended with
+the following variables:
+
+   TAR_VERSION          GNU tar version number
+   TAR_ARCHIVE          The name of the archive
+   TAR_VOLUME           Ordinal number of the volume
+   TAR_FORMAT           Format of the archive
+   TAR_BLOCKING_FACTOR  Current blocking factor
+
 * Bugfixes
 ** Fix handling of hard link targets by -c --transform.
 ** Fix hard links recognition with -c --remove-files.
index 382e4d869a3c458ac4aff329f45ba7a4801a32a6..2276b33b5d592b8eecd2cd01424001521d24f7f7 100644 (file)
@@ -19,7 +19,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 
-AC_INIT([GNU tar], [1.22.90], [bug-tar@gnu.org])
+AC_INIT([GNU tar], [1.22.91], [bug-tar@gnu.org])
 AC_CONFIG_SRCDIR([src/tar.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
index 9a8b171953e1e7e7083a0100e22b8e47211cf686..abc81df393f46fe4920583a479492dc2536783e2 100644 (file)
@@ -5430,9 +5430,32 @@ UID of the file owner.
 GID of the file owner.
 @end table
 
-In addition to these variables, @env{TAR_VERSION} contains the
+Additionally, the following variables contain information about
+tar mode and the archive being processed:
+
+@table @env
+@vrindex TAR_VERSION, to-command environment
+@item TAR_VERSION
 @GNUTAR{} version number.
 
+@vrindex TAR_ARCHIVE, to-command environment
+@item TAR_ARCHIVE
+The name of the archive @command{tar} is processing.
+
+@vrindex TAR_BLOCKING_FACTOR, to-command environment
+@item TAR_BLOCKING_FACTOR
+Current blocking factor (@pxref{Blocking}.
+
+@vrindex TAR_VOLUME, to-command environment
+@item TAR_VOLUME
+Ordinal number of the volume @command{tar} is processing.
+
+@vrindex TAR_FORMAT, to-command environment
+@item TAR_FORMAT
+Format of the archive being processed. @xref{Formats}, for a complete
+list of archive format names.
+@end table
+
 If @var{command} exits with a non-0 status, @command{tar} will print
 an error message similar to the following:
 
index ea884966ad78b8f2856ac61fb4671e211bc66cd6..d646822c4a6ccc65ae0ad098b1b1f47956db6dd4 100644 (file)
@@ -629,6 +629,12 @@ static void
 stat_to_env (char *name, char type, struct tar_stat_info *st)
 {
   str_to_env ("TAR_VERSION", PACKAGE_VERSION);
+  str_to_env ("TAR_ARCHIVE", *archive_name_cursor);
+  dec_to_env ("TAR_VOLUME", archive_name_cursor - archive_name_array + 1);
+  dec_to_env ("TAR_BLOCKING_FACTOR", blocking_factor);
+  str_to_env ("TAR_FORMAT",
+             archive_format_string (current_format == DEFAULT_FORMAT ?
+                                    archive_format : current_format));
   chr_to_env ("TAR_FILETYPE", type);
   oct_to_env ("TAR_MODE", st->stat.st_mode);
   str_to_env ("TAR_FILENAME", name);
This page took 0.036157 seconds and 4 git commands to generate.