daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
73bb68
#!/bin/bash
73bb68
set -e
73bb68
73bb68
verb="$1"
73bb68
73bb68
[ "$verb" = "-s" ] && do_send=1 || do_send=
73bb68
73bb68
[ -n "$do_send" ] && [ -z "$server" -o -z "login" ] && { echo '$server and $login need to be set'; exit 1; }
73bb68
73bb68
header=
73bb68
from=systemd-maint@fedoraproject.org
73bb68
time='2 years ago'
73bb68
# time='1 day ago'
73bb68
port=587
73bb68
73bb68
for user in "$@"; do
73bb68
    echo "checking $user…"
73bb68
73bb68
    p=$(git log -1 --all --author "$user")
73bb68
    if [ -z "$p" ]; then
73bb68
	echo "No commits from $user, check spelling"
73bb68
	exit 1
73bb68
    fi
73bb68
73bb68
    t=$(git shortlog --all --author "$user" --since "@{$time}" | wc -l)
73bb68
    if [ $t != 0 ]; then
73bb68
	echo "$t commits in the last two years, OK"
73bb68
	echo
73bb68
	continue
73bb68
    fi
73bb68
73bb68
    echo "$p" | head -n6
73bb68
    echo ".. adding to list"
73bb68
73bb68
    if [ -z "$header" ]; then
73bb68
	echo '$USER$;$EMAIL$' >.mail.list
73bb68
	header=done
73bb68
    fi
73bb68
73bb68
    echo "$user;$user@fedoraproject.org" >>.mail.list
73bb68
    echo
73bb68
done
73bb68
73bb68
[ -z "$header" ] && exit 0
73bb68
[ -n "$do_send" ] || exit 0
73bb68
73bb68
echo "Sending mails…"
73bb68
set -x
73bb68
massmail -F "$from" \
73bb68
	 -C "$from" \
73bb68
	 -S 'write access to the fedora systemd package' \
73bb68
	 -z "$server" -u "$login" -P "$port" \
73bb68
	 .mail.list