Created attachment 1014306 [details] Reproducer Building a package with this code passes: %check false && false I think it should fail. Reproducer attached. It does not happen with "false || false" or "false ; false". Tested with rpm-build-4.11.3-2.fc20.x86_64 as well as with rpm-build-4.12.0.1-13.fc23.x86_64.
This behaves like this because of shell. Try following: $ set -e $ false && false # Shell doesn't exit $ false || false # Shell exits immediately Moving to bash to explain this behaviour.
Hi Ľuboš, the bash man page describing set -e mentions this in more detail. In a nutshell, for && and ||, only the return exit of the command after the last && or || is considered when 'set -e' is switched on. As the first false is enough to determine the truth value of the '&&' expression, the second false is never executed, thus there's no return value to judge upon. All shells behave this way (or should, at the very least, I tried with ksh and zsh). I don't know what rpmbuild switches on or off when running spec scripts, but it's not a shell bug.
But this is not a bug in rpm either. rpm doesn't parse or execute these scripts itself but it depends on what is returned from bash.