]> git.ozlabs.org Git - next-scripts/commitdiff
send_email: allow multiple cc's and use that in message_helper
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Oct 2020 00:42:22 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Oct 2020 00:42:22 +0000 (10:42 +1000)
message_helper
send_email

index 78584d4dedc4fc726da9f4d80c4690aeca2c4792..517fbe901f650479a014a260300b55d738bbfecc 100755 (executable)
@@ -20,7 +20,8 @@ if [ "$1" = '-c' ]; then
         shift 2
 fi
 
-cc='Linux Next Mailing List <linux-next@vger.kernel.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>'
+cc=( 'Linux Next Mailing List <linux-next@vger.kernel.org>'
+       'Linux Kernel Mailing List <linux-kernel@vger.kernel.org>' )
 
 if [ -z "$branch" ]; then
        branch=$(grep '^Merging ' "$log" | tail -n 1 |
@@ -36,6 +37,6 @@ fi
 filter="$filter | fmt -s"
 
 { printf 'Hi all,\n\n'; eval "$filter"; } |
-       "$bin_dir"/send_email "linux-next: $subject" "$contact" "$cc"
+       "$bin_dir"/send_email "linux-next: $subject" "$contact" "${cc[@]}"
 
 exit 0
index b572b9c9ddec3714e1bc798ac3a23ea4a6eb9062..1c0fc4b0e12ccb114c07d43a93c8f3f90e737be0 100755 (executable)
@@ -4,16 +4,14 @@ mail_dir=$(realpath --relative-to=. "$(dirname "$0")/../mails")
 printf -v TARGET '%s/%(i%Y-%m-%d+%s)T.email' "$mail_dir" -1
 
 subject="$1"
-to="$2"
-cc="$3"
+shift
+to="$1"
+shift
 
 {
-       cat <<EOF
-To: $to
-Cc: $cc
-Subject: $subject
-
-EOF
+       printf 'To: %s\n' "$to"
+       printf 'Cc: %s\n' "$@"
+       printf 'Subject: %s\n\n' "$subject"
        cat
 } > "$TARGET"