From 34faed5bb06ee21c3c632299a9336d54ee7cb52a Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Thu, 29 Nov 2018 09:49:08 +0100 Subject: [PATCH] set-source-date-epoch-to-latest: fix warning If there was no older file than $NIX_BUILD_TOP this would result in a warning, e.g. with nix-info. ``` /nix/store/15kgcm8hnd99p7plqzx7p4lcr2jni4df-set-source-date-epoch-to-latest.sh: line 13: [: : integer expression expected ``` --- .../setup-hooks/set-source-date-epoch-to-latest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 84e40cd0514..ae34ffec485 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 @@ -10,7 +10,7 @@ updateSourceDateEpoch() { local newestFile="${res[1]}" # Update $SOURCE_DATE_EPOCH if the most recent file we found is newer. - if [ "$time" -gt "$SOURCE_DATE_EPOCH" ]; then + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile" export SOURCE_DATE_EPOCH="$time"