From c0113db4ad38d282c60a69f8c86aa7ba037c2778 Mon Sep 17 00:00:00 2001 From: Corey Henderson Date: Mon, 8 Sep 2014 21:46:40 -0400 Subject: [PATCH] die on create-diff-object when all objects have processed When working on large patches that are bound to have lots of errors, it can be frustrating to have to re-run the build and wait after every error you fix. With this patch, you get a chance to see most (if not all) of the errors you'll be facing, at least across the different object files. --- kpatch-build/kpatch-build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index c84d2b3..f827af4 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -427,6 +427,7 @@ cd "$TEMPDIR" mkdir output declare -A objnames CHANGED=0 +ERROR=0 for i in $FILES; do mkdir -p "output/$(dirname $i)" cd "$OBJDIR" @@ -450,13 +451,17 @@ for i in $FILES; do die "no core file found, run 'ulimit -c unlimited' and try to recreate" fi # create-diff-object returns 3 if no functional change is found - [[ $rc -eq 0 ]] || [[ $rc -eq 3 ]] || die + [[ $rc -eq 0 ]] || [[ $rc -eq 3 ]] || ERROR=$(expr $ERROR "+" 1) if [[ $rc -eq 0 ]]; then CHANGED=1 objnames[$KOBJFILE]=1 fi done +if [[ $ERROR -ne 0 ]]; then + die "create-diff-object failed on $ERROR of the objects" +fi + if [[ $CHANGED -eq 0 ]]; then die "no functional changes found" fi