Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autotools - tar This does not look like a tar archive

After running make distcheck I get the message that I have successfully built the package and is ready for distribution. If I untar the tar.gz with tar -zxvf hello-0.2.tar.gz it successfully extracts all of its contents. However, when I try to extract them in different machines I get:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

The weird thing is that it was working before.

On the machine I'm trying to build the package, I've updated my automake 1.10.1, autoconf 2.61, and tar 1.20 to automake 1.11.1, autoconf 2.65, and tar 1.23 and still the same issue.

Any ideas what could be the problem?

like image 277
denim69 Avatar asked Jul 25 '10 22:07

denim69


1 Answers

The problem is not on the build machine; the problem is on the target machines.

Not all versions of tar automatically recognize the decompression to apply to a compressed tar file. Given that gunzip followed by tar does work, then the tar on your target machine is one such. The versions of tar on the mainstream Unix systems (AIX, HP-UX, Solaris) do not recognize compressed tar files automatically. Those on Linux and MacOS X do.

Note that you can use:

gzip -dc hello-0.2.tar.gz | tar -xf -

to avoid creating the intermediate uncompressed file.

like image 126
Jonathan Leffler Avatar answered Oct 08 '22 06:10

Jonathan Leffler