Re: the move to stublib
On Thu, Sep 05, 2002 at 03:46:10PM +0200, Denis Barbier wrote:
> On Thu, Sep 05, 2002 at 02:42:57PM +0200, Sven LUTHER wrote:
> > On Sat, Aug 31, 2002 at 11:54:31AM +0200, Remi VANICAT wrote:
> > > Hello,
> > >
> > > It seem that there is a problem with the move to stublib :
> > >
> > > - it seem that at its installation, the ocaml package doesn't run
> > > ocaml-ldconf any more, leaving the following ld.conf :
> > >
> > > /build/buildd/ocaml-3.06/debian/ocaml/usr/lib/ocaml/stublibs
> > > /build/buildd/ocaml-3.06/debian/ocaml/usr/lib/ocaml
> >
> > Yes, this is a problem with the dh_ocamlld scripts, which were supposed
> > to run ocaml-ldconf even with an empty directory list, but Denis patch
> > did not seem to do the job. This is fixed in 3.06-4 and later, by hand
> > running ocaml-ldconf in the postinst of ocaml-base.
>
> I will have some free time now to look into this problem.
> But why is /var/lib/ocaml/ld.conf a conffile? Looks like a very bad
> idea, since user is asked whether he wants to keep his current file.
> Instead ocaml-base.postinst should create an empty /var/lib/ocaml/ld.conf
> and run ocaml-ldconf.
The idea was so the file did not get removed if ocaml-base is
--force-depends removed, i think, but then, maybe it was just a mistake.
Anyway, i don't think it should stay as a conffile.
Right now, ocaml-ldconf does (or should do) as follows :
o None of the 3 ld.conf files exist in the package.
o All are created by ocaml-ldconf if they don't exist yet.
o /usr/lib/ocaml/ld.conf is read-only by default, and ocaml-ldconf
knows how to change that when it updates it. This may not be sure, as
they may be race conditions, if some other package writes to it at the
same time as ocaml-ldconf. I could fix this by writting to another
file and copying it over or something such.
Alternatively, i could also patch ocaml so the file is named
debian_ld.conf or something such, and don't need to worry for it to
be read-only.
o /etc/ocaml/ld.conf is marked as a conffile.
o A new option might be added (-R ?) so that it removes all dirs
associated with the given package.
dh_ocamlld should be modified so that :
o When called with a directory argument, it adds/removes the
corresponding directories
o We add a new option (-e for empty or -i for postinst ?) which will
make that a call with an empty dirlist will add a call to
ocaml-ldconf without argument to regenerate /usr/lib/ocaml/ld.conf
to the postinst of the package.
o We add a new option (-r for remove, with an optional version number)
which will make that a call with an empty dirlist will add a call to
ocaml-ldconf -R (or -R version) to the postinst.
Then, we use :
o in ocaml-base : dh_ocamlld -i -pocaml-base
o in broken libraries : dh_ocamlld -rver.num-deb -pbroken-lib
o in legacy libraries : dh_ocamlld -a -plegacy-lib dir_list
Where ver.num-deb is the first version of this package which fixes the
problem. We then have some code in the postinst, which will check the
fixed ver.num-deb against the version to be removed, and call
ocaml-ldconf -R -pbroken-lib to remove all spurious entries.
The real problem here is to know if we can get in a postinst the
version of the package we are replacing and compare it to the current
package. This is not really a problem, it is just so that we don't need
to rerun ocaml-ldconf forever, just because we had a broken dh_ocamlld.
If it is not possible to do it, we just can tun ocamld-ldconf everytime
or something such.
What do you think about this scheme ?
Friendly,
Sven Luther
Reply to: