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

Re: Deb scripts idempotency [Was: Re: new packages uploaded ...]



On Mon, Dec 24, 2001 at 10:56:26AM +0100, Stefano Zacchiroli wrote:
> On Fri, Dec 21, 2001 at 02:54:19PM +0100, Sven wrote:
> > postinst :
> > 
> >     echo "/usr/lib/ocaml/lablgl" >>/usr/lib/ocaml/ld.conf
> 
> deb scripts must be idempotent, postinst as above is not. You can add a
> test that check if /usr/lib/ocaml/lablgl already esists in ld.conf, in
> such a case the new entry is not added.
Well, but the effect is idempotent, since having multiple time the same line
in the file will not modify anything.

I am more worried about the suppression of a line, especially if two or more
packages put files in the same place.

We definitively need a dh_ocaml or whatever utility to handle this, possibly
provided by the ocaml package. (using a counter maybe ?, we could also patch
the ocaml source to be able to use a counter as second field on those lines, i
will ask Xavier and the ocaml team about it).

> BTW as already proposed, we can write a simple perl script that add and
> remove entry from ld.conf, but where we can put them?

Erm, ... why not a little ocaml program ?

> Have we to ask the debhelper guys to include it in new debhelper or we
> want to add it to the ocaml package?

I would add it to the ocaml package, so we can use ocaml for it, and it makes
sense to add it in the place were the /usr/lib/ocaml/ld.conf file is provided.

Friendly,

Sven Luther



Reply to: