From owner-freebsd-ports@FreeBSD.ORG Tue Feb 7 21:50:03 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 183671065672 for ; Tue, 7 Feb 2012 21:50:03 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id D16FF8FC0A for ; Tue, 7 Feb 2012 21:50:02 +0000 (UTC) Received: by iaeo4 with SMTP id o4so15727352iae.13 for ; Tue, 07 Feb 2012 13:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=Rw20u/tha4vXXjL5Sm4/iCCR9u0NxkmJglytOjCqOgw=; b=Bp5dC8oCEdzXi9SW7/8bHR+FGbf9nT8lZAll+q3WTuF/SOBHesp3Z5Z0NP8CkHl7py ZfXMXnPJuRRYHjx6W2e/zOL+q8h3HoHczziqYPdQFGax8Lfrq7435aRVgfJMKjLuVcyS cCqHRGNuCsZ2yjJSq7mOr3dQ5bO+f/l3Vq8xo= Received: by 10.42.146.202 with SMTP id k10mr24074968icv.13.1328651402302; Tue, 07 Feb 2012 13:50:02 -0800 (PST) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.183.21 with HTTP; Tue, 7 Feb 2012 13:49:32 -0800 (PST) In-Reply-To: <20120207020427.GB8661@magic.hamla.org> References: <20120207020427.GB8661@magic.hamla.org> From: Chris Rees Date: Tue, 7 Feb 2012 21:49:32 +0000 X-Google-Sender-Auth: sOHwKnd_Ahv-FjDdoWcH2xZHgfc Message-ID: To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Input on "most correct" way to set IS_INTERACTIVE for Postfix ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:50:03 -0000 On 7 February 2012 02:04, Sahil Tandon 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