AM_INIT_AUTOMAKE([1.9 tar-ustar]) and GNU TAR problems

View: New views
2 Messages — Rating Filter:   Alert me  

AM_INIT_AUTOMAKE([1.9 tar-ustar]) and GNU TAR problems

by Kent Boortz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

My real question is, how can I specify what TAR to use in "make dist",
and avoid GNU TAR for my packaging, when 'tar-ustar' is specified to
automake?

Now the longer story ;)

As most systems I build on now have a system TAR that knows the USTAR
format, I did some experiments with specifying this in automake

  AM_INIT_AUTOMAKE([1.9 tar-ustar])

GNU autotools versions used

  autoconf 2.63
  automake 1.10.2
  libtool 2.2.6

What I understand from reading the produced "configure" script, and
from my experiments, when the user invoke the configure script it
tries hard to find GNU TAR, then falls back and try find other TAR
implementations. I have GNU tar in path, but the Solaris TAR first,
still Solaris TAR is skipped and the GNU tar is picked.

The exact line in resulting Makefile will be

  am__tar = gtar --format=ustar -chf - "$$tardir"

The problem is, even with GNU TAR 1.22 the format it produces is not
fully compatible with most other USTAR TAR implementations I have
tried. These I found could not unpack the test TAR I produced with
GNU TAR and the flag "--format=ustar"

  AIX 5.3
  HP-UX 11.11, 11.23, 11.31
  Solaris 8, 9, 10, 11
  SCO OpenServer 6

I tried the small snippet below. Then distributed the resulting TAR to
the AIX, HP-UX and other hosts, and tried unpack it there with the TAR
that came with that operating system. If I packed with GNU TAR they
could not unpack it correctly (only the top directory was created), if
packed with Solaris TAR all could unpack it, even GNU TAR

  # I try be as nice as I can, 98 + 20 + 77 should be within USTAR
  # format limits even if one or two chars are wasted on '\0' or the
  # '/' delimiter
  a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  b=bbbbbbbbbbbbbbbbbbbb
  c=ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

  rm -fr $a
  mkdir -p $a/$b
  touch $a/$b/$c

  # GNU TAR
  gtar --format=ustar -cf foo.tar $a
  # Solaris TAR
  #/usr/bin/tar -cf foo.tar $a

Do you know how can I specify what TAR to use in "make dist", and
avoid GNU TAR for my packaging, when 'tar-ustar' is specified to
automake?

I can of course solve this by adding an extra step after "make dist",
unpack the produced source TAR using GNU TAR and repack it with
Solaris TAR again... ;)

kent

--
Kent Boortz, Senior Production Engineer
Sun Microsystems Inc., the MySQL team
Office: +46 863 11 363
Mobile: +46 70 279 11 71



Re: AM_INIT_AUTOMAKE([1.9 tar-ustar]) and GNU TAR problems

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Kent,

* Kent Boortz wrote on Mon, Nov 09, 2009 at 04:30:29PM CET:
> My real question is, how can I specify what TAR to use in "make dist",
> and avoid GNU TAR for my packaging, when 'tar-ustar' is specified to
> automake?

If you have a configure test which will find a good tar program for you,
then invoke this test before AM_INIT_AUTOMAKE and store the result in
$am_cv_prog_tar_ustar.

If you don't have a configure test, then you can still teach your users
to override the Automake default setting with
  ./configure am_cv_prog_tar_ustar=...

[...]
> The problem is, even with GNU TAR 1.22 the format it produces is not
> fully compatible with most other USTAR TAR implementations I have
> tried. These I found could not unpack the test TAR I produced with
> GNU TAR and the flag "--format=ustar"
>
>   AIX 5.3
>   HP-UX 11.11, 11.23, 11.31
>   Solaris 8, 9, 10, 11
>   SCO OpenServer 6

If it is possible to generate a broken/unextractable archive on one
system, then we could start thinking about adding a configure test to
automake/m4/tar.m4.  But regardless of that, may I ask you to report
this issue to bug-tar at gnu.org if you haven't already?

Thanks,
Ralf

> I tried the small snippet below. Then distributed the resulting TAR to
> the AIX, HP-UX and other hosts, and tried unpack it there with the TAR
> that came with that operating system. If I packed with GNU TAR they
> could not unpack it correctly (only the top directory was created), if
> packed with Solaris TAR all could unpack it, even GNU TAR
>
>   # I try be as nice as I can, 98 + 20 + 77 should be within USTAR
>   # format limits even if one or two chars are wasted on '\0' or the
>   # '/' delimiter
>   a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>   b=bbbbbbbbbbbbbbbbbbbb
>   c=ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
>
>   rm -fr $a
>   mkdir -p $a/$b
>   touch $a/$b/$c
>
>   # GNU TAR
>   gtar --format=ustar -cf foo.tar $a
>   # Solaris TAR
>   #/usr/bin/tar -cf foo.tar $a