Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2012 21:49:32 +0000
From:      Chris Rees <crees@freebsd.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: Input on "most correct" way to set IS_INTERACTIVE for Postfix ports
Message-ID:  <CADLo83_q7HnF3O0K%2BtfELiBWQfd-uJmZTaFPX%2BSAJ_rHwj-pag@mail.gmail.com>
In-Reply-To: <20120207020427.GB8661@magic.hamla.org>
References:  <20120207020427.GB8661@magic.hamla.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 February 2012 02:04, Sahil Tandon <sahil+freebsd-ports@tandon.net> wro=
te:
> mail/postfix and its derivatives are interactive when ALL of the
> following conditions are true:
>
> =A0- PACKAGE_BUILDING is undefined
> =A0- /etc/mail/mailer.conf exists
> =A0- /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. =A0I
> appreciate that the use of '!=3D' is discouraged by portlint(1), and am
> thusly open to cluebats and alternative suggestions.
>
> =A0OLD_MAILER!=3D =A0 =A0${GREP} -s '^purgestat' /etc/mail/mailer.conf ||=
 true
>
> =A0.if !defined(PACKAGE_BUILDING) && !empty(OLD_MAILER)
> =A0IS_INTERACTIVE=3D yes
> =A0.endif
>
> Thanks,
> --
> Sahil Tandon

.if !defined(PACKAGE_BUILDING) && exists (/etc/mail/mailer.conf)
OLD_MAILER!=3D ${GREP} -m 1 '^purgestat' /etc/mail/mailer.conf
. if !empty(OLD_MAILER)
IS_INTERACTIVE=3D 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83_q7HnF3O0K%2BtfELiBWQfd-uJmZTaFPX%2BSAJ_rHwj-pag>