git: e70bedf4f71e - main - Mk/bsd.port.mk: Don't pass up an empty flavor.

Mathieu Arnold mat at FreeBSD.org
Tue Jun 1 07:17:49 UTC 2021


The branch main has been updated by mat:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e70bedf4f71eda15307b550cefd028a5a4b0281a

commit e70bedf4f71eda15307b550cefd028a5a4b0281a
Author:     Mathieu Arnold <mat at FreeBSD.org>
AuthorDate: 2021-06-01 07:04:25 +0000
Commit:     Mathieu Arnold <mat at FreeBSD.org>
CommitDate: 2021-06-01 07:16:35 +0000

    Mk/bsd.port.mk: Don't pass up an empty flavor.
    
    The classic way to handle flavors is to set:
    
      FLAVORS= foo bar
      FLAVOR?= ${FLAVORS:[0]}
    
    And in that case, FLAVOR is only set if the variable is not defined. If
    you pass an empty flavor using `FLAVOR=` then it remains empty after
    that line.  It can leads to some ports with complicated logic to assume
    the wrong flavor is set.
    
    PR:             256301
    Reported by:    avg
    Differential Revision:  https://reviews.freebsd.org/D30579
---
 Mk/bsd.port.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 93318b02d332..e514bb7ffec1 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -4095,7 +4095,7 @@ _FLAVOR_RECURSIVE_SH= \
 		/*) ;; \
 		*) dir=${PORTSDIR}/$$dir ;; \
 		esac; \
-		(cd $$dir; ${SETENV} FLAVOR=$${flavor} ${MAKE} $${recursive_cmd}); \
+		(cd $$dir; ${SETENV} $${flavor:+FLAVOR=$${flavor}} ${MAKE} $${recursive_cmd}); \
 	done
 
 # This script is shared among several dependency list variables.  See file for


More information about the dev-commits-ports-main mailing list