ports/157481: portmaster test of IS_INTERACTIVE is implemented incorrectly

Carl k0802647 at telus.net
Wed Jun 1 00:10:07 UTC 2011


>Number:         157481
>Category:       ports
>Synopsis:       portmaster test of IS_INTERACTIVE is implemented incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 01 00:10:06 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Carl
>Release:        FreeBSD-8.2-RELEASE-amd64/i386
>Organization:
>Environment:
FreeBSD xxxxxxxx 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
portmaster v3.9 includes a test for the existence of the IS_INTERACTIVE variable in each port's Makefile. If IS_INTERACTIVE is found at the beginning of any line, then it is naively assumed that IS_INTERACTIVE will always be set for the port and portmaster pauses to force the user to acknowledge that the port is interactive. This occurs even if the BATCH variable is set in the environment. This simplistic manner of testing IS_INTERACTIVE is wrong because it may be getting conditionally set or cleared in the port's Makefile. As an example, the mail/procmail port cannot be built non-interactively with portmaster for this very reason, yet its Makefile is designed specifically to support a non-interactive build.

Here is the relevant section of portmaster:

----- begin excerpt -----
3186         if [ -z "$FETCH_ONLY" -a ! "$PM_PACKAGES" = only ]; then
3187                 TESTINT=`grep -l ^IS_INTERACTIVE Makefile`
3188         else
3189                 [ -n "$ALL_FETCH" ] && safe_exit
3190         fi
3191         if [ -n "$TESTINT" ]; then
3192                 echo ''
3193                 echo "===>>> Warning: $portdir is interactive, and will likely"
3194                 echo "       require attention during the build"
3195                 echo ''
3196                 echo -n "===>>> Press the [Enter] or [Return] key to continue "
3197                 read DISCARD
3198                 echo ''
3199                 unset TESTINT DISCARD
3200         fi
------ end excerpt ------

The following excerpt from /usr/ports/mail/procmail/Makefile demonstrates why portmaster is wrong to naively check for a reference to IS_INTERACTIVE:

----- begin excerpt -----
36 # It asks for list of directories to do test for file locking
37 # (defaults to /tmp and ".", so return should suffice in most cases).
38 .if defined(BATCH) # handled in patch-aa
39 MAKE_ARGS+=     -DBATCH
40 .else
41 IS_INTERACTIVE= yes
42 .endif
------ end excerpt ------

As that code shows, setting BATCH for a portmaster build of mail/procmail will prevent IS_INTERACTIVE from being set, yet portmaster will still wrongly conclude that it is set.

Carl                                           / K0802647
>How-To-Repeat:
Set the BATCH variable for the build environment and try to build mail/procmail using portmaster.
>Fix:
My current workaround is simply to excise the IS_INTERACTIVE test from portmaster entirely. Assuming there is a good reason for wanting to test for interactivity in the first place, IS_INTERACTIVE should actually be tested to see if it really is set rather than merely checking to see if it's referenced in Makefi

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list