changeset 1662:b545f7d7cf6d

8136764: ORIGINAL_PATH is broken if PATH contains directory with "#" in it's name Reviewed-by: erikj, tbell
author ihse
date Mon, 21 Sep 2015 09:40:37 +0200
parents 6849581ba4ab
children 75db54c6c259
files common/autoconf/basics.m4 common/autoconf/generated-configure.sh
diffstat 2 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/basics.m4	Mon Sep 21 09:32:07 2015 +0200
+++ b/common/autoconf/basics.m4	Mon Sep 21 09:40:37 2015 +0200
@@ -445,6 +445,15 @@
   # Save the current directory this script was started from
   CURDIR="$PWD"
 
+  # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
+  # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
+  # was not available at that time.
+  REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
+  if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
+    ORIGINAL_PATH="$REWRITTEN_PATH"
+    AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
+  fi
+
   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
     PATH_SEP=";"
     BASIC_CHECK_PATHS_WINDOWS
--- a/common/autoconf/generated-configure.sh	Mon Sep 21 09:32:07 2015 +0200
+++ b/common/autoconf/generated-configure.sh	Mon Sep 21 09:40:37 2015 +0200
@@ -4362,7 +4362,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1442820670
+DATE_WHEN_GENERATED=1442820958
 
 ###############################################################################
 #
@@ -13844,6 +13844,16 @@
   # Save the current directory this script was started from
   CURDIR="$PWD"
 
+  # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
+  # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
+  # was not available at that time.
+  REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
+  if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
+    ORIGINAL_PATH="$REWRITTEN_PATH"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&5
+$as_echo "$as_me: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&6;}
+  fi
+
   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
     PATH_SEP=";"