bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Add support for brotli compression


From: Marius Spix
Subject: Re: [PATCH] Add support for brotli compression
Date: Wed, 02 Aug 2023 22:03:49 -0000

Dear Jamie,

thank you for your great contribution.

I already suggested a nearly identical patch on 3 Oct 2017, see
the attached mail. I understand that you no mean that in a bad way, but
I friendly ask you to not adorn yourself with borrowed plumes
in the THANKS section.

Best regards,

Marius



Am Sat, 10 Jun 2023 15:28:42 -0700
schrieb Jamie Magee <jamie.magee@gmail.com>:

> * configure.ac (brotli): Register compression program.
> * THANKS: Add Jamie Magee.
> * doc/tar.1: Mention --brotli.
> * doc/tar.texi: Document brotli support.
> * src/buffer.c: Register brotli compression.
> * src/suffix.c: Add suffixes br and tbr.
> * src/tar.c: New compression option --brotli.
> * tests/testsuite.at (Compression): Add brotli test.
>
> Signed-off-by: Jamie Magee <jamie.magee@gmail.com>
> ---
>  THANKS             |  1 +
>  configure.ac       |  1 +
>  doc/tar.1          |  5 +++++
>  doc/tar.texi       | 13 ++++++++++++-
>  src/buffer.c       |  4 ++++
>  src/suffix.c       |  2 ++
>  src/tar.c          | 10 ++++++++++
>  tests/testsuite.at |  1 +
>  8 files changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/THANKS b/THANKS
> index aee0a924..abde2dd0 100644
> --- a/THANKS
> +++ b/THANKS
> @@ -228,6 +228,7 @@ James H Caldwell Jr       caldwell@cs.fsu.edu
>  James Stevens                James.Stevens@jrcs.co.uk
>  James V. DI Toro III karrde@gats.hampton.va.us
>  James W. McKelvey    mckelvey@fafnir.com
> +Jamie Magee          jamie.magee@gmail.com
>  Jamie Zawinski               jwz@lucid.com
>  Jan Carlson          janc@sni.ca
>  Jan Djarv            jan.djarv@mbox200.swipnet.se
> diff --git a/configure.ac b/configure.ac
> index a376709a..fb0d8c64 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -275,6 +275,7 @@ fi
>
>  TAR_COMPR_PROGRAM(compress)
>  TAR_COMPR_PROGRAM(gzip)
> +TAR_COMPR_PROGRAM(brotli)
>  TAR_COMPR_PROGRAM(bzip2)
>  TAR_COMPR_PROGRAM(lzip)
>  TAR_COMPR_PROGRAM(lzma)
> diff --git a/doc/tar.1 b/doc/tar.1
> index 23ae7ac2..be6a362d 100644
> --- a/doc/tar.1
> +++ b/doc/tar.1
> @@ -800,6 +800,10 @@ Filter data through \fICOMMAND\fR.  It must
> accept the \fB\-d\fR option, for decompression.  The argument can
> contain command line options.
>  .TP
> +\fB\-\-brotli\fR
> +Filter the archive through
> +.BR brotli (1).
> +.TP
>  \fB\-j\fR, \fB\-\-bzip2\fR
>  Filter the archive through
>  .BR bzip2 (1).
> @@ -1296,6 +1300,7 @@ compressor program failed.  Another example is
>  .B rmt
>  failure during backup to a remote device.
>  .SH "SEE ALSO"
> +.BR brotli (1)
>  .BR bzip2 (1),
>  .BR compress (1),
>  .BR gzip (1),
> diff --git a/doc/tar.texi b/doc/tar.texi
> index dac49f32..5449e65c 100644
> --- a/doc/tar.texi
> +++ b/doc/tar.texi
> @@ -2545,6 +2545,9 @@ with the block number in the archive file.
> @xref{block-number}. Sets the blocking factor @command{tar} uses to
> @var{blocking} x 512 bytes per record.  @xref{Blocking Factor}.
>
> +@item --brotli
> +Use @command{brotli} for compressing or decompressing the archives.
> @xref{gzip}. +
>  @opsummary{bzip2}
>  @item --bzip2
>  @itemx -j
> @@ -9694,6 +9697,7 @@ switch to @samp{posix}.
>  @cindex Storing archives in compressed format
>
>  @cindex gzip
> +@cindex brotli
>  @cindex bzip2
>  @cindex lzip
>  @cindex lzma
> @@ -9702,7 +9706,7 @@ switch to @samp{posix}.
>  @cindex zstd
>  @GNUTAR{} is able to create and read compressed archives.  It
> supports a wide variety of compression programs, namely:
> @command{gzip}, -@command{bzip2}, @command{lzip}, @command{lzma},
> @command{lzop}, +@command{brotli}, @command{bzip2}, @command{lzip},
> @command{lzma}, @command{lzop}, @command{zstd}, @command{xz} and
> traditional @command{compress}. The latter is supported mostly for
> backward compatibility, and we recommend against using it, because it
> is by far less effective than the other @@ -9716,6 +9720,7 @@ table
> below: @multitable @columnfractions 0.4 0.2 0.4
>  @headitem Long            @tab Short       @tab Archive format
>  @item @option{--gzip}     @tab @option{-z} @tab @command{gzip}
> +@item @option{--brotli}   @tab             @tab @command{brotli}
>  @item @option{--bzip2}    @tab @option{-j} @tab @command{bzip2}
>  @item @option{--xz}       @tab @option{-J} @tab @command{xz}
>  @item @option{--lzip}     @tab             @tab @command{lzip}
> @@ -9829,6 +9834,10 @@ Filter the archive through @command{gzip}.
>  @itemx --xz
>  Filter the archive through @code{xz}.
>
> +@opindex brotli
> +@item --brotli
> +Filter the archive through @command{brotli}.
> +
>  @item -j
>  @itemx --bzip2
>  Filter the archive through @code{bzip2}.
> @@ -9912,6 +9921,8 @@ suffix.  The following suffixes are recognized:
>  @item @samp{.taz} @tab @command{gzip}
>  @item @samp{.Z} @tab @command{compress}
>  @item @samp{.taZ} @tab @command{compress}
> +@item @samp{.br} @tab @command{brotli}
> +@item @samp{.tbr} @tab @command{brotli}
>  @item @samp{.bz2} @tab @command{bzip2}
>  @item @samp{.tz2} @tab @command{bzip2}
>  @item @samp{.tbz2} @tab @command{bzip2}
> diff --git a/src/buffer.c b/src/buffer.c
> index a929138f..f1af7850 100644
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -276,6 +276,7 @@ enum compress_type {
>    ct_tar,              /* Plain tar file */
>    ct_compress,
>    ct_gzip,
> +  ct_brotli,
>    ct_bzip2,
>    ct_lzip,
>    ct_lzma,
> @@ -305,6 +306,8 @@ static struct zip_magic const magic[] = {
>    { ct_tar,      0, 0 },
>    { ct_compress, 2, "\037\235" },
>    { ct_gzip,     2, "\037\213" },
> +  { ct_brotli,   4, "\x91\x19\x62\x66" },
> +  { ct_brotli,   4, "\xCE\xB2\xCF\x81" },
>    { ct_bzip2,    3, "BZh" },
>    { ct_lzip,     4, "LZIP" },
>    { ct_lzma,     6, "\xFFLZMA" },
> @@ -320,6 +323,7 @@ static struct zip_program zip_program[] = {
>    { ct_compress, COMPRESS_PROGRAM, "-Z" },
>    { ct_compress, GZIP_PROGRAM,     "-z" },
>    { ct_gzip,     GZIP_PROGRAM,     "-z" },
> +  { ct_brotli,   BROTLI_PROGRAM,   "--brotli" },
>    { ct_bzip2,    BZIP2_PROGRAM,    "-j" },
>    { ct_bzip2,    "lbzip2",         "-j" },
>    { ct_lzip,     LZIP_PROGRAM,     "--lzip" },
> diff --git a/src/suffix.c b/src/suffix.c
> index f03a3960..b0d0531e 100644
> --- a/src/suffix.c
> +++ b/src/suffix.c
> @@ -35,6 +35,8 @@ static struct compression_suffix
> compression_suffixes[] = { { S(taz,  GZIP) },
>    { S(Z,    COMPRESS) },
>    { S(taZ,  COMPRESS) },
> +  { S(br,   BROTLI) },
> +  { S(tbr,  BROTLI) },
>    { S(bz2,  BZIP2) },
>    { S(tbz,  BZIP2) },
>    { S(tbz2, BZIP2) },
> diff --git a/src/tar.c b/src/tar.c
> index d65fc806..f48b5625 100644
> --- a/src/tar.c
> +++ b/src/tar.c
> @@ -273,6 +273,7 @@ enum
>    ACLS_OPTION = CHAR_MAX + 1,
>    ATIME_PRESERVE_OPTION,
>    BACKUP_OPTION,
> +  BROTLI_OPTION,
>    CHECK_DEVICE_OPTION,
>    CHECKPOINT_OPTION,
>    CHECKPOINT_ACTION_OPTION,
> @@ -720,6 +721,7 @@ static struct argp_option options[] = {
>    {"use-compress-program", 'I', N_("PROG"), 0,
>     N_("filter through PROG (must accept -d)"), GRID_COMPRESS },
>    /* Note: docstrings for the options below are generated by
> tar_help_filter */
> +  {"brotli", BROTLI_OPTION, 0, 0, NULL, GRID_COMPRESS },
>    {"bzip2", 'j', 0, 0, NULL, GRID_COMPRESS },
>    {"gzip", 'z', 0, 0, NULL, GRID_COMPRESS },
>    {"gunzip", 0, 0, OPTION_ALIAS, NULL, GRID_COMPRESS },
> @@ -1146,6 +1148,10 @@ tar_help_filter (int key, const char *text,
> void *input) s = (char*) text;
>        break;
>
> +    case BROTLI_OPTION:
> +      s = easprintf (_("filter the archive through %s"),
> BROTLI_PROGRAM);
> +      break;
> +
>      case 'j':
>        s = easprintf (_("filter the archive through %s"),
> BZIP2_PROGRAM); break;
> @@ -1417,6 +1423,10 @@ parse_opt (int key, char *arg, struct
> argp_state *state) read_full_records_option = true;
>        break;
>
> +    case BROTLI_OPTION:
> +      set_use_compress_program_option (BROTLI_PROGRAM, args->loc);
> +      break;
> +
>      case 'c':
>        set_subcommand_option (CREATE_SUBCOMMAND);
>        break;
> diff --git a/tests/testsuite.at b/tests/testsuite.at
> index 9ee9dd9a..6c3643a7 100644
> --- a/tests/testsuite.at
> +++ b/tests/testsuite.at
> @@ -240,6 +240,7 @@ m4_popdef([CPT_CHECK])
>  AT_BANNER([Compression])
>  m4_include([compress.m4])
>  TAR_CHECK_COMPRESS(gzip, gz, tgz)
> +TAR_CHECK_COMPRESS(brotli, br, tbr)
>  TAR_CHECK_COMPRESS(bzip2, bz2, tbz2)
>  TAR_CHECK_COMPRESS(xz, xz, txz)
>  dnl: omit lzma, because it would fail due to magic number mismatch

--- Begin Message --- Subject: Enhancement: brotli integration into tar Date: Tue, 3 Oct 2017 23:40:40 +0200
Dear community,

brotli is a compression algorithm specifically created to compress
hypertext documents and texts in the most common human languages.
Please find below a patch which integrates brotli into GNU tar to
create br compressed tar files. The files have the extension .tbr and
the new command line options -y and --brotli are added to tar.

Do you have any questions? I am looking forward to receiving your
feedback.

Best wishes

Marius




===
diff -bur tar-1.29/acinclude.m4 tar-1.30/acinclude.m4
--- tar-1.29/acinclude.m4       2016-04-05 16:20:36.000000000 +0200
+++ tar-1.30/acinclude.m4       2017-10-03 23:04:54.596473997 +0200
@@ -1,6 +1,6 @@
 dnl Special Autoconf macros for GNU tar         -*- autoconf -*-
 
-dnl Copyright 2009, 2013-2014, 2016 Free Software Foundation, Inc.
+dnl Copyright 2009, 2013-2014, 2016-2017 Free Software Foundation, Inc.
 dnl
 dnl This file is part of GNU tar.
 dnl
diff -bur tar-1.29/ChangeLog tar-1.30/ChangeLog
--- tar-1.29/ChangeLog  2016-05-16 11:22:21.000000000 +0200
+++ tar-1.30/ChangeLog  2017-10-03 22:06:12.923701501 +0200
@@ -1,3 +1,9 @@
+2017-10-03  Marius Spix  <marius.spix@web.de>
+
+       Version 1.30
+
+       Add support for the brotli compression algorithm (RFC 7932).
+
 2016-05-16  Sergey Poznyakoff  <gray@gnu.org.ua>
 
        Version 1.29
diff -bur tar-1.29/config.h.in tar-1.30/config.h.in
--- tar-1.29/config.h.in        2016-05-16 10:52:47.000000000 +0200
+++ tar-1.30/config.h.in        2017-10-03 20:57:31.222967767 +0200
@@ -18,6 +18,9 @@
 /* Define to the number of bits in type 'wint_t'. */
 #undef BITSIZEOF_WINT_T
 
+/* Define to the program name of brotli compressor program */
+#undef BROTLI_PROGRAM
+
 /* Define to the program name of bzip2 compressor program */
 #undef BZIP2_PROGRAM
 
diff -bur tar-1.29/configure tar-1.30/configure
--- tar-1.29/configure  2016-05-16 10:52:00.000000000 +0200
+++ tar-1.30/configure  2017-10-03 23:09:27.811456347 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU tar 1.29.
+# Generated by GNU Autoconf 2.69 for GNU tar 1.30.
 #
 # Report bugs to <bug-tar@gnu.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='GNU tar'
 PACKAGE_TARNAME='tar'
-PACKAGE_VERSION='1.29'
-PACKAGE_STRING='GNU tar 1.29'
+PACKAGE_VERSION='1.30'
+PACKAGE_STRING='GNU tar 1.30'
 PACKAGE_BUGREPORT='bug-tar@gnu.org'
 PACKAGE_URL='http://www.gnu.org/software/tar/'
 
@@ -1577,6 +1577,7 @@
 with_lzma
 with_lzop
 with_xz
+with_brotli
 with_gnu_ld
 enable_rpath
 with_libiconv_prefix
@@ -2141,7 +2142,7 @@
   # Omit some internal or obsolete options to make the list less
imposing. # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GNU tar 1.29 to adapt to many kinds of systems.
+\`configure' configures GNU tar 1.30 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -2211,7 +2212,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GNU tar 1.29:";;
+     short | recursive ) echo "Configuration of GNU tar 1.30:";;
    esac
   cat <<\_ACEOF
 
@@ -2256,6 +2257,7 @@
   --with-lzma=PROG        use PROG as lzma compressor program
   --with-lzop=PROG        use PROG as lzop compressor program
   --with-xz=PROG          use PROG as xz compressor program
+  --with-brotli=PROG      use PROG as brotli compressor program
   --with-gnu-ld           assume the C compiler uses GNU ld
[default=no] --with-libiconv-prefix[=DIR]  search for libiconv in
DIR/include and DIR/lib --without-libiconv-prefix     don't search for
libiconv in includedir and libdir @@ -2361,7 +2363,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GNU tar configure 1.29
+GNU tar configure 1.30
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3070,7 +3072,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GNU tar $as_me 1.29, which was
+It was created by GNU tar $as_me 1.30, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4053,7 +4055,7 @@
 
 # Define the identity of the package.
  PACKAGE='tar'
- VERSION='1.29'
+ VERSION='1.30'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -35377,6 +35379,22 @@
 _ACEOF
 
 
+
+
+
+# Check whether --with-brotli was given.
+if test "${with_brotli+set}" = set; then :
+  withval=$with_brotli; tar_cv_compressor_brotli=${withval}
+else
+  tar_cv_compressor_brotli=bro
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define BROTLI_PROGRAM "$tar_cv_compressor_brotli"
+_ACEOF
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default archive
format" >&5 $as_echo_n "checking for default archive format... " >&6; }
 
@@ -38623,7 +38641,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GNU tar $as_me 1.29, which was
+This file was extended by GNU tar $as_me 1.30, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -38691,7 +38709,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\
-GNU tar config.status 1.29
+GNU tar config.status 1.30
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -bur tar-1.29/configure.ac tar-1.30/configure.ac
--- tar-1.29/configure.ac       2016-05-16 10:51:12.000000000 +0200
+++ tar-1.30/configure.ac       2017-10-03 23:09:17.444457017 +0200
@@ -1,6 +1,6 @@
 # Configure template for GNU tar.  -*- autoconf -*-
 
-# Copyright 1991, 1994-2010, 2013-2016 Free Software Foundation, Inc.
+# Copyright 1991, 1994-2010, 2013-2017 Free Software Foundation, Inc.
 
 # This file is part of GNU tar.
 
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([GNU tar], [1.29], [bug-tar@gnu.org])
+AC_INIT([GNU tar], [1.30], [bug-tar@gnu.org])
 AC_CONFIG_SRCDIR([src/tar.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
@@ -250,6 +250,7 @@
 TAR_COMPR_PROGRAM(lzma)
 TAR_COMPR_PROGRAM(lzop)
 TAR_COMPR_PROGRAM(xz)
+TAR_COMPR_PROGRAM(brotli,bro)
 
 AC_MSG_CHECKING(for default archive format)
 
diff -bur tar-1.29/doc/gendocs_template tar-1.30/doc/gendocs_template
--- tar-1.29/doc/gendocs_template       2016-01-20 10:26:32.000000000
+0100 +++ tar-1.30/doc/gendocs_template 2017-10-03
21:48:25.747770441 +0200 @@ -106,7 +106,7 @@
 </p>
 
 <p>
-Copyright 2004, 2013-2014, 2016 Free Software Foundation, Inc.,
+Copyright 2004, 2013-2014, 2017 Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
 <br />
 Verbatim copying and distribution of this entire article is
Only in tar-1.30/doc: Makefile
diff -bur tar-1.29/doc/Makefile.in tar-1.30/doc/Makefile.in
--- tar-1.29/doc/Makefile.in    2016-05-16 10:51:58.000000000 +0200
+++ tar-1.30/doc/Makefile.in    2017-10-03 23:03:18.745480189 +0200
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
diff -bur tar-1.29/doc/tar.1 tar-1.30/doc/tar.1
--- tar-1.29/doc/tar.1  2016-03-23 15:34:31.000000000 +0100
+++ tar-1.30/doc/tar.1  2017-10-03 21:55:16.422743911 +0200
@@ -1,5 +1,5 @@
 .\" This file is part of GNU tar. -*- nroff -*-
-.\" Copyright 2013-2014, 2016 Free Software Foundation, Inc.
+.\" Copyright 2013-2014, 2016-2017 Free Software Foundation, Inc.
 .\"
 .\" GNU tar is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published
by @@ -13,7 +13,7 @@
 .\"
 .\" You should have received a copy of the GNU General Public License
 .\" along with this program.  If not, see
<http://www.gnu.org/licenses/>. -.TH TAR 1 "March 23, 2016" "TAR" "GNU
TAR Manual" +.TH TAR 1 "October 3, 2017" "TAR" "GNU TAR Manual"
 .SH NAME
 tar \- an archiving utility
 .SH SYNOPSIS
@@ -815,6 +815,10 @@
 Filter the archive through
 .BR lzop (1).
 .TP
+\fB\-y\fR, \fB\-\-brotli\fR
+Filter the archive through
+.BR brotli (1).
+.TP
 \fB\-\-no\-auto\-compress\fR
 Do not use archive suffix to determine the compression program.
 .TP
@@ -1285,7 +1289,8 @@
 .BR rmt (8),
 .BR symlink (7),
 .BR tar (5),
-.BR xz (1).
+.BR xz (1),
+.BR brotli (1).
 .PP
 Complete \fBtar\fR manual: run
 .B info tar
diff -bur tar-1.29/doc/tar.texi tar-1.30/doc/tar.texi
--- tar-1.29/doc/tar.texi       2016-04-14 10:50:55.000000000 +0200
+++ tar-1.30/doc/tar.texi       2017-10-03 21:42:33.052793226 +0200
@@ -36,7 +36,7 @@
 @value{VERSION}, @value{UPDATED}), which creates and extracts files
 from archives.
 
-Copyright @copyright{} 1992, 1994--1997, 1999--2001, 2003--2016 Free
+Copyright @copyright{} 1992, 1994--1997, 1999--2001, 2003--2017 Free
 Software Foundation, Inc.
 
 @quotation
@@ -2497,6 +2497,13 @@
 Sets the blocking factor @command{tar} uses to @var{blocking} x 512
bytes per record.  @xref{Blocking Factor}.
 
+@opsummary{brotli}
+@item --brotli
+@itemx -y
+
+This option tells @command{tar} to read or write archives through
+@code{brotli}.  @xref{gzip}.
+
 @opsummary{bzip2}
 @item --bzip2
 @itemx -j
@@ -3951,7 +3958,7 @@
 
 @smallexample
 tar (GNU tar) @value{VERSION}
-Copyright (C) 2013-2016 Free Software Foundation, Inc.
+Copyright (C) 2013-2017 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>. This is free software: you are free
to change and redistribute it. There is NO WARRANTY, to the extent
permitted by law. @@ -9555,11 +9562,12 @@
 @cindex lzma
 @cindex lzop
 @cindex compress
+@cindex brotli
 @GNUTAR{} is able to create and read compressed archives.  It supports
 a wide variety of compression programs, namely: @command{gzip},
 @command{bzip2}, @command{lzip}, @command{lzma}, @command{lzop},
-@command{xz} and traditional @command{compress}. The latter is
-supported mostly for backward compatibility, and we recommend
+@command{xz}, @command{brotli} and traditional @command{compress}. The
latter +is supported mostly for backward compatibility, and we recommend
 against using it, because it is by far less effective than the other
 compression programs@footnote{It also had patent problems in the
past.}. 
@@ -9571,7 +9579,8 @@
 @option{--lzip} to create an @asis{lzip} compressed archive,
 @option{-J} (@option{--xz}) to create an @asis{XZ} archive,
 @option{--lzma} to create an @asis{LZMA} compressed
-archive, @option{--lzop} to create an @asis{LSOP} archive, and
+archive, @option{--lzop} to create an @asis{LSOP} archive,
+@option{--brotli} to create an @asis{brotli} archive, and
 @option{-Z} (@option{--compress}) to use @command{compress} program.
 For example:
 
@@ -9693,6 +9702,11 @@
 @item --lzop
 Filter the archive through @command{lzop}.
 
+@opindex brotli
+@item -y
+@itemx --brotli
+Filter the archive through @command{lzop}.
+
 @opindex compress
 @opindex uncompress
 @item -Z
@@ -9765,6 +9779,8 @@
 @item @samp{.tlz} @tab @command{lzma}
 @item @samp{.lzo} @tab @command{lzop}
 @item @samp{.xz} @tab @command{xz}
+@item @samp{.br} @tab @command{brotli}
+@item @samp{.tbr} @tab @command{brotli}
 @end multitable
 
 @anchor{use-compress-program}
diff -bur tar-1.29/Makefile.in tar-1.30/Makefile.in
--- tar-1.29/Makefile.in        2016-05-16 10:51:57.000000000 +0200
+++ tar-1.30/Makefile.in        2017-10-03 23:03:18.677480193 +0200
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -1573,9 +1573,10 @@
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
          && am__cwd=`pwd` \
          && $(am__cd) $(distdir)/_build \
-         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+         && ../configure \
            $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=.. --prefix="$$dc_install_base" \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
          && $(MAKE) $(AM_MAKEFLAGS) check \
diff -bur tar-1.29/NEWS tar-1.30/NEWS
--- tar-1.29/NEWS       2016-05-16 10:51:12.000000000 +0200
+++ tar-1.30/NEWS       2017-10-03 20:57:31.220967767 +0200
@@ -2,6 +2,10 @@
 Please send GNU tar bug reports to <bug-tar@gnu.org>
 
 
+version 1.30 - Marius Spix, 2017-010-03
+
+* New option -y or --brotli for brotli compression.
+
 version 1.29 - Sergey Poznyakoff, 2016-05-16
 
 * New options: --verbatim-files-from, --no-verbatim-files-from
diff -bur tar-1.29/src/buffer.c tar-1.30/src/buffer.c
--- tar-1.29/src/buffer.c       2016-03-14 21:58:16.000000000 +0100
+++ tar-1.30/src/buffer.c       2017-10-03 22:47:43.172540628 +0200
@@ -1,6 +1,6 @@
 /* Buffer management for tar.
 
-   Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2013-2014, 2016
Free
+   Copyright 1988, 1992-1994, 1996-1997, 1999-2010, 2013-2014,
2016-2017 Free Software Foundation, Inc.
 
    This file is part of GNU tar.
@@ -270,7 +270,8 @@
   ct_lzip,
   ct_lzma,
   ct_lzop,
-  ct_xz
+  ct_xz,
+  ct_brotli
 };
 
 static enum compress_type archive_compression_type = ct_none;
@@ -299,6 +300,9 @@
   { ct_lzma,     6, "\xFFLZMA" },
   { ct_lzop,     4, "\211LZO" },
   { ct_xz,       6, "\xFD" "7zXZ" },
+  { ct_brotli,   4, "\x91\x19\x62\x66" }, /* suggested by Joe Tsai */
+  { ct_brotli,   4, "\xCE\xB2\xCF\x81" }, /* suggested by Mark Adler */
+  { ct_brotli,   0, 0 }                   /* unframed stream */
 };
 
 #define NMAGIC (sizeof(magic)/sizeof(magic[0]))
@@ -314,6 +318,7 @@
   { ct_lzma,     XZ_PROGRAM,       "-J" },
   { ct_lzop,     LZOP_PROGRAM,     "--lzop" },
   { ct_xz,       XZ_PROGRAM,       "-J" },
+  { ct_brotli,   BROTLI_PROGRAM,   "-y" },
   { ct_none }
 };
 
diff -bur tar-1.29/src/Makefile.in tar-1.30/src/Makefile.in
--- tar-1.29/src/Makefile.in    2016-05-16 10:51:59.000000000 +0200
+++ tar-1.30/src/Makefile.in    2017-10-03 23:03:19.036480170 +0200
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.14 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
diff -bur tar-1.29/src/suffix.c tar-1.30/src/suffix.c
--- tar-1.29/src/suffix.c       2016-01-20 10:26:32.000000000 +0100
+++ tar-1.30/src/suffix.c       2017-10-03 21:49:02.204768086 +0200
@@ -1,5 +1,5 @@
 /* This file is part of GNU tar.
-   Copyright 2007, 2009, 2013-2014, 2016 Free Software Foundation, Inc.
+   Copyright 2007, 2009, 2013-2014, 2016-2017 Free Software
Foundation, Inc. 
    Written by Sergey Poznyakoff.
 
@@ -45,6 +45,8 @@
   { S(lzo,  LZOP) },
   { S(xz,   XZ) },
   { S(txz,  XZ) }, /* Slackware */
+  { S(br,   BROTLI) },
+  { S(tbr,  BROTLI) },
   { NULL }
 #undef S
 #undef __CAT2__
diff -bur tar-1.29/src/tar.c tar-1.30/src/tar.c
--- tar-1.29/src/tar.c  2016-03-24 06:42:14.000000000 +0100
+++ tar-1.30/src/tar.c  2017-10-03 21:48:31.749770053 +0200
@@ -1,6 +1,6 @@
 /* A tar (tape archiver) program.
 
-   Copyright 1988, 1992-1997, 1999-2001, 2003-2007, 2012-2016 Free
+   Copyright 1988, 1992-1997, 1999-2001, 2003-2007, 2012-2017 Free
    Software Foundation, Inc.
 
    Written by John Gilmore, starting 1985-08-25.
@@ -682,6 +682,7 @@
   {"lzma", LZMA_OPTION, 0, 0, NULL, GRID+1 },
   {"lzop", LZOP_OPTION, 0, 0, NULL, GRID+1 },
   {"xz", 'J', 0, 0, NULL, GRID+1 },
+  {"brotli", 'y', 0, 0, NULL, GRID+1 },
 #undef GRID
 
 #define GRID 100
@@ -1124,11 +1125,16 @@
 
     case LZOP_OPTION:
       s = xasprintf (_("filter the archive through %s"), LZOP_PROGRAM);
+      break;
 
     case 'J':
       s = xasprintf (_("filter the archive through %s"), XZ_PROGRAM);
       break;
 
+    case 'y':
+      s = xasprintf (_("filter the archive through %s"),
BROTLI_PROGRAM);
+      break;
+
     case ARGP_KEY_HELP_EXTRA:
       {
        const char *tstr;
@@ -1645,6 +1651,10 @@
       set_subcommand_option (EXTRACT_SUBCOMMAND);
       break;
 
+    case 'y':
+      set_use_compress_program_option (BROTLI_PROGRAM, args->loc);
+      break;
+
     case 'z':
       set_use_compress_program_option (GZIP_PROGRAM, args->loc);
       break;
diff -bur tar-1.29/THANKS tar-1.30/THANKS
--- tar-1.29/THANKS     2016-03-24 06:29:55.000000000 +0100
+++ tar-1.30/THANKS     2017-10-03 23:04:31.675475478 +0200
@@ -327,6 +327,7 @@
 Marc Ewing             marc@redhat.com
 Marcin Matuszewski     marcin@frodo.nask.org.pl
 Marcus Daniels         marcus@sysc.pdx.edu
+Marius Spix            marius.spix@web.de
 Mark Bynum             bynum@cennas.nhmfl.gov
 Mark Clements          mpc@mbsmm.com
 Mark Frost             mfrost@ncd.com

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]