From owner-freebsd-ports@FreeBSD.ORG Sat May 24 13:17:01 2008 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 8DA2D1065677 for ; Sat, 24 May 2008 13:17:01 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A8C568FC1D; Sat, 24 May 2008 13:16:58 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48381549.8000104@FreeBSD.org> Date: Sat, 24 May 2008 15:16:57 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Paul Schmehl References: <73817B56605C84F44E002CB2@utd65257.utdallas.edu> In-Reply-To: <73817B56605C84F44E002CB2@utd65257.utdallas.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Ports Subject: Re: Handling user input and package building 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: Sat, 24 May 2008 13:17:01 -0000 Paul Schmehl wrote: > I'm trying to figure out how to handle user input in package building mode. > > I've got statements like this in my Makefile, and they work fine to > suppress user input from the pkg-install script: > > pre-install: > .if !defined(PACKAGE_BUILDING) > @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \ > ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL > .endif > > However, the same syntax doesn't seem to work for the pkg-deinstall > script, which also requires user input. > > .if defined(PACKAGE_BUILDING) > deinstall: > @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \ > ${SH} ${PKGDEINSTALL} ${PORTNAME} DEINSTALL > post-deinstall: > @${SETENV} ${SCRIPTS_ENV} PKG_PREFIX=${PREFIX} \ > ${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL > .endif > > One other question. The Porters Handbook says: > "If your port requires user input to build, configure, or install, you > must set IS_INTERACTIVE in your Makefile. " > > Yet portlint says: > "WARN: Makefile: [25]: use of IS_INTERACTIVE discouraged. provide batch > mode by using BATCH and/or FOR_CDROM." > > What's the correct way to do this? > Avoid the requirement of interactive input at all costs. Kris