From 11808852bee3457ada9318c2454f14eaa3e12218 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 25 Jun 2012 17:04:25 +0000 Subject: [PATCH] Fixes trac:2913. Ensure that OMPI_VERSION is tolerant of having spaces in it (i.e., so that it doesn't screw up the ident version string). This commit was SVN r26651. The following Trac tickets were found above: Ticket 2913 --> https://svn.open-mpi.org/trac/ompi/ticket/2913 --- opal/config/opal_configure_options.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/opal/config/opal_configure_options.m4 b/opal/config/opal_configure_options.m4 index 2b3f4a2aca..47750b47c3 100644 --- a/opal/config/opal_configure_options.m4 +++ b/opal/config/opal_configure_options.m4 @@ -489,7 +489,16 @@ AC_ARG_WITH([ident-string], if test "$with_ident_string" = "" -o "$with_ident_string" = "no"; then with_ident_string="%VERSION%" fi -with_ident_string="`echo $with_ident_string | sed -e 's/%VERSION%/'$OMPI_VERSION/`" +# This is complicated, because $OMPI_VERSION may have spaces in it. +# So put the whole sed expr in single quotes -- i.e., directly +# substitute %VERSION% for (not expanded) $OMPI_VERSION. +with_ident_string="`echo $with_ident_string | sed -e 's/%VERSION%/$OMPI_VERSION/'`" + +# Now eval an echo of that so that the "$OMPI_VERSION" token is +# replaced with its value. Enclose the whole thing in "" so that it +# ends up as 1 token. +with_ident_string="`eval echo $with_ident_string`" + AC_DEFINE_UNQUOTED([OPAL_IDENT_STRING], ["$with_ident_string"], [ident string for Open MPI]) AC_MSG_RESULT([$with_ident_string])