summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2017-09-02 21:36:34 +0200
committerVladimír Čunát <vcunat@gmail.com>2017-09-02 21:36:34 +0200
commit51d6d27e90c81cccb2bd0c5e36699796f96bb4c3 (patch)
treedb83ff915ffde3e6521bcaaa6c45feb59f49c2f5 /pkgs/build-support
parent1c45fd01aaaf09fd3f17fff4a91488b2f177e167 (diff)
parent4ebeb7d78296b26eede37495a2674494290d14f8 (diff)
downloadnixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar.gz
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar.bz2
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar.lz
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar.xz
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.tar.zst
nixlib-51d6d27e90c81cccb2bd0c5e36699796f96bb4c3.zip
Merge #28227: set-source-date-epoch-to-latest.sh: ignore generated files
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh
index fe3458cd21e8..6bf9a65b35af 100644
--- a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh
+++ b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh
@@ -4,8 +4,8 @@ updateSourceDateEpoch() {
     # Get the last modification time of all regular files, sort them,
     # and get the most recent. Maybe we should use
     # https://github.com/0-wiz-0/findnewest here.
-    local -a res=($(find "$path" -type f -print0 | xargs -0 -r stat -c '%Y %n' | sort -n | tail -n1))
-    local time="${res[0]}"
+    local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ %p\0' | sort -n --zero-terminated | tail -n1 --zero-terminated))
+    local time="${res[0]//\.[0-9]*/}" # remove the fraction part
     local newestFile="${res[1]}"
 
     # Update $SOURCE_DATE_EPOCH if the most recent file we found is newer.