build-hook: If there are no machines defined, quit permanently
This commit is contained in:
parent
70581b6363
commit
174b68a2a2
|
@ -150,6 +150,11 @@ int main (int argc, char * * argv)
|
||||||
auto machines = readConf();
|
auto machines = readConf();
|
||||||
debug("got %d remote builders", machines.size());
|
debug("got %d remote builders", machines.size());
|
||||||
|
|
||||||
|
if (machines.empty()) {
|
||||||
|
std::cerr << "# decline-permanently\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string drvPath;
|
string drvPath;
|
||||||
string storeUri;
|
string storeUri;
|
||||||
for (string line; getline(cin, line);) {
|
for (string line; getline(cin, line);) {
|
||||||
|
|
|
@ -1598,8 +1598,15 @@ HookReply DerivationGoal::tryBuildHook()
|
||||||
|
|
||||||
debug(format("hook reply is ‘%1%’") % reply);
|
debug(format("hook reply is ‘%1%’") % reply);
|
||||||
|
|
||||||
if (reply == "decline" || reply == "postpone")
|
if (reply == "decline")
|
||||||
return reply == "decline" ? rpDecline : rpPostpone;
|
return rpDecline;
|
||||||
|
else if (reply == "decline-permanently") {
|
||||||
|
settings.useBuildHook = false;
|
||||||
|
worker.hook = 0;
|
||||||
|
return rpDecline;
|
||||||
|
}
|
||||||
|
else if (reply == "postpone")
|
||||||
|
return rpPostpone;
|
||||||
else if (reply != "accept")
|
else if (reply != "accept")
|
||||||
throw Error(format("bad hook reply ‘%1%’") % reply);
|
throw Error(format("bad hook reply ‘%1%’") % reply);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue