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
```
wip/yesman
Robin Gloster 6 years ago
parent 8e97e8009f
commit 34faed5bb0
No known key found for this signature in database
GPG Key ID: D5C458DF6DD97EDF
  1. 2
      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"

Loading…
Cancel
Save