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.
This commit is contained in:
siddharth-narayan
2024-06-29 16:45:24 -04:00
committed by Siddharth
parent 6868fd8a96
commit 4f8de0d551
+1 -1
View File
@@ -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"