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

Re: purge_ld_conf.pl [Was: Re: the move to stublib]



On Sat, Sep 07, 2002 at 11:33:15AM +0200, Stefano Zacchiroli wrote:
> On Fri, Sep 06, 2002 at 08:14:19PM +0200, Sven LUTHER wrote:
> > I now have a working -R option in the ocaml-ldconf program, see the
> > attached code.
> 
> Well done, thanks.

Stefano, i have thought about it a bit more, and this morning, between
sleep and wakedness, i think i had a nice idea ...

We can implement this stuff in order that it is centralized, and still
let the libraries do the stuff themselves, but without any kind of
effort to the library maintainers. It would need changing dh_ocamlld
some (but it may well be a trivial change, i think), but not as much as
with the version checking idea.

Basically, it goes as follows :

We test in dh_ocamlld if the directory list is empty or not.

  => if the directory list is not empty, then we keep everything as
  before.

  => if the directory list is empty, then we don't use a postrm, and
  change the postinst so that ocaml-ldconf -plibname-ocaml -R is called.

What do you think of it.

This would need only trivial change in dh_ocamlld, i mean, it would need
a conditional construct on the emptyness of @ARGV (or the @ARGC = 0 if
something such exists), and either do as we do right now, or create a
new script with :

autoscript($package,"postinst","postinst-ocamlld-empty","s/#PACKAGE#/$package/");

We need a new postinst-ocamlld-empty, but it would be a trivial one to
write : 

if [ "$1" = "configure" -a -x /usr/bin/ocaml-ldconf ]; then
        /usr/bin/ocaml-ldconf -p #PACKAGE# -R
fi

This way, each package knows about the directories to remove, so no need
for parsing for empty directories, but there is no (much) change needed
for library maintainers and all the change is in a centralized location,
and we can remove it later on, if we feel like it.

It is not possible to do the version checking thingy though.

In recapitulation, for libraries, we would have three situation :

1) Newly created libraries which follow the stublibs rule => No
dh_ocamlld call is needed.

2) Old style libraries which do not follow the stublibs rule => we do as
before.

3) Old libraries, adapted to use stublibs, => need a call to dh_ocamlld
with the -p option, but an empty package list (most already do, i
think).

Finally, the ocaml-base situation is solved by calling ocaml-ldconf by
hand in a postinst, as i do now.

What do you all think about it ?

Could someone knowledgeable in perl send me a modified dh_ocamlld that
does this ?

Friendly,

Sven Luther



Reply to: