[dbscripts,8/8] devlist-mailer: Make LIST and FROM configurable

Message ID 20180314015205.20781-9-lukeshu@lukeshu.com
State Accepted
Headers show
Series Backports from Parabola | expand

Commit Message

Luke Shumaker March 14, 2018, 1:52 a.m. UTC
From: Luke Shumaker <lukeshu@parabola.nu>

---
 config                   | 5 +++++
 cron-jobs/devlist-mailer | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

Comments

Emil Velikov via arch-projects March 14, 2018, 4:11 a.m. UTC | #1
On 03/13/2018 09:52 PM, Luke Shumaker wrote:
> From: Luke Shumaker <lukeshu@parabola.nu>

TBH we don't even send out integrity check email anymore, do you?
Luke Shumaker March 14, 2018, 4:54 a.m. UTC | #2
On Wed, 14 Mar 2018 00:11:40 -0400,
Eli Schwartz wrote:
> 
> On 03/13/2018 09:52 PM, Luke Shumaker wrote:
> > From: Luke Shumaker <lukeshu@parabola.nu>
> 
> TBH we don't even send out integrity check email anymore, do you?

No, but we have a different cron-job that calls devlist-mailer

Patch

diff --git a/config b/config
index d703e7b..fd79b6e 100644
--- a/config
+++ b/config
@@ -35,6 +35,11 @@  PKGEXTS=".pkg.tar.@(gz|bz2|xz|lzo|lrz|Z)"
 # Allowed licenses: get sourceballs only for licenses in this array
 ALLOWED_LICENSES=('GPL' 'GPL1' 'GPL2' 'GPL3' 'LGPL' 'LGPL1' 'LGPL2' 'LGPL2.1' 'LGPL3')
 
+# Where to send error emails, and who they are from
+LIST="arch-dev-public@archlinux.org"
+#LIST="aaronmgriffin@gmail.com"
+FROM="repomaint@archlinux.org"
+
 # Override default config with config.local
 LOCAL_CONFIG=${DBSCRIPTS_CONFIG:-"$(dirname "${BASH_SOURCE[0]}")/config.local"}
 [[ -f "${LOCAL_CONFIG}" ]] && . "${LOCAL_CONFIG}"
diff --git a/cron-jobs/devlist-mailer b/cron-jobs/devlist-mailer
index 1b59cb3..578d23e 100755
--- a/cron-jobs/devlist-mailer
+++ b/cron-jobs/devlist-mailer
@@ -2,9 +2,8 @@ 
 #Dummy helper to send email to arch-dev
 # It does nothing if no output
 
-LIST="arch-dev-public@archlinux.org"
-#LIST="aaronmgriffin@gmail.com"
-FROM="repomaint@archlinux.org"
+# Load $LIST and $FROM from the config file
+. "$(dirname "$(readlink -e "$0")")/../config"
 
 SUBJECT="Repository Maintenance $(date +"%d-%m-%Y")"
 if (( $# >= 1 )); then