[Top][All Lists]
[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: |
Jim Meyering |
Subject: |
Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT |
Date: |
Tue, 05 Oct 2010 10:37:57 +0200 |
Ralf Wildenhues wrote:
> 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
Sure. What branch name would you like?
> 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.
I agree. Thanks.
> Please add @vindex entries for BZIP2 here, and XZ_OPT below.
Good point.
...
>> - 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.
OK.
Here's the incremental:
diff --git a/doc/automake.texi b/doc/automake.texi
index f8f2d8f..60e450f 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8458,6 +8458,7 @@ The Types of Distributions
distributions in various formats. Their targets are:
@table @asis
address@hidden BZIP2
@item @code{dist-bzip2}
Generate a bzip2 tar archive of the distribution. bzip2 archives are
frequently smaller than gzipped archives.
@@ -8486,6 +8487,7 @@ The Types of Distributions
Generate a shar archive of the distribution.
@trindex dist-shar
address@hidden XZ_OPT
@item @code{dist-xz}
Generate an @samp{xz} tar archive of the distribution. @command{xz}
archives are frequently smaller than @command{bzip2}-compressed archives.
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index ad789df..185d34c 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -345,8 +345,7 @@ dist-gzip: distdir
?BZIP2?DIST_ARCHIVES += $(distdir).tar.bz2
.PHONY: dist-bzip2
dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) \
- | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c
>$(distdir).tar.bz2
$(am__post_remove_distdir)
?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
@@ -364,8 +363,7 @@ dist-lzma: distdir
?XZ?DIST_ARCHIVES += $(distdir).tar.xz
.PHONY: dist-xz
dist-xz: distdir
- tardir=$(distdir) && $(am__tar) \
- | XZ_OPT=$${XZ_OPT--9} xz -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
Here's the merged result, including a summary and log that
also mention dist-bzip2:
>From 3b9a100b24b734cfd4cf934740c2694a0fc263c9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 2 Oct 2010 22:30:02 +0200
Subject: [PATCH] dist-xz, dist-bzip2: don't hard-code -9: honor envvar settings
* 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.
(dist-bzip2): Likewise for it's corresponding envvar: BZIP2.
* NEWS (Miscellaneous changes): Mention it.
* doc/automake.texi (The Types of Distributions): Describe the newly
enabled environment variables.
---
NEWS | 5 +++++
doc/automake.texi | 9 +++++++++
lib/am/distdir.am | 4 ++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 121989f..c64ec14 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,11 @@ New in 1.11a:
- "make dist" can now create lzip-compressed tarballs.
+ - You may adjust the compression options used in dist-xz and dist-bzip2.
+ The default is still -9 for each, but you may specify a different
+ level via the XZ_OPT and BZIP2 envvars respectively. E.g.,
+ "make dist-xz XZ_OPT=-7" or "make dist-xz BZIP2=-5"
+
- Messages of types warning or error from `automake' and `aclocal' are now
prefixed with the respective type, and presence of -Werror is noted.
diff --git a/doc/automake.texi b/doc/automake.texi
index 22c2f27..60e450f 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8458,9 +8458,13 @@ The Types of Distributions
distributions in various formats. Their targets are:
@table @asis
address@hidden BZIP2
@item @code{dist-bzip2}
Generate a bzip2 tar archive of the distribution. bzip2 archives are
frequently smaller than gzipped archives.
+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}
@@ -8483,10 +8487,15 @@ The Types of Distributions
Generate a shar archive of the distribution.
@trindex dist-shar
address@hidden XZ_OPT
@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 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}
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index a11d3a4..185d34c 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -345,7 +345,7 @@ 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
$(am__post_remove_distdir)
?LZIP?DIST_ARCHIVES += $(distdir).tar.lz
@@ -363,7 +363,7 @@ 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
--
1.7.3.1.45.g9855b
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, (continued)
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Ralf Wildenhues, 2010/10/03
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Jim Meyering, 2010/10/03
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Ralf Wildenhues, 2010/10/03
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Jim Meyering, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Stefano Lattarini, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Jim Meyering, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Stefano Lattarini, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Jim Meyering, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Stefano Lattarini, 2010/10/05
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Ralf Wildenhues, 2010/10/05
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT,
Jim Meyering <=
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Lasse Collin, 2010/10/04
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Ralf Wildenhues, 2010/10/11
- Re: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT, Lasse Collin, 2010/10/11