how-lix-os-pkgs/swig/default/patches-available/fix-test-sed-PATH.patch

19 lines
566 B
Diff

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"