mirror of
https://github.com/NixOS/nix.git
synced 2024-10-30 13:50:51 +00:00
e437b08250
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.
23 lines
408 B
Bash
Executable File
23 lines
408 B
Bash
Executable File
#! /bin/sh
|
|
|
|
#set -x
|
|
|
|
while read x y drv rest; do
|
|
|
|
echo "HOOK for $drv" >&2
|
|
|
|
outPath=`sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv`
|
|
|
|
echo "output path is $outPath" >&2
|
|
|
|
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 |