[Top][All Lists]

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

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

From: Jim Meyering
Subject: [PATCH] dist-xz: don't hard-code -9: honor setting of XZ_OPT
Date: Sun, 03 Oct 2010 12:35:57 +0200

* lib/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.

Lasse Collin raised this issue and suggested the fix.
This is especially useful when you run "make dist" or "make distcheck"
and just want it to complete quickly -- i.e., you don't require maximum
compression because you're not about to distribute the resulting tarball,
so the extra cycles to shave off 5-10% would be wasted.  Personally,
I will make the default for my projects be -7 or so, while for release,
I automatically use -9ev already, by specifying XZ_OPT=-9ev in the rule
that invokes "make dist".

Let me know if you'd like a NEWS entry, or any other change.

 lib/am/ |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/am/ b/lib/am/
index a11d3a4..0cd07e0 100644
--- a/lib/am/
+++ b/lib/am/
@@ -363,7 +363,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

 ?COMPRESS?DIST_ARCHIVES += $(distdir).tar.Z

reply via email to

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