diff --git a/scripts/check-kernel-fix b/scripts/check-kernel-fix index 21dd730..31f435c 100755 --- a/scripts/check-kernel-fix +++ b/scripts/check-kernel-fix @@ -303,22 +303,25 @@ find_and_print_toplevel_actions() fi # branch name might include '/', e.g. cve/linux-4.12 - mb_line=$(echo -n "$line" | sed -e "s|^$branch:|$merge_branch:|") + mb_line=$(grep ^$merge_branch: $branch_state_file) + mb_state=$(echo $mb_line | cut -d: -f3) - # ignore the state when the same change is needed in a merge branch - if grep -q "^$mb_line$" "$branch_state_file" ; then - merge_found=1 + # if the merge branch is in the same state then do not + # bother + if [ "$mb_state" == "$state" ] + then + merge_found=1 + break fi - mb_state=$(echo $mb_line | cut -d: -f3) - if [ "$state" == "missing_references" -o \ "$state" == "missing_patch" -o \ "$state" == "maybe_missing_patch" ] ; then # No action is needed when the patch is backported - # and has all the references in the merge branch - if [ "$mb_state" == "ok" ] ; then + # even if it has references missing. Those will be + # reported for the merge origin + if [ "$mb_state" == "ok" -o "$mb_state" == "missing_references" ] ; then merge_found=1 fi fi