]> git.ozlabs.org Git - next-scripts/commitdiff
introduce get_contacts function and use it
authorStephen Rothwell <sfr@canb.auug.org.au>
Sun, 18 Nov 2018 15:58:27 +0000 (02:58 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Sun, 18 Nov 2018 15:58:27 +0000 (02:58 +1100)
common.sh
get_contacts [new file with mode: 0755]
message_helper

index 827015a0190347ec25cfcb863eecc466ef13e8ae..5e27d5f90abeef67082e63590b3767317e71f193 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -47,4 +47,10 @@ export NEXT_GCC_PPC_VERSION="$gcc_ppc_version"
 export NEXT_GCC_PPCLE_VERSION="$gcc_ppcle_version"
 export NEXT_J_FACTOR="$j_factor"
 
+# Support functions
+get_contacts()
+{
+       awk -F '\t' '/^[^#]/ && $3=="'"$1"'" { print $1; }' $CTRL_FILE
+}
+
 true
diff --git a/get_contacts b/get_contacts
new file mode 100755 (executable)
index 0000000..7e3092d
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+tree=
+if [ "$1" ]; then
+        tree=$1
+        shift
+fi
+
+tools_dir=$(dirname "$0")
+. "$tools_dir/common.sh"
+
+get_contacts "$tree"
+
+exit 0
index bd7c1106a69cd9c03b46cfc5a5e61b87ddd8d428..3a1963c543d2d672aee6de9abb37067ab403e423 100755 (executable)
@@ -4,8 +4,6 @@
 
 log=$LOG_FILE
 [ -f merge.log ] && log=merge.log
-control=$CTRL_FILE
-[ -f control ] && control=control
 
 branch=""
 [ "$1" = "-t" ] && {
@@ -26,7 +24,7 @@ cc="Linux-Next Mailing List <linux-next@vger.kernel.org>, Linux Kernel Mailing L
        branch=${branch%%/*}
 }
 
-contact=$(awk -F '     ' '$3=="'"$branch"'" { print $1; }' $control)
+contact=$(get_contacts "$branch")
 greeting=${contact%% *}
 greeting=${greeting#\"}
 [ "${contact%,*}" = "${contact}" ] || greeting="all"