aboutsummaryrefslogtreecommitdiffstats
path: root/main/swig/fix-test-sed-PATH.patch
blob: 2eb96403e1217881977a4cdf6da56c84b90c2941 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Fix PATH that looks like:

/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
diff --git a/CCache/test.sh b/CCache/test.sh
index 3c44e85..3634883 100755
--- a/CCache/test.sh
+++ b/CCache/test.sh
@@ -17,8 +17,8 @@ fi
 
 # fix: Remove ccache from $PATH if it exists
 #      as it will influence the unit tests
-PATH="`echo $PATH | \
- sed -e 's!:/usr\(/local\)*/lib\([0-9]\)*/ccache\(/\)*!!g'`"
+PATH="$(echo $PATH | \
+ sed -E -e 's!(:|^)/usr(/local)*/lib([0-9])*/ccache(/[^:]*)*:?!!g')"
 
 if test -n "$CCACHE"; then
  CCACHE="$CCACHE"