Re: Should example scripts be compressed?
On Mon, Mar 14, 2011 at 7:59 PM, Nicholas Bamber <email@example.com> wrote:
> (23:57:09) periapt: jawnsy: It's perfectly possible that current practice is
> suboptimal. I thought it was so obvious that I did not hesitate to add the
> override. Maybe it did not get into dh_installexamples because it is rare
> enough that it has so far not become an issue.
Note that I replied:
19:56:51 < jawnsy> periapt: it is possible, sure. I do not agree, but
I do look forward to your discussion and hope that it will change my
I was hoping for some actual analysis and discussion, not just a
copy/paste snippet from IRC.
Here are my reasons against this change:
* Many packages install example scripts without such override (I would
surmise the majority of Perl packages maintained in the group do not
have this override -- perhaps this has just not come up yet, since
things will not be compressed unless they are > 4kB (or some other
* The examples aren't used often, and decompressing them locally prior
to executing doesn't seem like that big of a deal
* Catering to a minority of users (that wish to execute example
scripts directly) at the cost of a majority of users having slightly
inflated install sizes does not seem like a worthwhile tradeoff to me
(though given the inexpensive disk on most systems, this may be a
* This diverges from upstream debhelper behaviour (though this can be
corrected if we decide this is a good idea)
* We will have to maintain a separate dh_compress override (until
perhaps debhelper compat 9, which could incorporate our requested
* Other packages may install example scripts -- e.g. Python libraries.
How have they dealt with this issue? (I would surmise the scripts are
just compressed per the normal debhelper behaviour)
* What about packages that install examples as C code? Should we also
provide an uncompressed, compiled version of the example file so that
people may execute it simply?
* I believe the main purpose of the example file is to be read, not
executed. This means using zcat is not a big deal, and subsequently,
doing zcat and copying the file locally (where the example may be
modified and executed) should be the 'correct' method of using these
Long story short:
I am not against a change here, but only if it can be determined that
the benefits outweigh the downsides. We also must account for the
extra cost of maintaining these overrides (in terms of mental clutter)
-- this issue is mitigated if we can convince Joey Hess that these
changes should be integrated into debhelper.
A way forward:
If we decide to go along with this change, then we should ask Joey
Hess to modify debhelper such that: if a file installed into examples/
is +x, then do not compress it. As mentioned earlier, likely this
feature cannot appear before debhelper compat 9. In the meantime, we
can establish a policy to add these lines (dh_compress -Xexamples)
wherever scripts are installed into examples/.
Note, however, that the current incantation of dh_compress -Xexamples
will not compress *anything* in examples, including non-executable
script text files.