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

Re: postinst?



On Thu, Sep 02, 1999 at 02:27:51PM +0100, Julian Gilbey wrote:
> Incidentally, for debhelper to put *anything* in a maintainer script
> ({pre,post}{inst,rm}), you need to have at least the following minimal
> script:
> 
> #! /bin/sh
> 
> #DEBHELPER#
> 
> I don't believe that debhelper will create the script otherwise.

It will. If you don't have postinst, but dh_* scripts create
postinst.debhelper, dh_installdeb will copy that to
debian/tmp/DEBIAN/postinst . Same goes for other p* scripts.

> postinst:
> ---------
> #! /bin/sh
> if [ "$1" = configure ]
[...]
> then
> fi
> 
> postrm:
> -------
> #! /bin/sh
> if [ "$1" = purge ]
> then
[...]
> fi

I agree with this approach. You should always check what $1 (and other
arguments) is/are, to avoid duplicating the installation time of a package.
Tip: prerm script should usually check this: [ "$1" != "upgrade" ] .

-- 
enJoy -*/\*- don't even try to pronounce my first name


Reply to: