Skip to content

Commit

Permalink
cmake: refactor setup hook's find command
Browse files Browse the repository at this point in the history
It became unnecessarily repetitive and complicated.
  • Loading branch information
vcunat committed Jul 20, 2024
1 parent 4f8de0d commit 5155e0c
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 -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"
Expand Down

0 comments on commit 5155e0c

Please sign in to comment.