return "${PIPESTATUS[0]}"
}
+fix_up()
+{
+ if [ -n "$1" ]; then
+ linux-next-notify "$1"
+ fi
+ if [ -n "$2" ]; then
+ printf '%s\n' "$2" 1>&2
+ fi
+ if ! bash -i; then
+ exit
+ fi
+}
+
if [ -z "$start_from" ]; then
cp /dev/null "$LOG_FILE"
execute date -R
if [ -f "../pre-merge/$tree" ]; then
while read -r p <&7; do
if ! "$bin_dir/do_patch" -n "$p"; then
- linux-next-notify "premerge patch failed"
- bash -i || exit
+ fix_up "premerge patch failed"
fi 7<&-
done 7<"../pre-merge/$tree"
fi
check_unmerged_files "$tree"
if git diff 2>&1 | grep -E -q '<<<<<|^\*'; then
- linux-next-notify "new conflict found merging $tree"
if [ -f "../merge-fixes/$tree" ]; then
echo "Merge fixes exist for this tree:"
cat "../merge-fixes/$tree"
fi
- bash -i || exit
+ fix_up "new conflict found merging $tree"
fi
# if [ "$(git status --porcelain)" ]; then
if ! execute git commit --no-edit -v -a; then
- linux-next-notify "next commit failed for $tree"
- bash -i || exit
+ fix_up "next commit failed for $tree"
fi
execute git diff -M --stat --summary 'HEAD^..'
# fi
if [ -f "../merge-fixes/$tree" ]; then
while read -r p <&7; do
if ! "$bin_dir/merge_fix" -n "$p"; then
- linux-next-notify "merge fix failed for $tree"
- bash -i || exit
+ fix_up "merge fix failed for $tree"
fi 7<&-
done 7<"../merge-fixes/$tree"
fi
repo="${build_host:+$build_host:}${build_dir}"
if ! git push -f "$repo" master:refs/heads/next; then
- echo git push failed 1>&2
- linux-next-notify "push failed for $tree"
- bash -i || exit
+ fix_up "push failed for $tree" "git push failed"
fi
if [ -x "../pre-build/$tree" ] &&
! "../pre-build/$tree"; then
- echo Prebuild script failed 1>&2
- linux-next-notify "pre-build script failed for $tree"
- bash -i || exit
+ fix_up "pre-build script failed for $tree" "Prebuild script failed"
fi
if ! "$bin_dir/do_build" "$tree"; then
- echo Build failed 1>&2
- linux-next-notify "build failed for $tree"
- bash -i || exit
+ fix_up "build failed for $tree" "Build failed"
fi
need_build=false