commit - b891075b5ec041573f6aa9a1e25dbee0e2ec8c7e
commit + a2f760e6003aa707739f7a5f1cef32af2dffd6c2
blob - ecad672dd9987061ffe33a14f45c754453877ea2
blob + dfb4247519cf71225106b839c0671acd77708978
--- util/got-build-regress.sh
+++ util/got-build-regress.sh
ncpu=`sysctl -n hw.ncpuonline`
lockfile=$worktree/.${prog}.lock
-cd "$worktree"
-if [ $? -ne 0 ]; then
- exit 1
-fi
+cd "$worktree" || exit 1
lockfile -r 3 "$lockfile" || exit 1
-trap "rm -f '$lockfile'" HUP INT QUIT KILL TERM
+trap "rm -f '$lockfile'" HUP INT QUIT KILL TERM EXIT
rm -f regress.log failures.log
echo -n "$prog for branch '$branch' on " > build.log
update_status="$?"
if [ "$update_status" != "0" ]; then
mail $fromaddr_arg -s "$prog update failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
new_basecommit=`cat .got/base-commit`
if [ "$force" != "1" -a "$old_basecommit" == "$new_basecommit" ]; then
- rm -rf "$lockfile"
exit 0
fi
build_status="$?"
if [ "$build_status" != "0" ]; then
mail $fromaddr_arg -s "$prog build failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
log_cmd build.log make install
build_status="$?"
if [ "$build_status" != "0" ]; then
mail $fromaddr_arg -s "$prog build failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
printf "\n\n\t Test failures:\n\n" >> build.log
cat failures.log >> build.log
mail $fromaddr_arg -s "$prog regress failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
printf "\n\n\t Test failures:\n\n" >> build.log
cat failures.log >> build.log
mail $fromaddr_arg -s "$prog regress failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
build_status="$?"
if [ "$build_status" != "0" ]; then
mail $fromaddr_arg -s "$prog release mode build failure" $recipients < build.log
- rm -rf "$lockfile"
exit 0
fi
-
-rm -f "$lockfile"
exit 0