on iko/ghcjs-patch-master help sign in
check.nix: Don't cd when src is from srcOnly (#1542)
f9090d2Robert Hensing
@@ -4,6 +4,14 @@ drv:
4let
4let
5 component = drv.config;
5 component = drv.config;
6
6
7+ subdir =
8+ if drv?source
9+ then
10+ drv.srcSubDir or ""
11+ else
12+ # srcOnly returns just the subdir, so we're already in it.
13+ "";
14+
7# This derivation can be used to execute test component.
15# This derivation can be used to execute test component.
8# The $out of the derivation is a file containing the resulting
16# The $out of the derivation is a file containing the resulting
9# stdout output.
17# stdout output.
@@ -30,8 +38,8 @@ in stdenv.mkDerivation ({
30 mkdir $out
38 mkdir $out
31 ${
39 ${
32 # Change to the source sub directory if there is one.
40 # Change to the source sub directory if there is one.
33− lib.optionalString (drv.srcSubDir or "" != "") ''
41+ lib.optionalString (subdir != "") ''
34− cd ${lib.removePrefix "/" drv.srcSubDir}
42+ cd ${lib.removePrefix "/" subdir}
35 ''
43 ''
36 }
44 }
37
45