Should example scripts be compressed?

Nicholas Bamber nicholas at periapt.co.uk
Tue Mar 15 09:11:18 UTC 2011


Proposal
--------

That when updating a package, if there is a script in the example it 
should not be compressed. Probbaly this could most accurately be 
implemented as

override_dh_compress:
	dh_compress -X.pl

Jawnsy's observations
---------------------
As far as I can see Jawnsy has made the following observations:
1.) Currently the default practice is to compress.
2.) The existing packages would have to be updated.
3.) The build infrastructure would have to be modified.

Periapt's reply
---------------
1.) The default practice is not necessarily optimal. Example scripts are 
probably meant to be run. Compressed text files are easy to read whereas 
compressed scripts are not. The user may not have root permissions (and 
so would have to copy the files) or may be a complete novice (and so 
would not know how to). If the example is complex involving scripts and 
config/HTML/template/CSS files, the integrity of the example might be 
broken. Also if ability of the end user to execute the script is not 
important, why do we bother fixing shebangs and permissions in the first 
place?

2.) I think this is a subtle but definite improvement. A mass update 
would not be required.

3.) Absolutely, it is the goal of this group to automate as much as 
possible. However if asked , I am sure that  Joey Hess would say that 
dh_compress already supplies all the necessary support in the -X option. 
Rather I would suggest that the correct place to implement this is in 
dh_make_perl. Whilst we are at it we could have dh_make_perl check for 
missing shebangs and broken permissions and add the necessary rules to 
fix them.

However when comparing this issue to #60893, we see that not much time 
would be taken up with this proposal even without the enhancements to 
dh_make_perl. Not all packages have examples. Not all examples include 
perl scripts. Very few example example perl scripts are large enough to 
get compressed. However almost every new package has a README file that 
has to be removed.

On 14/03/11 23:59, Nicholas Bamber wrote:
> I think the following IRC discussion covers all the issues perfectly
> well. Jawnsy and I look with interest as a consensus emerges.
>
> (23:49:42) jawnsy: periapt: why did you add this to libimager-perl?
> (23:49:43) jawnsy: 68784 periapt-guest override_dh_compress:
> (23:49:43) jawnsy: 68784 periapt-guest dh_compress -Xexamples
> (23:51:49) KGB-2: pkg-perl jawnsy-guest r71425 libimager-perl (33 files
> in 12 dirs)
> (23:51:49) KGB-2: pkg-perl * New upstream release
> (23:51:49) KGB-2: pkg-perl * Bump to debhelper compat 8
> (23:51:58) periapt: jawnsy: I don't see why scripts should be compressed.
> (23:52:26) jawnsy: periapt: I don't see why they can't be, if they are
> example scripts
> (23:52:47) jawnsy: periapt: scripts installed into bin/ are not
> compressed. that makes sense. example scripts? they're probably not used
> in a lot of cases, so no sense in installing them uncompressed IMO.
> (23:52:55) periapt: You can easily read a compressed file. Can you
> easily execute a compressed script?
> (23:53:20) jawnsy: periapt: if you can make a good argument for changing
> the way we install examples/ files, please do so (via the mailing list).
> otherwise I am inclined to remove that override
> (23:53:54) periapt: jawnsy: So can you hold off removing until that is
> discussed?
> (23:54:15) jawnsy: periapt: this package is now inconsistent with 99.99%
> of the other packages we have that also install examples
> (23:54:36) jawnsy: periapt: certainly. if it's decided that not
> compressing example scripts is a good idea, we should talk to Joey Hess
> (23:54:58) jawnsy: periapt: to get dh_installexamples or whatever not to
> compress things that are +x
> (23:55:09) periapt: jawnsy: That statistic does not stand upto a
> second's worth of reflection.
> (23:55:11) jawnsy: periapt: and secondly, we should add that override to
> all packages that install scripts into examples/
> (23:56:41) jawnsy: periapt: your reasoned analysis for why we should
> change from the status quo is most welcome :-) -- I look forward to
> seeing it in the next few days
> (23:57:03) KGB-1: pkg-perl jawnsy-guest r71426 libimager-perl
> debian/changelog
> (23:57:03) KGB-1: pkg-perl Waits for clarification regarding compressed
> example/ scripts
> (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.
>
> _______________________________________________
> pkg-perl-maintainers mailing list
> pkg-perl-maintainers at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/pkg-perl-maintainers
>




More information about the pkg-perl-maintainers mailing list