1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

* Don't replace /opt if it's followed by something other than

whitespace or a /, otherwise strings such as /foo/opticaldrive.c
  will be broken.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31793
This commit is contained in:
Eelco Dolstra 2012-01-23 13:16:51 +00:00
parent 3cf71dcfd1
commit 1e886749b5

View file

@ -3,10 +3,11 @@ 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 |
while read fn; do
sed -e 's|/usr|/var/empty|g' -e 's|/opt|/var/empty|g' < "$fn" > "$fn.tmp"
sed -e 's^/usr\([ /]\|$\)^/var/empty\1^g' -e 's^/opt\([ /]\|$\)^/var/empty\1^g' < "$fn" > "$fn.tmp"
mv "$fn.tmp" "$fn"
done
}