Skip to content

Commit

Permalink
cmake: Add -type f filter to find command
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
siddharth-narayan committed Jun 29, 2024
1 parent 6868fd8 commit 4f8de0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkgs/by-name/cm/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4f8de0d

Please sign in to comment.