bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] Enhancement: brotli integration into tar


From: Marius Spix
Subject: [Bug-tar] 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  <address@hidden>
+
+       Version 1.30
+
+       Add support for the brotli compression algorithm (RFC 7932).
+
 2016-05-16  Sergey Poznyakoff  <address@hidden>
 
        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 <address@hidden>.
 #
@@ -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='address@hidden'
 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], address@hidden)
+AC_INIT([GNU tar], [1.30], address@hidden)
 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}.
 
address@hidden
address@hidden --brotli
address@hidden -y
+
+This option tells @command{tar} to read or write archives through
address@hidden  @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
address@hidden 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},
address@hidden and traditional @command{compress}. The latter is
-supported mostly for backward compatibility, and we recommend
address@hidden, @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 address@hidden 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,
address@hidden 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}.
 
address@hidden brotli
address@hidden -y
address@hidden --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}
address@hidden @samp{.br} @tab @command{brotli}
address@hidden @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 <address@hidden>
 
 
+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             address@hidden
 Marcin Matuszewski     address@hidden
 Marcus Daniels         address@hidden
+Marius Spix            address@hidden
 Mark Bynum             address@hidden
 Mark Clements          address@hidden
 Mark Frost             address@hidden



reply via email to

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