tech-pkg archive

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

devel/ocaml-findlib buildlink wrapper



Hi, 

While creating packages of OCaml libraries, I found two problems in
buildlink wrapper script of devel/ocaml-findlib.

I attached my patch, and describe what it does in this mail.

1. ocamlfind.sh intends to modify arguments when "ocamlfind install"
   subcommand is executed, and doesn't do anything when other subcommands
   are executed.

   However, case statement

case "$@" in
*install*)

   checks "if the entire command line contains 'install'", not "if the first argument is 'install'".
   This matches commands like "ocamlfind ocamldep > install_files.tmp".

   To check if the first argument is "install", I think

case "$1" in
install)

   is more appropriate.


2. Becuase argument modification uses largest match pattern, it causes
   trouble when installing file has "install" in its filename, such as
   sexplib_install_printers.ml.

   In the patch, I changed how argument is constructed.

args="install ${install_args} ${args#install}"

   To create $args, this line does

   1) with the change of case condition above, assume that first argument is always "install"
   2) append -destdir argument and -ldconf argument
   3) append original command line with "install" is removed


I tried "make package" in ocaml-* packages and succeeded.
Can I commit this?


Index: ocamlfind.sh
===================================================================
RCS file: /cvsroot/pkgsrc/devel/ocaml-findlib/files/ocamlfind.sh,v
retrieving revision 1.3
diff -b -u -r1.3 ocamlfind.sh
--- ocamlfind.sh	9 Oct 2014 20:53:15 -0000	1.3
+++ ocamlfind.sh	26 Oct 2014 16:47:40 -0000
@@ -2,8 +2,8 @@
 
 # $NetBSD: ocamlfind.sh,v 1.3 2014/10/09 20:53:15 jaapb Exp $
 
-case "$@" in
-*install*)
+case "$1" in
+install)
 	args="$@"
 	install_args=
 	case "$args" in
@@ -18,7 +18,7 @@
 		install_args="${install_args} -ldconf @BUILDLINK_DIR@/lib/ocaml/ld.conf"
 		;;
 	esac
-	args="${args%%install*}install ${install_args}${args##*install}"
+	args="install ${install_args} ${args#install}"
 	exec "@OCAML_FINDLIB_PREFIX@/bin/`basename $0`" ${args}
 	;;
 *)


Home | Main Index | Thread Index | Old Index