automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT


From: Ralf Wildenhues
Subject: Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT
Date: Tue, 5 Oct 2010 06:57:51 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Jim, all,

* Jim Meyering wrote on Mon, Oct 04, 2010 at 07:10:54PM CEST:
> From ebb9b294cf878ed7083376bd15a0269a0583836c Mon Sep 17 00:00:00 2001

> Subject: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT
> 
> * lib/am/distdir.am (dist-xz): Do not hard-code xz's -9: that
> made it impossible to override.  Instead, use its XZ_OPT envvar,
> defaulting to -9 if not defined.  Thus no change in behavior
> when XZ_OPT is not set, and now, this rule honors the setting
> of that envvar when it is set.  Suggested by Lasse Collin.
> * NEWS (Miscellaneous changes): Mention it.
> * doc/automake.texi (The Types of Distributions): Describe the newly
> enabled environment variables.

This patch is OK with a couple of minor nits below addressed.

May I ask you to commit it on top of a fresh branch off of maint, and
merge that to master?  Sorry for not stating that before, making you do
double work, but that allows us to merge it to branch-1.11 later.
I can otherwise also do this, if you just post the final patch.
(The most painful part of this, thanks to git-merge-changelog, is
merging NEWS correctly; I'm still pondering whether to write a merge
driver for it or change the format to make it more suitable to branched
development.)

Based on Lasse's feedback, I'm wondering whether an xz default of -7 or
-8 is not sufficient for most practical uses.  I can address this later
though.

Thanks,
Ralf

> --- a/doc/automake.texi
> +++ b/doc/automake.texi
> @@ -8461,6 +8461,9 @@ The Types of Distributions
>  @item @code{dist-bzip2}
>  Generate a bzip2 tar archive of the distribution.  bzip2 archives are
>  frequently smaller than gzipped archives.

Please add @vindex entries for BZIP2 here, and XZ_OPT below.

> +By default, this rule makes @samp{bzip2} use a compression option of 
> @option{-9}.
> +To make it use a different one, set the @env{BZIP2} environment variable.
> +For example, @samp{make dist-bzip2 BZIP2=-7}.
>  @trindex dist-bzip2
> 
>  @item @code{dist-gzip}
> @@ -8487,6 +8490,10 @@ The Types of Distributions
>  Generate an @samp{xz} tar archive of the distribution.  @command{xz}
>  archives are frequently smaller than @command{bzip2}-compressed archives.
>  The @samp{xz} format displaces the obsolete @samp{lzma} format.
> +By default, this rule makes @samp{xz} use a compression option of 
> @option{-9}.
> +To make it use a different one, set the @env{XZ_OPT} environment variable.
> +For example, run this command to use the default compression ratio, but
> +with a progress indicator: @samp{make dist-xz XZ_OPT=-7e}.
>  @trindex dist-xz
> 
>  @item @code{dist-zip}

> --- a/lib/am/distdir.am
> +++ b/lib/am/distdir.am
> @@ -345,7 +345,8 @@ dist-gzip: distdir
>  ?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
>  .PHONY: dist-bzip2
>  dist-bzip2: distdir
> -     tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
> +     tardir=$(distdir) && $(am__tar) \
> +       | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2

Let's still keep these on one line, because they will typically render
ugly no matter where we split them: if AMTAR includes .../missing, then
that will already be too long, and if it doesn't, then a split before or
after && would be the most readable.  Below as well.

>       $(am__post_remove_distdir)
> 
>  ?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
> @@ -363,7 +364,8 @@ dist-lzma: distdir
>  ?XZ?DIST_ARCHIVES += $(distdir).tar.xz
>  .PHONY: dist-xz
>  dist-xz: distdir
> -     tardir=$(distdir) && $(am__tar) | xz -9 -c >$(distdir).tar.xz
> +     tardir=$(distdir) && $(am__tar) \
> +       | XZ_OPT=$${XZ_OPT--9} xz -c >$(distdir).tar.xz
>       $(am__post_remove_distdir)
> 
>  ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z



reply via email to

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