From 5155e0c03b02a28f803b46544faeed30beb88918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sat, 20 Jul 2024 09:40:30 +0200 Subject: [PATCH] cmake: refactor setup hook's find command It became unnecessarily repetitive and complicated. --- pkgs/by-name/cm/cmake/setup-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/cm/cmake/setup-hook.sh b/pkgs/by-name/cm/cmake/setup-hook.sh index b9abeea23222..29b72ddda435 100755 --- a/pkgs/by-name/cm/cmake/setup-hook.sh +++ b/pkgs/by-name/cm/cmake/setup-hook.sh @@ -5,7 +5,7 @@ addCMakeParams() { fixCmakeFiles() { # Replace occurences of /usr and /opt by /var/empty. echo "fixing cmake files..." - find "$1" \( -type f -name "*.cmake" -o -type f -name "*.cmake.in" -o -type f -name CMakeLists.txt \) -print | + find "$1" -type f \( -name "*.cmake" -o -name "*.cmake.in" -o -name CMakeLists.txt \) -print | while read fn; do sed -e 's^/usr\([ /]\|$\)^/var/empty\1^g' -e 's^/opt\([ /]\|$\)^/var/empty\1^g' < "$fn" > "$fn.tmp" mv "$fn.tmp" "$fn"