I am maintaining a legacy cygwin (with GNU tar v1.21) system and a legacy Solaris 9 system. The configuration of the Solaris 9 system is fixed and cannot be upgraded (i.e. I can't install gnu tar for Solaris).
I am trying to create a tarball on the cygwin system that can extracted on the Solaris 9 system but unfortunately the directory structure (which is also fixed and cannot be renamed) plus file names exceed 100 characters and I've run into the Great Tar Wars of the last millennium. There is a large (conservative) userbase on the Solaris system so a solution that uses Solaris tar is preferred.
Here are the errors I'm experiencing.
Creating the tar on cygwin:
$ tar -cf dir.tar dir
or
$ tar -c --posix -f dir.tar dir
Gives the following on Solaris:
$ tar -xif dir.tar
tar: directory checksum errors
And the file names in dir are truncated. (i.e. ignoring checksum errors doesn't help)
How do I create a tarball with long pathnames using GNU tar that can be extracted by Solaris tar?
Edit #2: Unable to use Schily Tar (star)
It appears that Joerg Schilling has been able to emulate the Solaris 7/8/9 tar format and provides a suntar
option to create a Solaris tarball using star.
Unfortunately star
is not available on cygwin. :(
Edit #1: Using --format=posix gives errors when extracting
Errors when extracting --format=posix gnu tarballs using pax on Solaris 9
On cygwin:
$ ls example/this_is_a_path_name_greater_than_one_hundred_characters/when_combined_with_this_file_name_which_is_also_rather_long.txt | wc -m
128
$ tar -c --format=posix -f example.tar example
On Solaris:
$ pax -r -f example.tar
pax: ./PaxHeaders.4440/example : Unknown filetype
pax: example/PaxHeaders.4440/this_is_a_path_name_greater_than_one_hundred_characters : Unknown filetype
pax: example/this_is_a_path_name_greater_than_one_hundred_characters/PaxHeaders.4440/when_combined_with_t : Unknown filetype
Similar errors are given when extracting using Solaris tar.
tar tf dir.tar
on Cygwin to see the table of contents. – unxnut Jan 07 '14 at 04:05-i
when extracting. (Answer updated accordingly.) – Mikel Jan 07 '14 at 17:12schilytools
source archive, unpack it and callmake
– schily Jun 27 '18 at 20:20