summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2018-11-29 09:49:08 +0100
committerRobin Gloster <mail@glob.in>2018-11-29 09:49:08 +0100
commit34faed5bb06ee21c3c632299a9336d54ee7cb52a (patch)
treee8a458f3f7820b7999640383d6dfd8531bd91f09 /pkgs/build-support/setup-hooks
parent8e97e8009f88380ec4975fb162969757d5037bdc (diff)
downloadnixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar.gz
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar.bz2
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar.lz
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar.xz
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.tar.zst
nixpkgs-34faed5bb06ee21c3c632299a9336d54ee7cb52a.zip
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
```
Diffstat (limited to 'pkgs/build-support/setup-hooks')
-rw-r--r--pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh2
1 files changed, 1 insertions, 1 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 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"