X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fkernel-send-patches.sh;fp=scripts%2Fkernel-send-patches.sh;h=9aae586debc88bacbcc259439e5e6e9bb19c30e8;hb=9c4b89cf4f92b8f02fa2d42016b553d24536030f;hp=07c725e4ae2e119bfa8d6fbbf106a2888d26e4ea;hpb=93a574b2bc1cc2f252285ac7c569ee27700c4262;p=hvutilities.git diff --git a/scripts/kernel-send-patches.sh b/scripts/kernel-send-patches.sh index 07c725e..9aae586 100755 --- a/scripts/kernel-send-patches.sh +++ b/scripts/kernel-send-patches.sh @@ -166,6 +166,22 @@ find_commit_by_log() echo $(git log --oneline HEAD~100..HEAD | grep "${1}" | awk {'print $1'}) } +# Remove "Name" if present in email address. Needed because of a bug in +# get_maintainer.pl even if we specify the "--non" option. +# Arg #1: "Name " or "email" +format_email() +{ + local mail="${1}" + + if echo "${mail}" | grep -q '<'; then + mail=$(echo ${mail} | sed "s@.*<\(.*\)>@\1@") + else + mail="${mail}" + fi + + echo "${mail}" +} + # Because the cover letter is a special case and not a real patch, running # get_maintainer.pl on it would not return any TO or CC addresses. # Therefore, manually run get_maintainer.pl on the concatenation of all the @@ -180,10 +196,12 @@ collect_email_addresses() CC_MAIL="$(${CC_CMD} /tmp/all.patch)" while IFS= read -r line; do + line=$(format_email "${line}") TO_OPTS="${TO_OPTS} --to ${line}" done <<< "${TO_MAIL}" while IFS= read -r line; do + line=$(format_email "${line}") CC_OPTS="${CC_OPTS} --cc ${line}" done <<< "${CC_MAIL}" }