Subject: bug#9822: AMTAR not used

From: Stefano Lattarini <[email-masked]>
Date: Tue, 1 Nov 2011 11:13:58 +0100

Hi Akim, thanks for the report.

On Friday 21 October 2011, Akim Demaille wrote:
> Hi all,
>
> My apologies if this has already been discussed.  
>
> I too have been hit by the fact that Tar on OS X tries to preserve
> special features of files in "hidden" files (a thread about this
> started here: 
>  <http://lists.gnu.org/archive/html/automake/2011-03/msg00127.html>
> and seems to end here: 
>  <http://lists.gnu.org/archive/html/automake/2011-04/msg00001.html>
> 
> There are several means to address this, one being defining a
> couple of envvars before calling OS X's tar (as discussed above),
> the other being using GNU Tar.
> 
> Unfortunately 1.11.1 generates code like this:
> 
> AMTAR = ${SHELL} /Users/akim/src/gostai/kernel-2.7/build-aux/missing --run tar
> ...
> am__tar = tar --format=ustar -chf - "$$tardir"
> am__untar = tar -xf -
> 
> (I cannot see AMTAR being used.)  I would prefer to have something like
> 
> TAR = tar
> AMTAR = ${SHELL} /Users/akim/[...]/build-aux/missing --run ${TAR}
> am__tar = $(AMTAR) --format=ustar -chf - "$$tardir"
> am__untar = $(AMTAR) -xf -
> 
> so that I can "make dist TAR=gnutar" and have magic happen.
> This would also require that missing understands gnutar in addition to
> tar, possibly qualified.  Or missing could be extended to have one flag
> for the "class" of the program (this is a "tar", a constant string),
> and then --run which gives the command line starting with the genuine
> command (/opt/local/bin/gnumake for my example).
> 
> Alternatively, if AMTAR is not useful (as it seems in 1.11.1), then
> 
> TAR = tar
> am__tar = $(TAR) --format=ustar -chf - "$$tardir"
> am__untar = $(TAR) -xf -
> 
> would be fine!
>
I'd prefer to go with this latter option (starting from automake 1.12,
to minimize backward-compatibility issues).  My opinion is that:

 1. "make dist" is a maintainer-specific command, so we can expect the
    user that issues it to either have a powerful-enough tar, or to
    install GNU tar.

 2. the `missing' script real purpose (and IMHO it's only purpose)
    should be that of allowing a non-developer to build a package
    from a ditribution tarball in the face of slightly-skewed
    timestamps, *not* to provide wrappers for all the maintainer
    tools -- so that using `missing' to wrap `tar' invocations
    seems fishy to me.

> Cheers!
> 
> PS/  Actually if AMTAR/TAR could also set the two troublesome envvars,
> that would be wonderful :)
> 
That could be done for automake 1.11.2 as well.  Do you have working
links to documentation/explanation of such environment variables?

Also, a testcase (aimed at excercising the real OS X tar) would be
lovely ;-)

Regards,
  Stefano