bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] POSIX vs USTAR format


From: Paul Eggert
Subject: Re: [Bug-tar] POSIX vs USTAR format
Date: 15 Feb 2004 00:41:32 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bdale Garbee <address@hidden> writes:

> We've been chasing problems in my Debian packaging of 1.13.92 for which the 
> root cause appears to be the decision to use POSIX_FORMAT (ala pax) for 
> archives if POSIXLY_CORRECT is defined in the environment.  Frankly, I think 
> this violates the principle of least astonishment... 

I agree.  POSIX does not specify the behavior of the 'tar' command, so
tar's behavior need not and should not depend on POSIXLY_CORRECT.

I looked into the tar documentation, and it appears that this whole
thing stems from a long-ago misunderstanding of what POSIXLY_CORRECT
is supposed to mean.  I installed the following patch, which causes
'tar' to ignore POSIXLY_CORRECT (except perhaps for some minor issues
about command-line parsing which are not relevant here).  This should
fix the problem, albeit in a different way than the patch you
proposed.

2004-02-15  Paul Eggert  <address@hidden>

        Fix Debian bug 230872, originally reported by Jeff King in
        <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.

        * doc/tar.texi (posix compliance): Remove.  The whole section
        was a misunderstanding of what POSIXLY_CORRECT is supposed to
        mean.  The GNU Coding Standards says that POSIXLY_CORRECT
        is for disabling extensions that are incompatible with POSIX:
        it is not for disabling compatible extensions.  All references
        to this section removed.
        (posix): This format is created only if the posix format is
        specified; it is no longer created if gnu format is specified
        and POSIXLY_CORRECT is set.
        * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
        POSIX does not specify the behavior of tar, so we should
        not worry about POSIXLY_CORRECT here.

Index: doc/tar.texi
===================================================================
RCS file: /cvsroot/tar/tar/doc/tar.texi,v
retrieving revision 1.42
diff -p -u -r1.42 tar.texi
--- doc/tar.texi        14 Nov 2003 09:28:18 -0000      1.42
+++ doc/tar.texi        15 Feb 2004 08:21:58 -0000
@@ -584,7 +584,6 @@ Introduction
 * Definitions::                 Some Definitions
 * What tar Does::               What @command{tar} Does
 * Naming tar Archives::         How @command{tar} Archives are Named
-* posix compliance::
 * Current status::              Current development status of @GNUTAR{}
 * Authors::                     @GNUTAR{} Authors
 * Reports::                     Reporting bugs or suggestions
@@ -832,7 +831,6 @@ archives need not (and these days, typic
 * Definitions::                 Some Definitions
 * What tar Does::               What @command{tar} Does
 * Naming tar Archives::         How @command{tar} Archives are Named
-* posix compliance::
 * Current status::              Current development status of @GNUTAR{}
 * Authors::                     @GNUTAR{} Authors
 * Reports::                     Reporting bugs or suggestions
@@ -1001,37 +999,6 @@ the operation of @command{tar}, this cau
 this manual, we consistently refer to ``archives'' and ``archive
 members'' to make learning to use @command{tar} easier for novice users.
 
address@hidden posix compliance
address@hidden @sc{posix} Compliance
-
address@hidden
address@hidden ask franc,ois about this.  dan hagerty thinks this might
-be an issue, but we're not really sure at this time.  dan just tried a
-test case of mixing up options' orders while the variable was set, and
-there was no problem...}
address@hidden did not notice any problems either. Besides, the only piece
-of code that really uses POSIXLY_CORRECT is the one that forces
-creation of POSIX archives. I guess this paragraph should be removed.
-
---gray}
-
-
-We make some of our recommendations throughout this book for one
-reason in addition to what we think of as ``good sense''.  The main
-additional reason for a recommendation is to be compliant with the
address@hidden standards.  If you set the shell environment variable
address@hidden, @GNUTAR{} will force you to
-adhere to these standards.  Therefore, if this variable is set and you
-violate one of the @sc{posix} standards in the way you phrase a
-command, for example, @GNUTAR{} will not allow the
-command and will signal an error message.  You would then have to
-reorder the options or rephrase the command to comply with the
address@hidden standards.
-
-Notice also, that if this environment variable is set, @GNUTAR{}
-will create @acronym{POSIX} archives. Currently this means that
-no @acronym{GNU} extensions will be allowed (@pxref{posix}).
-
 @node Current status
 @section Current development status of @GNUTAR{}
 
@@ -1671,8 +1638,7 @@ written out mnemonically can affect how 
 does what, and therefore where different names have to be placed.
 (Placing options in an unusual order can also cause @command{tar} to
 report an error if you have set the shell environment variable
address@hidden; @pxref{posix compliance} for more information
-on this.)
address@hidden)
 
 @node create dir
 @subsection Archiving Directories
@@ -6393,12 +6359,7 @@ The version @value{VERSION} of @GNUTAR{}
 to read and create archives conforming to @sc{posix.1-2001} standard.
 
 A @sc{posix} conformant archive will be created if @command{tar}
-was given @value{op-format-posix} option, or if it was given
address@hidden option and the environment variable
address@hidden is set. The later usage is retained for
-compatibility with previous versions of @GNUTAR{}
-and is discouraged.
-
+was given @value{op-format-posix} option.
 Notice, that currently @acronym{GNU} extensions are not
 allowed with this format. Following is the list of options that
 cannot be used with @value{op-format-posix}:
Index: src/tar.c
===================================================================
RCS file: /cvsroot/tar/tar/src/tar.c,v
retrieving revision 1.77
diff -p -u -r1.77 tar.c
--- src/tar.c   3 Jan 2004 22:26:11 -0000       1.77
+++ src/tar.c   15 Feb 2004 08:22:00 -0000
@@ -1275,9 +1275,6 @@ see the file named COPYING for details."
   if (archive_format == DEFAULT_FORMAT)
     archive_format = DEFAULT_ARCHIVE_FORMAT;
 
-  if (archive_format == GNU_FORMAT && getenv ("POSIXLY_CORRECT"))
-    archive_format = POSIX_FORMAT; /*FIXME?*/
-
   if (volume_label_option && subcommand_option == CREATE_SUBCOMMAND)
     assert_format (FORMAT_MASK (OLDGNU_FORMAT)
                   | FORMAT_MASK (GNU_FORMAT));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]