From 48a5bb703d5eace1a30ee4d8daca999389d0ddb9 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 24 Jan 2016 22:51:30 +0000 Subject: [PATCH] stdenv: fix set-source-date-epoch-to-latest (close #12602) In some cases the $sourceRoot is missing. Skip the hook instead of showing the following cryptic error: find: cannot search `': No such file or directory /nix/store/0p1afvl8jcpi6dvsq2n58i90w9c59vz1-set-source-date-epoch-to-latest.sh: line 12: [: : integer expression expected vcunat removed the warning; the hook will just skip silently in these cases. Perhaps someone can improve on it some time. --- .../setup-hooks/set-source-date-epoch-to-latest.sh | 4 +++- 1 file changed, 3 insertions(+), 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 9e325106f82..fe3458cd21e 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 @@ -27,5 +27,7 @@ updateSourceDateEpoch() { postUnpackHooks+=(_updateSourceDateEpochFromSourceRoot) _updateSourceDateEpochFromSourceRoot() { - updateSourceDateEpoch "$sourceRoot" + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot" + fi }