From patchwork Wed May 18 17:18:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [07/15] send-pull-request: remove local mta support Date: Wed, 18 May 2011 17:18:27 -0000 From: Darren Hart X-Patchwork-Id: 4369 Message-Id: <85aa19d5330dae697b50fccba4a3e1bb131b6041.1305738598.git.dvhart@linux.intel.com> To: openembedded-core@lists.openembedded.org There is no real value in supporting sendmail directly when git can be configured to use it. The script used to generate the pull request mails relies heavily on git, so doing so here does not impose any additional dependencies and it greatly reduces the complexity of this script. Signed-off-by: Darren Hart Acked-by: Otavio Salvador Cc: Otavio Salvador --- scripts/send-pull-request | 108 +++++++++------------------------------------ 1 files changed, 21 insertions(+), 87 deletions(-) diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 76dd7a2..d265c47 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request @@ -1,15 +1,9 @@ #!/bin/bash AUTO=0 -# Check env for any default settings, command line options will override these. -if [ -z "$PULL_MTA" ]; then - PULL_MTA="sendmail" -fi - # Prevent environment leakage to these vars. unset TO unset CC -# allow the user to set FROM in the environment usage() { @@ -18,10 +12,6 @@ Usage: $(basename $0) [-h] [-a] [[-t email]...] -p pull-dir -t email Explicitly add email to the recipients -a Automatically harvest recipients from "*-by: email" lines in the patches in the pull-dir - -f Specify a FROM address, you can also use the FROM environment - variable. If you do not specify one, it will try to use the one - from your git config. This is ignored if -g is used. - -g Use git-send-email to send mail instead of sendmail -p pull-dir Directory containing summary and patch files EOM } @@ -49,17 +39,11 @@ harvest_recipients() # Parse and verify arguments -while getopts "af:ghp:t:" OPT; do +while getopts "ahp:t:" OPT; do case $OPT in a) AUTO=1 ;; - f) - FROM="$OPTARG" - ;; - g) - PULL_MTA="git" - ;; h) usage exit 0 @@ -109,29 +93,14 @@ if [ $AUTO -eq 1 ]; then harvest_recipients CC "^.*-[Bb][Yy]: *" fi -case "$PULL_MTA" in -git) - FROM="$(git config sendemail.from)" - AUTO_TO="$(git config sendemail.to)" - if [ -n "$AUTO_TO" ]; then - if [ -n "$TO" ]; then - TO="$TO,$AUTO_TO" - else - TO="$AUTO_TO" - fi +AUTO_TO="$(git config sendemail.to)" +if [ -n "$AUTO_TO" ]; then + if [ -n "$TO" ]; then + TO="$TO,$AUTO_TO" + else + TO="$AUTO_TO" fi - ;; -sendmail) - if [ -z "$FROM" ]; then - FROM="$(git config user.name) <$(git config user.email)>" - if [ -z "$FROM" ]; then - echo "ERROR: unable to determine a FROM address" - usage - exit 1 - fi - fi - ;; -esac +fi if [ -z "$TO" ] && [ -z "$CC" ]; then echo "ERROR: you have not specified any recipients." @@ -145,10 +114,7 @@ cat <