graysky2/clean-chroot-manager — pull request #12 by kerberizer (2014-11-16 23:19:57+00:00)
Title: Fix build() and buildnc() exit codes

Both functions check whether the exit code of makechrootpkg is >0 and if
the test succeeds (i.e. makechrootpkg failed), force the script to fail.
Unfortunately, this means that if makechrootpkg exited cleanly, then the
above test fails ([[ $? -ge 0 ]] ==> false). But with the test being the
last command in each function, the functions now also return false --
while exactly the opposite should have happened.

This commit reverses the test logic: instead of checking whether the
makechrootpkg exit code is >0, it tests whether it equals 0 and fails
the script on test failure. If makechrootpkg exited cleanly, the test
succeeds ([[ $? -eq 0 ]] ==> true) and the functions also return true.
This fixes e.g. indexit() not being executed after build() success.