Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 50625 - camlimages' and ulex' unmerges break OCAML environment
Summary: camlimages' and ulex' unmerges break OCAML environment
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Gentoo Team for the ML programming language family
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-10 04:39 UTC by Julien TIERNY
Modified: 2004-05-22 07:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien TIERNY 2004-05-10 04:39:38 UTC
Hi,
	I have written an ebuild for an ML library and I found that two of the "dev-ml" section ebuilds were suspicious.
	Camlimges' and ulex' ebuilds copy the ML linker configuration file to the ${D} subdirectories.
	The consequence is that Portage sees that file as part of those packages (camlimages & ulex).
	This means that when you unmerge those packages, the /usr/lib/ocaml/ld.conf shared file is deleted, which breaks OCAML environment.

	The solution I found is to implement the "src_unpack" function and to copy ld.conf in the ${W} directory and to correct ld.conf's location in the related Makefile.
	The effective patch of the shared file /usr/lib/ocaml/ld.conf should be implemented in the "pkg_postinst" function so that the linker configuration file should not be deleted at unmerge.

	Feel free to contact me for further details,
	See you all, great job, julien
Comment 1 Matthieu Sozeau (RETIRED) gentoo-dev 2004-05-10 14:53:10 UTC
I fixed the ebuilds in CVS (r1 versions). It should not happen anymore, once we get bug #39246 proposal running. Try if you've got some time :)
Comment 2 Julien TIERNY 2004-05-11 03:45:44 UTC
Hi mattieu,

	I noticed your corrections.
	The ML linker configuration file is no more deleted at related ebuilds' unmerge. Mentioned packages unmerge ok.
	
	There still remain cosmetic issues:

	* ulex-0.2-r1: the previous ebuild (ulex-0.2) used to add the following line in /usr/lib/ocaml/ld.conf : "/usr/lib/ocaml/site-packages/ulex" which is no more the case (I assume the library won't be able to get linked).

	* camlimages-2.11-r1: when you do the following steps :
		# emerge camlimages
		# emerge unmerge camlimages
		# emerge camlimages
	Portage adds twice camlimages library's location in /usr/lib/ocaml/ld.conf (I don't actually know the consequences)
	
	In both cases, this could be corrected as follows:

	pkg_postinst() {
    		local ECHO=$(which echo)
		local CAT=$(which cat)
		local GREP=$(which grep)

		if [ -z `$CAT /usr/lib/ocaml/ld.conf | $GREP ${LIBLOCATION}` ]
		then
			einfo "Patching OCAML linker configuration file..."
			$ECHO ${LIBLOCATION} >> /usr/lib/ocaml/ld.conf
		fi
	}

	Replacing ${LIBLOCATION} by the path mentioned in the Makefile.

	Sorry for beeing that maniac,
	see you all, julien
Comment 3 Matthieu Sozeau (RETIRED) gentoo-dev 2004-05-22 07:14:20 UTC
The fact the camlimages adds itself twice could be corrected indeed, but that's not a bug and will not happen when the aforementionned bug's solution will be in place. ld.conf is used only for C libraries linked to some package, so as ulex doesn't link to any, we can safely set OCAMLFIND_LDCONF=dummy and not mess with ld.conf. I have no problem with this sort of nitpicking :)