diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index c51fce708f3..50c1e391c33 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -59,7 +59,9 @@ patchShebangs() { echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"" # escape the escape chars so that sed doesn't interpret them escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g') + mod_time=$(stat --format=%y "$f") sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" + touch -d "$mod_time" "$f" fi fi done