add motd generator script
[freebsd-maintainer-scripts/.git] / myportlint
CommitLineData
efd73192
SB
1#!/bin/sh
2
3: ${PORTSDIR:="/usr/ports"}
4: ${MAINTAINER:="${1:-${USER}}@FreeBSD.org"}
5
6PORTLINT_FLAGS="-Abct${PORTLINT_FLAGS}"
7SCRIPT=$0
8SCRIPT=${SCRIPT##*/}
9
10ports_by_maintainer() {
11 ports=`make -C ${PORTSDIR} search key=${MAINTAINER} display="path"|sed -n "s#Path:.*${PORTSDIR}\(.*\)#\1#p"`
12}
13
14cleanup() {
15 [ -f /tmp/${SCRIPT}.log ] && rm -f /tmp/${SCRIPT}.log
16}
17
18main() {
19 cleanup
20
21 ports_by_maintainer
22
23 for port in $ports
24 do
25 cd "${PORTSDIR}/$port"
26 echo "===> portlint output on port $port ==" >> /tmp/${SCRIPT}.log
27 portlint ${PORTLINT_FLAGS} >> /tmp/${SCRIPT}.log
28 echo -e "<=== portlint output ==\n" >> /tmp/${SCRIPT}.log
29 cd -
30 done
31}
32
33main