From owner-freebsd-ports@FreeBSD.ORG Tue May 20 20:15:42 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 A4F311065674 for ; Tue, 20 May 2008 20:15:42 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.20.110]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC568FC19 for ; Tue, 20 May 2008 20:15:42 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id 91C2A23DEA for ; Tue, 20 May 2008 15:15:41 -0500 (CDT) Date: Tue, 20 May 2008 15:15:41 -0500 From: Paul Schmehl To: FreeBSD Ports Message-ID: <73817B56605C84F44E002CB2@utd65257.utdallas.edu> X-Mailer: Mulberry/4.0.8 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: 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: Tue, 20 May 2008 20:15:42 -0000 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? -- Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/