]> git.ozlabs.org Git - next-scripts/commitdiff
message_helper: improve filtering
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Oct 2020 01:10:34 +0000 (11:10 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 1 Oct 2020 01:10:34 +0000 (11:10 +1000)
message_helper

index 517fbe901f650479a014a260300b55d738bbfecc..09985afe2eb1abb57fd778bbbf1e91977a4404d2 100755 (executable)
@@ -30,13 +30,14 @@ fi
 
 contact=$(get_contacts "$branch")
 subject=${1//BRANCH/$branch}
-filter="sed -e 's/BRANCH/$branch/g'"
-if [ "$kconfig" ]; then
-       filter="$filter -e 's/KCONFIG_NAME/$kconfig/g'"
+filter=( -e "s/BRANCH/$branch/g" )
+if [ -n "$kconfig" ]; then
+       filter+=( -e "s/KCONFIG_NAME/$kconfig/g" )
 fi
-filter="$filter | fmt -s"
 
-{ printf 'Hi all,\n\n'; eval "$filter"; } |
-       "$bin_dir"/send_email "linux-next: $subject" "$contact" "${cc[@]}"
+{
+       printf 'Hi all,\n\n'
+       sed "${filter[@]}" | fmt -s
+} | "$bin_dir"/send_email "linux-next: $subject" "$contact" "${cc[@]}"
 
 exit 0