Merge pull request #60215 from nmattia/nm-tmp-timestamp
patchShebangs: create timestamp in tmp dir
This commit is contained in:
commit
a682d720c7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user