From 4f8de0d5512a4a25448bf2c6588fc401139ff5c7 Mon Sep 17 00:00:00 2001 From: siddharth-narayan Date: Fri, 28 Jun 2024 22:03:13 -0400 Subject: [PATCH] cmake: Add -type f filter to find command This commit adds the -type f filter to the find command. Previously, -type f only applied to the first file name: *.cmake. The -o command means that -type f has to be added back for the other file names. --- 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 b28ed42b6896b..b9abeea23222d 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 -name "*.cmake.in" -o -name CMakeLists.txt \) -print | + find "$1" \( -type f -name "*.cmake" -o -type f -name "*.cmake.in" -o -type f -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"