summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2019-04-25 12:50:16 -0400
committerGitHub <noreply@github.com>2019-04-25 12:50:16 -0400
commita682d720c729235b287bf1d4136e3bbd910ebd6c (patch)
tree5e87443b52f70441d9870895011e6f6d83df8c8e /pkgs
parent3901baa4a4dff400f9462e85b2b3236682b48097 (diff)
parentcc9b4029bc7ec91237ce44d04230b921005db6a0 (diff)
downloadnixpkgs-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.sh7
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)