diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-08-25 20:44:28 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-08-25 20:44:28 +0000 |
commit | e437b0825018b1935f9a849382c12b1df0aeae06 (patch) | |
tree | 0caecfa87a6cbcdb7351d210accfede17a50961b /tests | |
parent | 1a396f3789feefc20bdcd8a355939eb1ec5126c2 (diff) |
* Made the build hook mechanism more efficient. Rather than starting
the hook every time we want to ask whether we can run a remote build
(which can be very often), we now reuse a hook process for answering
those queries until it accepts a build. So if there are N
derivations to be built, at most N hooks will be started.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/build-hook.hook.sh | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/build-hook.hook.sh b/tests/build-hook.hook.sh index 83fa3bf78..ff709985d 100755 --- a/tests/build-hook.hook.sh +++ b/tests/build-hook.hook.sh @@ -2,20 +2,22 @@ #set -x -drv=$4 +while read x y drv rest; do -echo "HOOK for $drv" >&2 + echo "HOOK for $drv" >&2 -outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv` + outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv` -echo "output path is $outPath" >&2 + echo "output path is $outPath" >&2 -if `echo $outPath | grep -q input-1`; then - echo "# accept" >&2 - read x - echo "got $x" - mkdir $outPath - echo "BAR" > $outPath/foo -else - echo "# decline" >&2 -fi + if `echo $outPath | grep -q input-1`; then + echo "# accept" >&2 + read inputs + read outputs + mkdir $outPath + echo "BAR" > $outPath/foo + else + echo "# decline" >&2 + fi + +done
\ No newline at end of file |