Subject: bug#73795: closed (Re: [bug#73795] [PATCH] Add support for the bzip3 compression tool to automake.)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 21 Feb 2025 17:44:06 +0000

Your bug report

#73795: [PATCH] Add support for the bzip3 compression tool to automake.

which was filed against the automake-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73795: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73795
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#73795] [PATCH] Add support for the bzip3 compression tool to automake.
From: Karl Berry <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 21 Feb 2025 10:43:03 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Kamila,

    Subject: [bug#73795] [PATCH] Add support for the bzip3 compression tool to

I just pushed this (plus a simple test) for the next automake release.
Thanks again. --best, karl.

Subject: [PATCH] Add support for the bzip3 compression tool to automake.
From: Kamila Szewczyk <[email-masked]>
To: [email-masked]
Date: Sun, 13 Oct 2024 16:44:09 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

bzip3 (https://github.com/kspalaiologos/bzip3) is a free and open-source LGPLv3-licensed data
compression utility that excels at compressing text and source code.

Compression ratio tests for the automake distribution tarball:
% wc -c *tar*
1885428 automake-1.17.0.91.tar.bz2
1500817 automake-1.17.0.91.tar.bz3
2456935 automake-1.17.0.91.tar.gz
1641112 automake-1.17.0.91.tar.xz

---
 bin/automake.in         | 3 ++-
 lib/Automake/Options.pm | 1 +
 lib/am/distdir.am       | 9 +++++++++
 t/dist-formats.tap      | 1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/bin/automake.in b/bin/automake.in
index a17f45236..30d82bb96 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3856,7 +3856,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")
@@ -6898,6 +6898,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',
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 2dc7899f8..d08af3ef1 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -275,6 +275,7 @@ sub _is_valid_easy_option ($)
     color-tests
     dejagnu
     dist-bzip2
+    dist-bzip3
     dist-lzip
     dist-xz
     dist-zip
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index c85f6a325..4a7534f98 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -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-formats.tap b/t/dist-formats.tap
index 34d88b67c..13250327c 100644
--- a/t/dist-formats.tap
+++ b/t/dist-formats.tap
@@ -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'";;
-- 
2.45.2