Hi together,

thank you for your feedback. I dropped the shortcut y.
Autodetection with the `a' function is possible when you use the file
extension .tbr.

Brotli is based on LZ77 and Huffman encoding, but comes with an inbuilt
dictionary for HTML, CSS and JavaScript as well as common English,
Spanish, Russian, Arabic, Chinese and Hindi terms and year numbers, but
also supports custom dictionaries (not supported by the tar
implementation, though). This makes tar.br, or short tbr, the ideal
format to archive static HTML documents and CSS stylesheets.

Please find the attached patch file. I am looking forward to reading
your feedback.

Best regards,

Marius

On Thu, 04 Oct 2017 13:59:02 +0300
Sergey Poznyakoff <g...@gnu.org.ua> wrote:

> Hi Marius,
> 
> Thanks for the patch.
> 
> There are two issues that strike the eye at the first glance.
> First of all, the -y option is in fact reserved (see comment
> in tar.c:373.
> 
> Second one is more serious:
> 
> >  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 */
> >  };  
> 
> The last line means that compression recognition code will qualify any
> file not matching any of the previous entries as brotli archive. I
> don't think it is correct.
> 
> Regards,
> Sergey
> 
> 

diff -ur 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.s...@web.de>
+
+	Version 1.30
+
+	Add support for the brotli compression algorithm (RFC 7932).
+
 2016-05-16  Sergey Poznyakoff  <g...@gnu.org.ua>
 
 	Version 1.29
diff -ur 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 -ur 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 --brotli for brotli compression
+
 version 1.29 - Sergey Poznyakoff, 2016-05-16
 
 * New options: --verbatim-files-from, --no-verbatim-files-from
diff -ur 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		m...@redhat.com
 Marcin Matuszewski	mar...@frodo.nask.org.pl
 Marcus Daniels		mar...@sysc.pdx.edu
+Marius Spix		marius.s...@web.de
 Mark Bynum		by...@cennas.nhmfl.gov
 Mark Clements		m...@mbsmm.com
 Mark Frost		mfr...@ncd.com
diff -ur 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 -ur tar-1.29/aclocal.m4 tar-1.30/aclocal.m4
--- tar-1.29/aclocal.m4	2016-05-16 10:51:55.000000000 +0200
+++ tar-1.30/aclocal.m4	2017-10-03 23:03:17.668480259 +0200
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.14 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
@@ -35,7 +35,7 @@
 [am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
Nur in tar-1.30: autom4te.cache.
diff -ur 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 -ur 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-07 15:05:50.811555234 +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 -ur 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)
 
Nur in tar-1.30/doc: Makefile.
diff -ur 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 -ur 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-07 15:05:29.473556612 +0200
@@ -106,7 +106,7 @@
 </p>
 
 <p>
-Copyright 2004, 2013-2014, 2016 Free Software Foundation, Inc.,
+Copyright 2004, 2013-2014, 2016-2017 Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
 <br />
 Verbatim copying and distribution of this entire article is
diff -ur 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-07 15:01:43.628571202 +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\-\-brotli\fR
+Filter the archive through
+.BR bro (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 -ur 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-07 15:12:03.235531175 +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,12 @@
 Sets the blocking factor @command{tar} uses to @var{blocking} x 512 bytes per
 record.  @xref{Blocking Factor}.
 
+@opsummary{brotli}
+@item --brotli
+
+This option tells @command{tar} to read or write archives through
+@code{brotli}.  @xref{gzip}.
+
 @opsummary{bzip2}
 @item --bzip2
 @itemx -j
@@ -3951,7 +3957,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 +9561,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 +9578,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 +9701,10 @@
 @item --lzop
 Filter the archive through @command{lzop}.
 
+@opindex brotli
+@item --brotli
+Filter the archive through @command{bro}.
+
 @opindex compress
 @opindex uncompress
 @item -Z
@@ -9765,6 +9777,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}
Nur in tar-1.30/gnu: .deps.
Nur in tar-1.30/gnu: Makefile.
diff -ur tar-1.29/gnu/Makefile.in tar-1.30/gnu/Makefile.in
--- tar-1.29/gnu/Makefile.in	2016-05-16 10:51:58.000000000 +0200
+++ tar-1.30/gnu/Makefile.in	2017-10-03 23:03:18.841480183 +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.
Nur in tar-1.30/gnu/uniwidth: .deps.
Nur in tar-1.30/lib: .deps.
Nur in tar-1.30/lib: Makefile.
diff -ur tar-1.29/lib/Makefile.in tar-1.30/lib/Makefile.in
--- tar-1.29/lib/Makefile.in	2016-05-16 10:51:58.000000000 +0200
+++ tar-1.30/lib/Makefile.in	2017-10-03 23:03:18.893480179 +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 -ur tar-1.29/rmt/Makefile.in tar-1.30/rmt/Makefile.in
--- tar-1.29/rmt/Makefile.in	2016-05-16 10:51:58.000000000 +0200
+++ tar-1.30/rmt/Makefile.in	2017-10-03 23:03:18.941480176 +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 -ur tar-1.29/scripts/Makefile.in tar-1.30/scripts/Makefile.in
--- tar-1.29/scripts/Makefile.in	2016-05-16 10:51:58.000000000 +0200
+++ tar-1.30/scripts/Makefile.in	2017-10-03 23:03:18.986480173 +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 -ur 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 -ur 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-07 14:54:44.374598286 +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,11 @@
   { ct_lzma,     6, "\xFFLZMA" },
   { ct_lzop,     4, "\211LZO" },
   { ct_xz,       6, "\xFD" "7zXZ" },
+  /* Brotli has no framed format yet, but there are two suggestions of
+     Joe Tsai and Mark Adler who use "\x91\x19\x62\x66" or "\xCE\xB2\xCF\x81",
+     respectively as a magic number. The current implementation has not
+     magic number at all, so no autodetection here.
+  */
 };
 
 #define NMAGIC (sizeof(magic)/sizeof(magic[0]))
@@ -314,6 +320,7 @@
   { ct_lzma,     XZ_PROGRAM,       "-J" },
   { ct_lzop,     LZOP_PROGRAM,     "--lzop" },
   { ct_xz,       XZ_PROGRAM,       "-J" },
+  { ct_brotli,   BROTLI_PROGRAM,   "--brotli" },
   { ct_none }
 };
 
diff -ur 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 -ur 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-07 14:48:41.451621731 +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.
@@ -293,6 +293,7 @@
   LZIP_OPTION,
   LZMA_OPTION,
   LZOP_OPTION,
+  BROTLI_OPTION,
   MODE_OPTION,
   MTIME_OPTION,
   NEWER_MTIME_OPTION,
@@ -682,6 +683,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", BROTLI_OPTION, 0, 0, NULL, GRID+1 },
 #undef GRID
 
 #define GRID 100
@@ -1124,11 +1126,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 BROTLI_OPTION:
+      s = xasprintf (_("filter the archive through %s"), BROTLI_PROGRAM);
+      break;
+
     case ARGP_KEY_HELP_EXTRA:
       {
 	const char *tstr;
@@ -1645,6 +1652,10 @@
       set_subcommand_option (EXTRACT_SUBCOMMAND);
       break;
 
+    case BROTLI_OPTION:
+      set_use_compress_program_option (BROTLI_PROGRAM, args->loc);
+      break;
+
     case 'z':
       set_use_compress_program_option (GZIP_PROGRAM, args->loc);
       break;
diff -ur tar-1.29/tests/Makefile.in tar-1.30/tests/Makefile.in
--- tar-1.29/tests/Makefile.in	2016-05-16 10:51:59.000000000 +0200
+++ tar-1.30/tests/Makefile.in	2017-10-03 23:03:19.089480167 +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.

Reply via email to