summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2017-08-13 09:28:05 +0000
committerVolth <volth@webmaster.ms>2017-08-13 09:33:09 +0000
commitb971f8de8e590e18151a709edf093ee735e090b6 (patch)
tree1687668c607a6b5f7ba4bb50e6aa7abc3f8d33ec /pkgs/build-support
parentef026e02fcaa92323be875d8c7146b0b86e31880 (diff)
downloadnixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar.gz
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar.bz2
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar.lz
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar.xz
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.tar.zst
nixlib-b971f8de8e590e18151a709edf093ee735e090b6.zip
set-source-date-epoch-to-latest.sh: ignore generated files
set-source-date-epoch-to-latest.sh to ignore files newer than "$NIX_BUILD_TOP/.." (unlike "$NIX_BUILD_TOP" it is root-owned and cannot be touched by nixbld1).
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..a2449b2704aa 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\n' | sort -n | tail -n1))
+    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.