Re: using perl in preinst script
On Mon, Dec 27, 2010 at 04:53:11PM +0530, Rahul Amaram wrote:
> I am the maintainer for calendarserver. I have a query reg. preinst
> script. I need to perform some action during preinst before the upgrade of
> calendarserver happens from 1.x to 2.x. For this, I wrote the necessary
> code in python in preinst script. But this was rejected into being accepted
> into squeeze as writing python code or calling the python interpreter in
> preinst is not permitted.
Yeah, you can count on dependencies being installed in postinst but not
preinst (nor postrm purge). One solution would be to move your script to
postinst if that's possible. Another would be to add a Pre-Dependency,
although they are frowned upon unless there's no better way. If your script
is relatively simple, I'd go with perl as you said.
> As the upgrade code has to parse .plist files, writing shell script would
> be a very difficult task. So I would like to know what are my other
> options? Could I write it in perl?
Sure, as long as you don't use any modules not present in "perl-base".
1KB // Microsoft corollary to Hanlon's razor:
// Never attribute to stupidity what can be
// adequately explained by malice.