Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8258925: configure script failed on WSL
Reviewed-by: dholmes, erikj
  • Loading branch information
YaSuenag committed Jan 11, 2021
1 parent cd73939 commit 712ea25057db51f33d3587114443f7cb3df972cc
Showing with 8 additions and 5 deletions.
  1. +8 −5 make/scripts/fixpath.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -145,11 +145,14 @@ function import_path() {
fi

if [[ "$path" != "" ]]; then
# Store current unix path
unixpath="$path"
# Now turn it into a windows path
winpath="$($PATHTOOL -w "$path" 2>/dev/null)"
# If it fails, try again with an added .exe (needed on WSL)
if [[ $? -ne 0 ]]; then
winpath="$($PATHTOOL -w "$path.exe" 2>/dev/null)"
unixpath="$unixpath.exe"
winpath="$($PATHTOOL -w "$unixpath" 2>/dev/null)"
fi
if [[ $? -eq 0 ]]; then
if [[ ! "$winpath" =~ ^"$ENVROOT"\\.*$ ]] ; then
@@ -159,11 +162,11 @@ function import_path() {
# This monster of a command uses the %~s support from cmd.exe to
# reliably convert to short paths on all winenvs.
shortpath="$($CMD /q /c for %I in \( "$winpath" \) do echo %~sI 2>/dev/null | tr -d \\n\\r)"
path="$($PATHTOOL -u "$shortpath")"
# Path is now unix style, based on short name
unixpath="$($PATHTOOL -u "$shortpath")"
# unixpath is based on short name
fi
# Make it lower case
path="$(echo "$path" | tr [:upper:] [:lower:])"
path="$(echo "$unixpath" | tr [:upper:] [:lower:])"
fi
else
# On WSL1, PATHTOOL will fail for files in envroot. If the unix path

0 comments on commit 712ea25

Please sign in to comment.