Re: purge_ld_conf.pl [Was: Re: the move to stublib]
On Sun, Sep 08, 2002 at 03:45:59PM +0200, Denis Barbier wrote:
> On Sun, Sep 08, 2002 at 10:03:10AM +0200, Sven LUTHER wrote:
> [...]
> > 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 ?
>
> Sven, before jumping into details, we should:
> a) define procedures to run on package install and upgrade
> b) find how to implement these procedures without breaking
> installed packages.
Huh ???
> I am at the moment confused by all the recent mails about this issue and
> unable to know what you have in mind.
Ok, let me recapitulate this :
a) Old scheme libraries did add directories to /var/lib/ocaml/ld.conf
during configure and remove them during remove. They failed to remove
dirs during upgrade though.
b) New scheme libraries put all stublibs in a common place, so no
/var/lib/ocaml/ld.conf entry is needed.
c) Saddly, due to the fact the old dh_ocamlld forgot to handle the
removal of the directories of /var/lib/ocaml/ld.conf in an upgrade,
the entries did not get removed when switching from a) libraries to b)
libraries.
This last point is what we want to fix.
o Stefano proposed to have a script scan all entries in
/var/lib/ocaml/ld.conf and remove the ones corresponding to empty
directories. This script would be centralized in a ocaml-base
postinst, or whatever.
o I feel it is better to handle this per package, so there is no need
to scan the directories to see if they are empty or not, or whatever.
I would have liked an option passing to dh_ocamlld so libraries can
tell dh_ocamlld prior to which fixed version the removal script would
need to be called. => I was told by you and Stefano that this was a
too heavy thing to do.
So the idea is :
o have dh_ocamlld check if the directory list passed to dh_ocamlld is
empty or not:
=> it is not empty, do as usual (with the fixed script, which will
handle upgrade also).
=> it is empty, then we use postinst-ocamlld-empty, which simply
calls ocaml-ldconf -p<package_name> -R, and will remove all entries
in /var/lib/ocaml/ld.conf corresponding to the package
<package_name>.
I believe this to be quite easy to do (you would need a conditional
switch testing if @ARGV is empty or something) and a
postinst-ocamlld-empty script to be included in the empty case.
This will not break any installed package, will allow library packager
to fix the current problem by simply having a dh_ocamlld call with an
empty dirlist, and allow for a central place where the fix is found.
Friendly,
Sven Luther
Reply to: