]> git.ozlabs.org Git - next-scripts/blobdiff - build_msg
various updates
[next-scripts] / build_msg
index 4d6123c47f411f66b8263054acded6960fd9c32f..fd6169ed0df39f78060aa185df36de317b3a4c0c 100755 (executable)
--- a/build_msg
+++ b/build_msg
@@ -5,15 +5,24 @@ log=../merge.log
 control=../real_control
 [ -f real_control ] && control=real_control
 
-branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //')
-branch=${branch#quilt/}
-branch=${branch%%/*}
+branch=""
+[ "$1" = "-t" ] && {
+        branch=$2
+        shift 2
+}
 
-contact=$(sed -n "/    $branch /s/     .*$//p" $control)
+[ "$branch" ] || {
+       branch=$(grep '^Merging ' $log | tail -1 | sed 's/^Merging //' | sed 's/ .*$//')
+       branch=${branch#quilt/}
+       branch=${branch%%/*}
+}
+
+contact=$(awk -F '     ' '$3=="'"$branch"'" { print $1; }' $control)
 greeting=${contact%% *}
+greeting=${greeting#\"}
 [ "${contact%,*}" = "${contact}" ] || greeting="all"
 
-sylpheed --compose "mailto:$contact?Cc=linux-next@vger.kernel.org,%20linux-kernel@vger.kernel.org&Subject=linux-next: build failure after merge of $branch tree&Body=Hi $greeting,%0A\
+sylpheed --compose "mailto:$contact?Cc=linux-next@vger.kernel.org,%20linux-kernel@vger.kernel.org&Subject=linux-next: build failure after merge of the $branch tree&Body=Hi $greeting,%0A\
 %0A\
 After merging the $branch tree, today's linux-next build ()%0A\
 failed like this:"