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