Re: ocaml 3.04-3 uploaded
On Mon, Jan 14, 2002 at 03:06:15PM +0100, Sven wrote:
> Mmm, Xavier told me that ld.conf was built using /etc/ld.conf as example, so
> it is more a configuration file.
> Also it makes sense to let users modify them by hand, imagine people adding a
> homebuilt library or something such, without any knowledge of how debian
> That said, we could imagine handling 2 such databases ?
This indeed looks like a good idea. Here is a suggestion:
* /etc/ocaml/paths: configuration file which is manually edited
* /var/lib/ocaml/dpkg-paths: file automatically modified by dpkg
(its name is dpkg-paths in this mail to distinguish it from the
previous one, but it could be /var/lib/ocaml/paths).
* /usr/lib/ocaml/ld.conf: this file is generated by merging the 2 previous
* directory is ..... guess what?
add add a directory to search path before system wide settings
addafter add a directory to search path after system wide settings
discard remove a directory from search path even if it is defined
<directory> add <package>
where <package> is the name of the package which inserted this entry.
Thus both files can be described by a similar syntax:
<directory> <action> <package>
the 3rd field being optional.
Allowing comments (with an hash sign for instance) would be nice.
The ocaml-ldconf is used to insert and remove entries from dpkg-paths,
and generate ld.conf.
It could accept the following options:
-p package sets package name
-a dir adds a line `dir add package' into dpkg-paths if such
a line does not exist
-r dir remove lines `dir add package' from dpkg-paths if found
-n do not update ld.conf
When invoked without -n flag, ocaml-ldconf regenerates ld.conf this way:
* it reads paths line by line, and builds
a) D1: list of directories to insert before system dirs
b) D2: list of directories to insert after system dirs
c) I: list of directories to ignore
* after that, it reads dpkg-paths line by line, and builds a directory
list D3 by skipping those found in I.
Then D1+D3+D2 is written into /usr/lib/ocaml/ld.conf
It would also be nice if a warning line could be added to ld.conf to
prevent users from manually editing this file.
Last, ocaml-ldconf could be called directly by sysadmin to update ld.conf
after editing paths, or by maintainer scripts with arguments:
* in postinst:
ocaml-ldconf -p package -a dir1 -a dir2 -a dir3
* in postrm:
ocaml-ldconf -p package -r dir1 -r dir2 -r dir3