+bparent=$(dirname "$build_dir")
+
+line=$(tail -n 1 "$SHA1_FILE")
+
+# strip everything after the first tab character
+stree=${line%% *}
+if [ "$tree" ]; then
+ if [ "$tree" != "$stree" ]; then
+ printf 'That is not the last tree merged (%s v %s)\n' "$tree" "$stree" 1>&2
+ exit 1
+ fi
+else
+ tree="$stree"
+fi
+obdir="$bparent/old/$tree"
+
+cmd="/bin/sh"
+if [ "$build_host" ]; then
+ cmd="ssh root@$build_host unshare -n su $(id -u -n)"
+fi
+
+log_regex='/^[[:space:]]+$/d
+/^[.[:digit:]]+user [.[:digit:]]+system [:.[:digit:]]+elapsed [[:digit:]]+%CPU \([[:digit:]]+avgtext\+[[:digit:]]+avgdata [[:digit:]]+maxresident\)k$/d
+/^[[:digit:]]+inputs\+[[:digit:]]+outputs \([[:digit:]]+major\+[[:digit:]]+minor\)pagefaults [[:digit:]]+swaps$/d
+/^Setup is [[:digit:]]+ bytes \(padded to [[:digit:]]+ bytes\)\.$/d
+/^System is [[:digit:]]+ kB$/d
+/^CRC [[:xdigit:]]+$/d
+/^Kernel: arch\/x86\/boot\/bzImage is ready \(#[[:digit:]]+\)$/d
+s/^(WARNING: (modpost: )?(drivers\/built-in|vmlinux)\.o\(\.[^+]*\+0x)[[:xdigit:]]+(\): Section mismatch in reference from .*)$/\1XXXX\4/
+/^Warning: Kernel ABI header at /d
+/^[[:space:]]+PERF_VERSION = /d
+s/^(Parsed description of) [[:digit:]]+ (helper function)/\1 X \2/
+s/^[[:xdigit:]]+([[:space:]]+R_PPC64_(ADDR64|REL32)[[:space:]].*)$/XXX\1/'
+
+$cmd <<-EOF