Bug 256736

Summary: Mk/bsd.port.mk: _FLAVOR_RECURSIVE_SH passes flavor to child make
Product: Ports & Packages Reporter: R Williams <ross>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Open ---    
Severity: Affects Some People CC: otis, portmgr, ross
Priority: --- Keywords: needs-qa, regression
Version: LatestFlags: bugzilla: maintainer-feedback? (portmgr)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256301
https://reviews.freebsd.org/D30579
Attachments:
Description Flags
Patch none

Description R Williams 2021-06-20 18:25:48 UTC
Created attachment 225957 [details]
Patch

The change introduced in bug #256301 (review D30579), which prevents child make processes from receiving an empty `FLAVOR` variable when `FLAVOR` should be unset has the side effect of allowing any `FLAVOR` already in the parent make process environment to propagate to the child.

The attached patch unsets `FLAVOR` before starting the child make.

Behavior before:
```
    $ make FLAVOR=zabbix54
    ...
    ===>  zabbix54-agent-5.4.1 FLAVOR is defined (to zabbix54) while this port does not have FLAVORS.
    *** Error code 1
    Stop.
    make[1]: stopped in /usr/ports/net-mgmt/zabbix54-agent
    *** Error code 1
    Stop.
```

Expected behavior after:
```
    $ make FLAVOR=zabbix54
    ...
    ===> Fetching all distfiles required by zabbix54-agent-5.4.1 for building
    $ echo $?
    0
```
Comment 1 R Williams 2021-10-05 15:59:37 UTC
Created differential revision https://reviews.freebsd.org/D32324