On Tue, Sep 30, 2008 at 09:04:38PM +0100, Keith Roberts wrote:
On Tue, 30 Sep 2008, Peter Robinson wrote:
To: Keith Roberts keith@karsites.net, For testers of Fedora Core development releases fedora-test-list@redhat.com From: Peter Robinson pbrobinson@gmail.com Subject: Re: Help me triage
# Is there a general policy around using perl in pre/post ? https://bugzilla.redhat.com/show_bug.cgi?id=462996
There is no such policy.
I wish there was a policy for not using perl in pre/post scripts. The number of packages that use perl in a single line of the spec file and don't require it as a general dependency hence pulling in all of perl for nothing.
Not been following this topic that closely. Are you referring to using perl for pre/post RPM package installation?
Yes. As per the RHBZ bug that's mentioned (and just been closed because the perl script has been replaced with a sed script).
Peter
Would it be practical to use a PHP CLI script for pre/post RPM installation - not in this particular case, but in general? I find that bash scripts are a bit cryptic, and lack the power that PHP CLI scripts can offer. I have written backup scripts using PHP CLI mode scripts, and then called bash O/S shell programs that are not natively suppoerted by PHP. This gives me all the power of bash shell scripting, and all the added functionality and ease of use of PHP syntax :)
This is totally missing the point. The fact that RPM %post scripts exist at all is bad enough, but if you find yourself needing more "power" than just shell its usually a sign that you're solving the wrong problem. PHP isn't helping here - in fact it would be encouraging over-use of scripts. It is a pretty reasonable generalization that if you need more than shell, then you're probably doing it wrong. Furthermore anything you do in %post, needs to be reversable upon uninstall for %postun when the last instance of a package is removed. If your script is longer than a couple of lines of shell, then its highly unlikely you'll be able to create a bug-free %postun to reverse its action.
Daniel