From 212174064cce8883e1bb61c8f813998f3f3d73df Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Fri, 9 Aug 2019 14:22:30 +0200
Subject: [PATCH] CONFIG: robuster paraview detection

---
 wmake/scripts/paraviewFunctions | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wmake/scripts/paraviewFunctions b/wmake/scripts/paraviewFunctions
index b528f22cf71..4e7cceeb247 100644
--- a/wmake/scripts/paraviewFunctions
+++ b/wmake/scripts/paraviewFunctions
@@ -121,17 +121,17 @@ have_pvplugin_support()
 
     # Extract the paraview major+minor version from the directory name
     # From /path/paraview-5.6 -> 5.6
-    pv_api=$(echo "${targetDir##*/}" | \
-        sed -n -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
+    pv_api=$(echo "$targetDir" | \
+        sed -ne 's@^.*/@@;s/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p')
 
     [ -n "$targetDir" ] || {
-        echo "$warn (could determine target)"
+        echo "$warn (could not determine target)"
         echo "    PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-???}"
         return 1
     }
 
     [ -n "$pv_api" ] || {
-        echo "$warn (could determine major.minor version)"
+        echo "$warn (could not determine major.minor version)"
         return 1
     }
 
-- 
GitLab