automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Add xz compression support.


From: Jim Meyering
Subject: Re: [PATCH] Add xz compression support.
Date: Wed, 12 Nov 2008 23:06:43 +0100

Ralf Wildenhues <address@hidden> wrote:
> thanks for the patch!
>
> * Jim Meyering wrote on Wed, Nov 12, 2008 at 10:33:19PM CET:
>>
>> lzma-utils is morphing into xz, and will yield a beta (aka stable API)
>> release of the xz package in the not too distant future.
>> What do you think of adding support for xz in automake?
>
> I think it is OK for master.

Great!

> Not sure about branch-1-10.

> Please post tests/xz.test as well.  Sorry I overlooked that earlier.

<blush> ;-)
Thanks for the quick feedback.

>> --- a/doc/automake.texi
>> +++ b/doc/automake.texi
>> @@ -8256,6 +8256,12 @@ frequently smaller than @command{bzip2}-compressed 
>> archives.
>>  Generate a shar archive of the distribution.
>>  @trindex dist-shar
>>
>> address@hidden @code{dist-xz}
>> +Generate an xz tar archive of the distribution.  xz archives are
>
> @samp{xz}   and  @command{xz} ?
>
>> +frequently smaller than @command{bzip2}-compressed archives.
>> +The xz format will soon (early 2009) displace the lzma format.
>
> @samp{xz} format  ?
>
>> address@hidden dist-xz

Good idea.
I'd just copied the formatting in the preceding dist-lzma section.
Better formatting is good for xz, so I've done the same
for the uses in the section on dist-lzma.

Here's the incremental for doc/:

diff --git a/doc/automake.texi b/doc/automake.texi
index 2c687b8..866faef 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8248,8 +8248,8 @@ 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}
@@ -8257,9 +8257,9 @@ Generate a shar archive of the distribution.
 @trindex dist-shar

 @item @code{dist-xz}
-Generate an xz tar archive of the distribution.  xz archives are
-frequently smaller than @command{bzip2}-compressed archives.
-The xz format will soon (early 2009) displace the lzma format.
+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}

============================================
And here's the complete amended change set:

>From 34001d6cea01b2a044327fc1a39d8f54e1cabec7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 29 Oct 2008 16:24:06 +0100
Subject: [PATCH] Add xz compression support.

* NEWS: Mention xz, as well 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):
* 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.
---
 NEWS                    |    3 ++-
 aclocal.m4              |    4 ++--
 automake.in             |    3 ++-
 doc/automake.texi       |   12 +++++++++---
 lib/Automake/Options.pm |    4 ++--
 lib/am/distdir.am       |    9 +++++++++
 tests/Makefile.am       |    1 +
 tests/Makefile.in       |    1 +
 tests/xz.test           |   41 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 69 insertions(+), 9 deletions(-)
 create mode 100755 tests/xz.test

diff --git a/NEWS b/NEWS
index 7ccc3e1..1878ced 100644
--- a/NEWS
+++ b/NEWS
@@ -53,7 +53,8 @@ New in 1.10a:
       cvs -d :pserver:address@hidden:/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.
diff --git a/aclocal.m4 b/aclocal.m4
index b275e43..d695c01 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,8 +13,8 @@

 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
-[m4_warning([this file was generated for autoconf 2.63.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63.107-cde7-dirty],,
+[m4_warning([this file was generated for autoconf 2.63.107-cde7-dirty.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 
`autoreconf'.])])
diff --git a/automake.in b/automake.in
index 66633df..c58f534 100755
--- a/automake.in
+++ b/automake.in
@@ -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',
diff --git a/doc/automake.texi b/doc/automake.texi
index e9aebc8..866faef 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8248,14 +8248,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

address@hidden @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.
address@hidden dist-xz
+
 @item @code{dist-zip}
 Generate a zip archive of the distribution.
 @trindex dist-zip
@@ -12308,4 +12314,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
address@hidden  LocalWords:  barexec Pinard's automatize initialize lzma
address@hidden  LocalWords:  barexec Pinard's automatize initialize lzma xz
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 1705981..5750cd1 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -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'
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 6f48293..218e65a 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -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*) \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 023e1f7..0bf918c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -653,6 +653,7 @@ werror.test \
 werror2.test \
 whoami.test \
 xsource.test \
+xz.test \
 yacc.test \
 yacc2.test \
 yacc3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 4207f6c..1aedd97 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -806,6 +806,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
index 0000000..d7fbcaa
--- /dev/null
+++ b/tests/xz.test
@@ -0,0 +1,41 @@
+#! /bin/sh
+# Copyright (C) 2003, 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
+# 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([foo], [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
--
1.6.0.4.879.g9d19a




reply via email to

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