From: Hugo Villeneuve Date: Wed, 12 Apr 2023 19:29:44 +0000 (-0400) Subject: Remove name from email addresses X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=9c4b89cf4f92b8f02fa2d42016b553d24536030f;p=hvutilities.git Remove name from email addresses --- 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}" }