diff options
author | Darren Hart <dvhart@linux.intel.com> | 2011-05-13 15:42:37 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-19 23:40:39 +0100 |
commit | a13fe8e454562a525520dd050d7783898fd29486 (patch) | |
tree | 5e864cdd2ae7c566551f53a1a745973010f85faa /scripts/send-pull-request | |
parent | 2b56f7b8c60290a09a27cc764bc420efbbe373d3 (diff) | |
download | poky-a13fe8e454562a525520dd050d7783898fd29486.tar.gz |
send-pull-request: verify git sendemail config
Perform a quick sanity check to be able to direct users to configure
git.sendemail if they haven't yet.
(From OE-Core rev: 95185de6f149a495201701d260921339e3dfaebd)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/send-pull-request')
-rwxr-xr-x | scripts/send-pull-request | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 5a11d1f1e6..21eb302169 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request | |||
@@ -41,6 +41,18 @@ harvest_recipients() | |||
41 | unset IFS | 41 | unset IFS |
42 | } | 42 | } |
43 | 43 | ||
44 | check_git_sendemail_config() | ||
45 | { | ||
46 | GIT_SMTP=$(git config sendemail.smtpserver) | ||
47 | GIT_FROM=$(git config sendemail.from) | ||
48 | if [ -z "$GIT_SMTP" ] || [ -z "$GIT_FROM" ]; then | ||
49 | echo "ERROR: git sendemail is not configured." | ||
50 | echo "Please read GIT-SEND-EMAIL(1) and configure:" | ||
51 | echo " sendemail.smtpserver" | ||
52 | echo " sendemail.from" | ||
53 | exit 1 | ||
54 | fi | ||
55 | } | ||
44 | 56 | ||
45 | # Parse and verify arguments | 57 | # Parse and verify arguments |
46 | while getopts "achp:t:" OPT; do | 58 | while getopts "achp:t:" OPT; do |
@@ -74,6 +86,9 @@ while getopts "achp:t:" OPT; do | |||
74 | esac | 86 | esac |
75 | done | 87 | done |
76 | 88 | ||
89 | # Abort early if git-send-email is not properly configured | ||
90 | check_git_sendemail_config | ||
91 | |||
77 | if [ -z "$PDIR" ]; then | 92 | if [ -z "$PDIR" ]; then |
78 | echo "ERROR: you must specify a pull-dir." | 93 | echo "ERROR: you must specify a pull-dir." |
79 | usage | 94 | usage |