Paul Eggert <egg...@cs.ucla.edu> writes: > On 12/12/24 15:07, Simon Josefsson via Gnulib discussion list wrote: >> mm, it seems --format=posix is actually a bit misleading: it seems that >> if no features from --format=posix is necessary (like sub-second >> timestamps) then it will be the same as ustar format. > > That's what pax (posix) format is. It's an extension of ustar format. > > The tar manual >> suggest --format=ustar is subset of --format=posix, although not >> perfectly clear: "However, any tar implementation able to read ‘ustar’ >> archives should be able to read most ‘posix’ archives as well". > > That's talking about behavior, not format. > > Not sure what's unclear here, short of adding a long section on > exactly what both formats are (which I lack time to do). Perhaps add > "Pax format is an extension of ustar format" with a URL pointing to > the POSIX spec?
What is not clear to me is how older implementations handle seeing a --format=posix aka (?) PAX format archive, and which these implementations are. The tar manual says: https://www.gnu.org/software/tar/manual/html_node/Formats.html#Formats However, any tar implementation able to read ‘ustar’ archives should be able to read most ‘posix’ archives as well and the automake manual says: https://www.gnu.org/software/automake/manual/html_node/List-of-Automake-options.html#index-Option_002c-tar_002dv7 tar-pax selects the new pax interchange format defined by POSIX 1003.1-2001. It does not limit the length of file names. However, this format is very young and should probably be restricted to packages that target only very modern platforms. As of 2018, this format is supported by the native tar command only on GNU, FreeBSD, and OpenBSD systems; it is not supported by the native tar command on NetBSD, AIX, HP-UX, or Solaris. There are moves to change the pax format in an upward-compatible way, so this option may refer to a more recent version in the future. Some insight can be gained from automake's m4.tar: https://git.savannah.gnu.org/cgit/automake.git/tree/m4/tar.m4 All I've seen so far suggests that adding --format=ustar to gnulib's TAR_OPTIONS in GNUmakefile will be safe. Possibly automake can move from v7 to ustar. Adding this to gnulib now allows us to gain experience with it. Only question I have is where to find a V7-only tar implementation and how it behaves when seeing a ustar archive. SunOS4? AIX 3? However I am less certain about adding --format=posix to gnulib. Some documentation suggests this will work fine, and even further that if we are setting UID/GIDs to 0 and clamping mtime to entire seconds, and assuming <255 filename lengths, using --format=posix will result in a ustar-compliant archive. Is that correct? Then things are fine. However there is also text as in the automake manual that strongly suggests otherwise. /Simon
signature.asc
Description: PGP signature