Input on "most correct" way to set IS_INTERACTIVE for Postfix ports

Chris Rees crees at freebsd.org
Tue Feb 7 21:50:03 UTC 2012


On 7 February 2012 02:04, Sahil Tandon <sahil+freebsd-ports at tandon.net> wrote:
> mail/postfix and its derivatives are interactive when ALL of the
> following conditions are true:
>
>  - PACKAGE_BUILDING is undefined
>  - /etc/mail/mailer.conf exists
>  - /etc/mail/mailer.conf contains a line beginning with 'purgestat'
>
> The way I plan to implement this in the port's Makefile is below; please
> let me know if you notice errors or would suggest an another method.  I
> appreciate that the use of '!=' is discouraged by portlint(1), and am
> thusly open to cluebats and alternative suggestions.
>
>  OLD_MAILER!=    ${GREP} -s '^purgestat' /etc/mail/mailer.conf || true
>
>  .if !defined(PACKAGE_BUILDING) && !empty(OLD_MAILER)
>  IS_INTERACTIVE= yes
>  .endif
>
> Thanks,
> --
> Sahil Tandon

.if !defined(PACKAGE_BUILDING) && exists (/etc/mail/mailer.conf)
OLD_MAILER!= ${GREP} -m 1 '^purgestat' /etc/mail/mailer.conf
. if !empty(OLD_MAILER)
IS_INTERACTIVE= yes
. endif
.endif

should be a bit quicker for most use cases.  Notice the '-m 1' which
stops grep after the first occurrence of purgestat.

Chris


More information about the freebsd-ports mailing list