From: Karl Berry Date: Mon, 24 Feb 2025 22:41:48 +0000 (-0800) Subject: dist: change tar format default to ustar. X-Git-Tag: v1.17.90~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d2ff6070ca13428032c14f1d1cfd57b6b22e42d;p=thirdparty%2Fautomake.git dist: change tar format default to ustar. Suggested in https://bugs.gnu.org74847. * m4/init.m4 (tar-ustar): make ustar the default instead of tar-v7. * doc/automake.texi (tar-formats): document this. * NEWS: mention this. * t/tar-override.sh: force tar-v7 for purposes of this test. --- diff --git a/NEWS b/NEWS index da6b5e493..d06de78fd 100644 --- a/NEWS +++ b/NEWS @@ -6,13 +6,17 @@ New in 1.x: * New features added + - Default tar format is now ustar, mainly to support longer filenames; + the tar-v7 and other explicit options to force a particular tar + format are unchanged and still override the default. (bug#74847) + + - New option dist-bzip3 for bzip3 compression of distributions. (bug#73795) + - New option --stderr-prefix for tap-driver.sh, to prefix each line of stderr from a test script with a given string. (bug#72536) - Support for Algol 68 added, based on the GNU Algol 68 compiler. (bug#75807) - - New option dist-bzip3 for bzip3 compression of distributions. (bug#73795) - * Bugs fixed - Do not make Perl warnings fatal, per Perl's recommendation. diff --git a/doc/automake.texi b/doc/automake.texi index 6dcd94826..51190ea50 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -11373,7 +11373,7 @@ These options must be passed as arguments to @code{AM_INIT_AUTOMAKE} Automake will complain if it sees such options in an @code{AUTOMAKE_OPTIONS} variable. -@option{tar-v7} selects the old V7 tar format. This is the historical +@option{tar-v7} selects the old V7 tar format. This was the historical default. This antiquated format is understood by all tar implementations and supports file names with up to 99 characters. When given longer file names some tar implementations will diagnose the @@ -11383,7 +11383,8 @@ directories. When using this format, consider using the @option{filename-length-max=99} option to catch file names too long. @option{tar-ustar} selects the ustar format defined by POSIX -1003.1-1988. This format is old enough to be portable: +1003.1-1988. This format became the default in Automake version 1.18 +(released in 2025). As of 2018, it is supported by the native @code{tar} command on GNU, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, and Solaris, at least. It fully supports empty directories. It can store file names with up diff --git a/m4/init.m4 b/m4/init.m4 index 5da8f9e13..ed10dabcf 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -100,8 +100,9 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], diff --git a/t/tar-override.sh b/t/tar-override.sh index 941a599da..e02c255ca 100644 --- a/t/tar-override.sh +++ b/t/tar-override.sh @@ -16,14 +16,21 @@ # Check that the user can override the tar program used by "make dist" # at runtime, by redefining the 'TAR' environment variable. -# NOTE: currently this works only when the tar format used is 'v7' -# (which is the default one). +# +# Currently this works only when the tar format used is 'v7'; +# as of 2025 (automake-1.18), this is no longer the default, +# so force that format in our test setup. . test-init.sh cwd=$(pwd) || fatal_ "getting current working directory" -echo AC_OUTPUT >> configure.ac +cat > configure.ac << 'END' +AC_INIT([tar-override], [1.0]) +AM_INIT_AUTOMAKE([tar-v7]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +END cat > am--tar <<'END' #!/bin/sh