Feature request #388

Handle multiline locate(1) output

Added by brook-nmsu-edu - over 17 years ago. Updated over 14 years ago.

Status:Closed
Priority:Low
Assignee:Gary Sherman
Category:Build/Install
Pull Request or Patch supplied: Resolution:fixed
Easy fix?:No Copied to github as #:10447

Description

At one point in the configure script locate(1) is used to find the python header file. It is assumed that the result of this command is a single line and sed(1) is used to remove the header file name to yield a python include directory. This fails if locate(1) returns more than one line. Returning more than one line is certainly possible, for example, if multiple versions of python are installed.

The patch below offers one expedient solution to the problem: clip the output of locate(1) to a single line using head(1). This will have no effect on systems for which locate(1) already produces only one line of output.

--- acinclude.m4.orig
+++ acinclude.m4
@@ -793,7 +802,7 @@
         python_prefix=/System/Library/Frameworks/Python.framework/*/
       fi
       AC_CHECK_HEADER([$ax_python_bin/Python.h],
-      [[ax_python_header=@locate $python_prefix$ax_python_bin/Python.h | sed -e s,/Python.h~@]],
+      [[ax_python_header=@locate $python_prefix$ax_python_bin/Python.h | head -1 | sed -e s,/Python.h~@]],
       ax_python_header=no)
       if test $ax_python_lib != no; then
         if test $ax_python_header != no; then

History

#1 Updated by Gavin Macaulay - over 17 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Applied in svn edafcc38 (SVN r6087)

#2 Updated by Anonymous over 14 years ago

Milestone Version 0.8 deleted

Also available in: Atom PDF