lol

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.

authored by zimbatm.tngl.sh and committed by

Vladimír Čunát 48a5bb70 de0af307

+3 -1
+3 -1
pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh
··· 27 27 postUnpackHooks+=(_updateSourceDateEpochFromSourceRoot) 28 28 29 29 _updateSourceDateEpochFromSourceRoot() { 30 - updateSourceDateEpoch "$sourceRoot" 30 + if [ -n "$sourceRoot" ]; then 31 + updateSourceDateEpoch "$sourceRoot" 32 + fi 31 33 }