mass rewrite of find parameters to cross-platform style
Fixes #9044, close #9667. Thanks to @taku0 for suggesting this solution. Now we have no modes starting with `/` or `+`. Rewrite the `-perm` parameters of find: - completely safe: rewrite `/0100` and `+100` to `-0100`, - slightly semantics-changing: rewrite `+111` to `-0100`. I cross-verified the `find` manual pages for Linux, Darwin, FreeBSD.
This commit is contained in:
@@ -26,7 +26,7 @@ wrapPythonProgramsIn() {
|
||||
done
|
||||
|
||||
# Find all regular files in the output directory that are executable.
|
||||
for f in $(find "$dir" -type f -perm /0100); do
|
||||
for f in $(find "$dir" -type f -perm -0100); do
|
||||
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
|
||||
if head -n1 "$f" | grep -q '#!.*/env.*\(python\|pypy\)'; then
|
||||
sed -i "$f" -e "1 s^.*/env[ ]*\(python\|pypy\)^#! $python^"
|
||||
|
||||
Reference in New Issue
Block a user