]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
dist: add bzip3 support.
authorKamila Szewczyk <kspalaiologos@gmail.com>
Fri, 21 Feb 2025 17:38:52 +0000 (09:38 -0800)
committerKarl Berry <karl@freefriends.org>
Fri, 21 Feb 2025 17:38:52 +0000 (09:38 -0800)
From https://bugs.gnu.org/73795 (automake-patches).

* bin/automake.in (handle_dist): add bzip3 support.
https://github.com/kspalaiologos/bzip3
* lib/Automake/Options.pm (_is_valid_easy_option): likewise.
* lib/am/distdir.am (dist-bzip3): likewise.
* t/dist-formats.tap: likewise.
* t/dist-bzip3.sh: new test.
* t/list-of-tests.mk (handwritten_TESTS): add it.
* NEWS: mention this.
* THANKS: add Kamila.

NEWS
THANKS
bin/automake.in
lib/Automake/Options.pm
lib/am/distdir.am
t/dist-bzip3.sh [new file with mode: 0644]
t/dist-formats.tap
t/list-of-tests.mk

diff --git a/NEWS b/NEWS
index cb6c251da934ab5c50489f3306c8177303fed230..504901a887f540eef77ee73cb2be8386f0d639da 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,10 +4,12 @@ please see NEWS-future and start following the advice there now.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 New in 1.x:
 
-* New supported languages
+* New features added:
 
   - 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)
+
 * Miscellaneous changes
 
   - Only require the presence of an ABOUT-NLS file at the 'gnits'
diff --git a/THANKS b/THANKS
index 50fbc18d5aa98538e0a45a8f4be9d76f504b38c0..634c77c9b6b1f74f736283593f37b8a1c2bf7bad 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -230,6 +230,7 @@ Juergen Keil                    jk@tools.de
 Juergen Leising                 juergen.leising@gmx.de
 Julien Sopena                   julien.sopena@lip6.fr
 Jürg Billeter                   j@bitron.ch
+Kamila Szewczyk                 kspalaiologos@gmail.com
 Karl Berry                      kb@cs.umb.edu
 Karl Heuer                      kwzh@gnu.org
 Kelley Cook                     kcook@gcc.gnu.org
index 79a8bc898d12cf2dcf6d710c6fa46fdc4f35c910..7e5a5f29504c173d75ce35829cf7484c1179fc50 100644 (file)
@@ -3872,7 +3872,7 @@ sub handle_dist ()
     {
       my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
       $archive_defined ||=
-       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz zstd);
+       grep { option "dist-$_" } qw(shar zip tarZ bzip2 bzip3 lzip xz zstd);
       error (option 'no-dist-gzip',
             "no-dist-gzip specified but no dist-* specified,\n"
             . "at least one archive format must be enabled")
@@ -6916,6 +6916,7 @@ sub preprocess_file
                 'XZ'          => !! option 'dist-xz',
                 'LZIP'        => !! option 'dist-lzip',
                 'BZIP2'       => !! option 'dist-bzip2',
+                'BZIP3'       => !! option 'dist-bzip3',
                 'COMPRESS'    => !! option 'dist-tarZ',
                 'GZIP'        =>  ! option 'no-dist-gzip',
                 'SHAR'        => !! option 'dist-shar',
index dd0f17a15d81b62b63b6dd630365384cd7df8927..4ecf6f94cf7779d7064f7597d8381cabd5d8315c 100644 (file)
@@ -272,6 +272,7 @@ sub _is_valid_easy_option ($)
     color-tests
     dejagnu
     dist-bzip2
+    dist-bzip3
     dist-lzip
     dist-xz
     dist-zip
index 2aea45fd953c58297f51cd19834cb2cd0d431f1c..d7e4916b54847dafadfc9ea7eca6c6ccacf41a58 100644 (file)
@@ -343,6 +343,12 @@ dist-bzip2: distdir
        tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
        $(am__post_remove_distdir)
 
+?BZIP3?DIST_ARCHIVES += $(distdir).tar.bz3
+.PHONY: dist-bzip3
+dist-bzip3: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip3 -c >$(distdir).tar.bz3
+       $(am__post_remove_distdir)
+
 ?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
 .PHONY: dist-lzip
 dist-lzip: distdir
@@ -390,6 +396,7 @@ dist-zip: distdir
 ?XZ?DIST_TARGETS += dist-xz
 ?SHAR?DIST_TARGETS += dist-shar
 ?BZIP2?DIST_TARGETS += dist-bzip2
+?BZIP3?DIST_TARGETS += dist-bzip3
 ?GZIP?DIST_TARGETS += dist-gzip
 ?ZIP?DIST_TARGETS += dist-zip
 ?ZSTD?DIST_TARGETS += dist-zstd
@@ -443,6 +450,8 @@ distcheck: dist
          eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
        *.tar.bz2*) \
          bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.bz3*) \
+         bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\
        *.tar.lz*) \
          lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
        *.tar.xz*) \
diff --git a/t/dist-bzip3.sh b/t/dist-bzip3.sh
new file mode 100644 (file)
index 0000000..996f6fd
--- /dev/null
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+# Check support for dist-bzip3, with no-dist-gzip.
+
+required='bzip3'
+. test-init.sh
+
+echo AUTOMAKE_OPTIONS = dist-bzip3 > Makefile.am
+
+cat > configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-bzip3])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE dist-bzip3
+test -s $distdir.tar.bz3
+
+:
index 33020db77923f5d636079920126f8b3893c9b1aa..5c711cd89744d103db1b3d8fae26de6d9502853b 100644 (file)
@@ -59,6 +59,7 @@ setup_vars_for_compression_format ()
     lzip) suffix=tar.lz  compressor=lzip     ;;
       xz) suffix=tar.xz  compressor=xz       ;;
    bzip2) suffix=tar.bz2 compressor=bzip2    ;;
+   bzip3) suffix=tar.bz3 compressor=bzip3    ;;
      zip) suffix=zip     compressor=zip      ;;
     zstd) suffix=tar.zst compressor=zstd     ;;
        *) fatal_ "invalid compression format '$1'";;
index 2c6c271ea1decb27c46e56e0bd79d0a2bbde8658..afa63782281f2ce3569b92ef6e57daaaac9be5e3 100644 (file)
@@ -405,6 +405,7 @@ t/deprecated-acinit.sh \
 t/destdir.sh \
 t/dir-named-obj-is-bad.sh \
 t/discover.sh \
+t/dist-bzip3.sh \
 t/dist-formats.tap \
 t/dist-lzma.sh \
 t/dist-tarZ.sh \