mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03:00
patchShebangs: strip trailing whitespace
Prior to this commit, trailing whitespace would be introduced when modifying '#!' lines with no arguments. For example (whitespace added): /nix/store/.../foo: interpreter directive changed from "/bin/bash" to "/nix/store/...-bash-4.3-p42/bin/bash " /nix/store/.../bar: interpreter directive changed from "/bin/baz wef" to "/nix/store/...-baz wef " We add a sed command to strip trailing whitespace, so the above commands would drop the two spaces after "bash", or the one space after "baz wef". abbradar: fixed commit title Closes #16785.
This commit is contained in:
parent
8b92103ae8
commit
ff3e7d2b4b
@ -46,7 +46,8 @@ patchShebangs() {
|
||||
args="$arg0 $args"
|
||||
fi
|
||||
|
||||
newInterpreterLine="$newPath $args"
|
||||
# Strip trailing whitespace introduced when no arguments are present
|
||||
newInterpreterLine=$(echo "$newPath $args" | sed 's/[[:space:]]*$//')
|
||||
|
||||
if [ -n "$oldPath" -a "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ]; then
|
||||
if [ -n "$newPath" -a "$newPath" != "$oldPath" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user