Handling user input and package building
Kris Kennaway
kris at FreeBSD.org
Sat May 24 13:17:01 UTC 2008
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
More information about the freebsd-ports
mailing list