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

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



On Sun, Sep 08, 2002 at 07:00:14PM +0200, Sven LUTHER wrote:
[...]
> > 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.

But again there are 2 distinct issues:
  1.  Long term plans for sarge+1
  2.  Transition phase

IMO we should discuss 2 after 1, and not before.
  * Is /var/lib/ocaml/ld.conf a conffile?
  * Which package owns it?
  * How is it created?
  * How is it removed?
  * and other questions related to its modification by other packages;
    currently postinst and postrm (and not prerm as stated in
    ocaml_packaging_policy) scripts are used, but this may not
    be the best option.

Let me try.  As users must have no interaction with this file,
/var/lib/ocaml/ld.conf must not be a conffile,  It is obviously
created and removed by the package shipping ocaml-ldconf, i.e.
ocaml-base.  It must not be part of this package, otherwise it
is overwritten when upgrading ocaml-base.  So it must be created
and removed by maintainer scripts.
As ocaml-ldconf creates this file if it does not already exist, its
presence is not needed by other packages, and calling ocaml-ldconf
in ocaml-base.postinst looks like a good idea.  It does not hurt if
another OCaml package is configured first.
It seems natural to remove it during 'purge', so only postrm can be
used for this purpose.

Now consider how other packages should call ocaml-ldconf.  When
installing packages, 'ocaml-ldconf -a' must be called from postinst
to ensure that ocaml-ldconf do exist.  Similarly 'ocaml-ldconf -r'
must be called from prerm.
Mote: if we choose to remove this file when removing ocaml-base,
      then 'ocaml-ldconf -r' may also be called from postrm.

The fixed script must of course be used to gracefully handle
upgrades.

[...]
>     => 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>.

In fact 'ocaml-ldconf -R' could be called in any circumstance,
'ocaml-ldconf -r path' is only useful in interactive mode if you
want to manually change /var/lib/ocaml/ld.conf.  You could also
state that there is no need for a new -R flag and an empty string
after -r does the same job.

In this mail I only propose a long term solution.  If you agree with
it, we would then focus on the transition phase.

Denis



Reply to: