tech-pkg archive

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

devel/ocaml-findlib buildlink wrapper


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. 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

   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

   is more appropriate.

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

   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?

RCS file: /cvsroot/pkgsrc/devel/ocaml-findlib/files/,v
retrieving revision 1.3
diff -b -u -r1.3
---	9 Oct 2014 20:53:15 -0000	1.3
+++	26 Oct 2014 16:47:40 -0000
@@ -2,8 +2,8 @@
 # $NetBSD:,v 1.3 2014/10/09 20:53:15 jaapb Exp $
-case "$@" in
+case "$1" in
 	case "$args" in
@@ -18,7 +18,7 @@
 		install_args="${install_args} -ldconf @BUILDLINK_DIR@/lib/ocaml/ld.conf"
-	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