Add xz compression support.
authorJim Meyering <meyering@redhat.com>
Sat, 22 Nov 2008 11:02:36 +0000 (12:02 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 22 Nov 2008 11:08:39 +0000 (12:08 +0100)
* NEWS: Mention xz, as well as lzma (xz will displace lzma).
* automake.in (handle_dist): Recognize dist-xz.
(make_paragraphs): Map XZ to dist-xz.
* doc/automake.texi (Dist): Add dist-xz.
(Options): Likewise.
* lib/Automake/Options.pm (_process_option_list): Accept
dist-xz.
* lib/am/distdir.am (dist-xz): New rule.
(dist dist-all): Add command to create an xz-compressed tarball.
(distcheck): Handle xz-compressed tarballs just like the others.
* tests/xz.test: New file, based on nogzip.test.
* tests/Makefile.am (TESTS): Add xz.test.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
Makefile.in
NEWS
automake.in
doc/automake.texi
lib/Automake/Options.pm
lib/am/distdir.am
tests/Makefile.am
tests/Makefile.in
tests/xz.test [new file with mode: 0755]

index 2548528..e1b8548 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2008-11-22  Jim Meyering  <meyering@redhat.com>
+
+       Add xz compression support.
+       * NEWS: Mention xz as well as lzma (xz will displace lzma).
+       * automake.in (handle_dist): Recognize dist-xz.
+       (make_paragraphs): Map XZ to dist-xz.
+       * doc/automake.texi (Dist): Add dist-xz.
+       (Options): Likewise.
+       * lib/Automake/Options.pm (_process_option_list): Accept
+       dist-xz.
+       * lib/am/distdir.am (dist-xz): New rule.
+       (dist dist-all): Add command to create an xz-compressed tarball.
+       (distcheck): Handle xz-compressed tarballs just like the others.
+       * tests/xz.test: New file, based on nogzip.test.
+       * tests/Makefile.am (TESTS): Add xz.test.
+
+
 2008-11-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        When installing COPYING, recommend adding the file to VCS.
index d5ae72e..7f8b810 100644 (file)
@@ -534,6 +534,10 @@ dist-lzma: distdir
        tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
        $(am__remove_distdir)
 
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(am__remove_distdir)
+
 dist-tarZ: distdir
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__remove_distdir)
@@ -563,6 +567,8 @@ distcheck: dist
          bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
@@ -720,18 +726,19 @@ uninstall-am: uninstall-binSCRIPTS
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
        all all-am am--refresh check check-am clean clean-generic \
        ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-       dist-hook dist-lzma dist-shar dist-tarZ dist-zip distcheck \
-       distclean distclean-generic distclean-tags distcleancheck \
-       distdir distuninstallcheck dvi dvi-am html html-am info \
-       info-am install install-am install-binSCRIPTS install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-exec-hook install-html install-html-am \
-       install-info install-info-am install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs installdirs-am \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
-       uninstall uninstall-am uninstall-binSCRIPTS uninstall-hook
+       dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
+       distcheck distclean distclean-generic distclean-tags \
+       distcleancheck distdir distuninstallcheck dvi dvi-am html \
+       html-am info info-am install install-am install-binSCRIPTS \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-exec-hook install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+       tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \
+       uninstall-hook
 
 
 install-exec-hook:
diff --git a/NEWS b/NEWS
index 50a0a77..2910cf8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -53,7 +53,8 @@ New in 1.10a:
       cvs -d :pserver:anonymous@pserver.git.sv.gnu.org:/automake.git \
           checkout -d automake HEAD
 
-  - "make dist" can now create lzma-compressed tarballs.
+  - "make dist" can now create xz-compressed tarballs,
+    as well as (deprecated?) lzma-compressed tarballs.
 
   - Automake is licensed under GPLv3+.  `automake --add-missing' will
     by default install the GPLv3 file as COPYING if it is missing.
index ac1c8c2..24bb193 100755 (executable)
@@ -3723,7 +3723,7 @@ sub handle_dist ()
     {
       my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
       $archive_defined ||=
-       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma);
+       grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzma xz);
       error (option 'no-dist-gzip',
             "no-dist-gzip specified but no dist-* specified, "
             . "at least one archive format must be enabled")
@@ -6631,6 +6631,7 @@ sub make_paragraphs ($%)
                 'MAINTAINER-MODE'
                 => $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
 
+                'XZ'          => !! option 'dist-xz',
                 'LZMA'        => !! option 'dist-lzma',
                 'BZIP2'       => !! option 'dist-bzip2',
                 'COMPRESS'    => !! option 'dist-tarZ',
index 2fe3adb..8797d33 100644 (file)
@@ -8251,14 +8251,20 @@ Generate a gzip tar archive of the distribution.
 @trindex dist-gzip
 
 @item @code{dist-lzma}
-Generate a lzma tar archive of the distribution.  lzma archives are
-frequently smaller than @command{bzip2}-compressed archives.
+Generate an @samp{lzma} tar archive of the distribution.  @command{lzma}
+archives are frequently smaller than @command{bzip2}-compressed archives.
 @trindex dist-lzma
 
 @item @code{dist-shar}
 Generate a shar archive of the distribution.
 @trindex dist-shar
 
+@item @code{dist-xz}
+Generate an @samp{xz} tar archive of the distribution.  @command{xz}
+archives are frequently smaller than @command{bzip2}-compressed archives.
+The @samp{xz} format will soon (early 2009) displace the @samp{lzma} format.
+@trindex dist-xz
+
 @item @code{dist-zip}
 Generate a zip archive of the distribution.
 @trindex dist-zip
@@ -12319,4 +12325,4 @@ parentheses is the number of generated test cases.
 @c  LocalWords:  LTALLOCA MALLOC malloc memcmp strdup alloca libcompat xyz DFOO
 @c  LocalWords:  unprefixed buildable preprocessed DBAZ DDATADIR WARNINGCFLAGS
 @c  LocalWords:  LIBFOOCFLAGS LIBFOOLDFLAGS ftable testSubDir obj LIBTOOLFLAGS
-@c  LocalWords:  barexec Pinard's automatize initialize lzma
+@c  LocalWords:  barexec Pinard's automatize initialize lzma xz
index 1705981..5750cd1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006, 2007, 2008  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
@@ -259,7 +259,7 @@ sub _process_option_list (\%$@)
       elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
             || $_ eq 'dist-shar' || $_ eq 'dist-zip'
             || $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
-            || $_ eq 'dist-lzma'
+            || $_ eq 'dist-lzma' || $_ eq 'dist-xz'
             || $_ eq 'no-dist-gzip' || $_ eq 'no-dist'
             || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
             || $_ eq 'readme-alpha' || $_ eq 'check-news'
index 6f48293..218e65a 100644 (file)
@@ -304,6 +304,12 @@ dist-lzma: distdir
        tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
        $(am__remove_distdir)
 
+?XZ?DIST_ARCHIVES += $(distdir).tar.xz
+.PHONY: dist-xz
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+       $(am__remove_distdir)
+
 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z
 .PHONY: dist-tarZ
 dist-tarZ: distdir
@@ -341,6 +347,7 @@ dist dist-all: distdir
 ?GZIP? tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 ?BZIP2?        tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
 ?LZMA? tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+?XZ?   tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
 ?COMPRESS?     tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 ?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 ?ZIP?  -rm -f $(distdir).zip
@@ -368,6 +375,8 @@ distcheck: dist
          bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
        *.tar.lzma*) \
          unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
        *.tar.Z*) \
          uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
        *.shar.gz*) \
index 46fe0d5..9f9dc32 100644 (file)
@@ -654,6 +654,7 @@ werror.test \
 werror2.test \
 whoami.test \
 xsource.test \
+xz.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
index 57451a2..64668e0 100644 (file)
@@ -807,6 +807,7 @@ werror.test \
 werror2.test \
 whoami.test \
 xsource.test \
+xz.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
diff --git a/tests/xz.test b/tests/xz.test
new file mode 100755 (executable)
index 0000000..93f4630
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2008  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 3, 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 <http://www.gnu.org/licenses/>.
+
+# Check support for no-dist-gzip with xz
+
+required=xz
+. ./defs || Exit 1
+
+set -e
+
+cat > configure.in << 'END'
+AC_INIT([xz], [1.0])
+AM_INIT_AUTOMAKE([no-dist-gzip dist-xz])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+test: distcheck
+       test $(DIST_ARCHIVES) = foo-1.0.tar.xz
+       test -f $(DIST_ARCHIVES)
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE test