diff options
author | Graham Christensen <graham@grahamc.com> | 2019-04-25 12:50:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 12:50:16 -0400 |
commit | a682d720c729235b287bf1d4136e3bbd910ebd6c (patch) | |
tree | 5e87443b52f70441d9870895011e6f6d83df8c8e /pkgs | |
parent | 3901baa4a4dff400f9462e85b2b3236682b48097 (diff) | |
parent | cc9b4029bc7ec91237ce44d04230b921005db6a0 (diff) | |
download | nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar.gz nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar.bz2 nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar.lz nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar.xz nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.tar.zst nixpkgs-a682d720c729235b287bf1d4136e3bbd910ebd6c.zip |
Merge pull request #60215 from nmattia/nm-tmp-timestamp
patchShebangs: create timestamp in tmp dir
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/setup-hooks/patch-shebangs.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index d26bf735d30..de36b7ffabd 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -55,10 +55,11 @@ patchShebangs() { # escape the escape chars so that sed doesn't interpret them escapedInterpreterLine=$(echo "$newInterpreterLine" | sed 's|\\|\\\\|g') # Preserve times, see: https://github.com/NixOS/nixpkgs/pull/33281 - touch -r "$f" "$f.timestamp" + timestamp=$(mktemp) + touch -r "$f" "$timestamp" sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" - touch -r "$f.timestamp" "$f" - rm "$f.timestamp" + touch -r "$timestamp" "$f" + rm "$timestamp" fi fi done < <(find "$dir" -type f -perm -0100 -print0) |