Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141941027
D12483.id34454.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D12483.id34454.diff
View Options
Index: Mk/Scripts/qa.sh
===================================================================
--- Mk/Scripts/qa.sh
+++ Mk/Scripts/qa.sh
@@ -841,9 +841,26 @@
return $rc
}
+flavors()
+{
+ local rc pkgnames uniques
+ rc=0
+ if [ -n "${FLAVOR}" ]; then
+ pkgnames=$(make -C "${CURDIR}" flavors-package-names|sort)
+ uniques=$(echo "${pkgnames}"|uniq)
+ if [ "$pkgnames" != "${uniques}" ]; then
+ err "Package names are not uniques with flavors:"
+ make -C "${CURDIR}" pretty-flavors-package-names >&2
+ err "maybe use <flavor>_PKGNAMEPREFIX/SUFFIX".
+ rc=1
+ fi
+ fi
+ return ${rc}
+}
+
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
-checks="$checks proxydeps sonames perlcore no_arch gemdeps"
+checks="$checks proxydeps sonames perlcore no_arch gemdeps flavors"
ret=0
cd ${STAGEDIR}
Index: Mk/bsd.options.mk
===================================================================
--- Mk/bsd.options.mk
+++ Mk/bsd.options.mk
@@ -173,6 +173,11 @@
OPTIONSMKINCLUDED= bsd.options.mk
OPTIONS_NAME?= ${PKGORIGIN:S/\//_/}
+# If there is a FLAVOR and it is not the default one, append it to OPTIONS_NAME
+# so that the options can be different than the default flavor.
+.if !empty(FLAVOR) && ${FLAVOR} != ${FLAVORS:[1]}
+OPTIONS_NAME:= ${OPTIONS_NAME}@${FLAVOR}
+.endif
OPTIONS_FILE?= ${PORT_DBDIR}/${OPTIONS_NAME}/options
_OPTIONS_FLAGS= ALL_TARGET BROKEN CATEGORIES CFLAGS CONFIGURE_ENV CONFLICTS \
Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk
+++ Mk/bsd.port.mk
@@ -1065,8 +1065,7 @@
.if !defined(_FLAVOR)
_FLAVOR:= ${FLAVOR}
.endif
-# XXX: We have no real FLAVORS support in ports or tools yet.
-#PORTS_FEATURES+= FLAVORS
+PORTS_FEATURES+= FLAVORS
MINIMAL_PKG_VERSION= 1.6.0
_PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \
@@ -1082,20 +1081,33 @@
.include "${PORTSDIR}/Mk/bsd.commands.mk"
-.if !empty(FLAVOR)
-. if empty(FLAVORS)
-IGNORE= FLAVOR is defined while this port does not have FLAVORS.
-. elif ! ${FLAVORS:M${FLAVOR}}
-IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}.
-. endif
+# Do not leak flavors to childs make
+.MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*}
+
+.if !empty(FLAVOR) && !defined(_DID_FLAVORS_HELPERS)
+_DID_FLAVORS_HELPERS= yes
+# These overwrite the current value
+.for v in PKGNAMEPREFIX PKGNAMESUFFIX PLIST DESCR
+.if defined(${FLAVOR}_${v})
+${v}= ${${FLAVOR}_${v}}
.endif
+.endfor
-.if !empty(FLAVORS) && empty(FLAVOR)
-FLAVOR= ${FLAVORS:[1]}
+# These append to the current value
+.for v in CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL \
+ PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS FETCH_DEPENDS BUILD_DEPENDS \
+ LIB_DEPENDS RUN_DEPENDS TEST_DEPENDS
+.if defined(${FLAVOR}_${v})
+${v}+= ${${FLAVOR}_${v}}
.endif
+.endfor
-# Do not leak flavors to childs make
-.MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*}
+.for v in BROKEN IGNORE
+.if defined(${FLAVOR}_${v})
+${v}= flavor "${FLAVOR}" ${${FLAVOR}_${v}}
+.endif
+.endfor
+.endif # defined(${FLAVOR})
.if defined(CROSS_TOOLCHAIN)
.if !defined(CROSS_SYSROOT)
@@ -1470,6 +1482,25 @@
.include "${USESDIR}/${f:C/\:.*//}.mk"
.endfor
+.if !empty(FLAVORS)
+_BAD_FLAVOR_NAMES= ${FLAVORS:M*[^a-z0-9]*}
+. if !empty(_BAD_FLAVOR_NAMES)
+DEV_ERROR+= "FLAVORS contains flavors that are not all lowercase: ${_BAD_FLAVOR_NAMES}"
+. endif
+.endif
+
+.if !empty(FLAVOR)
+. if empty(FLAVORS)
+IGNORE= FLAVOR is defined (to ${FLAVOR}) while this port does not have FLAVORS.
+. elif ! ${FLAVORS:M${FLAVOR}}
+IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}.
+. endif
+.endif
+
+.if !empty(FLAVORS) && empty(FLAVOR)
+FLAVOR= ${FLAVORS:[1]}
+.endif
+
EXTRACT_SUFX?= .tar.gz
.if defined(USE_LINUX_PREFIX)
@@ -1562,6 +1593,9 @@
LOCALBASE=${LOCALBASE} \
"STRIP=${STRIP}" \
TMPPLIST=${TMPPLIST} \
+ CURDIR='${.CURDIR}' \
+ FLAVOR=${FLAVOR} \
+ FLAVORS='${FLAVORS}' \
BUNDLE_LIBS=${BUNDLE_LIBS} \
LDCONFIG_DIR="${LDCONFIG_DIR}" \
PKGORIGIN=${PKGORIGIN} \
@@ -4025,11 +4059,17 @@
fetch-specials:
@${ECHO_MSG} "===> Fetching all distfiles required by ${PKGNAME} for building"
@for dir in ${_DEPEND_SPECIALS}; do \
+ case $${dir} in \
+ *@*) \
+ flavor=$${dir#*@}; \
+ dir=$${dir%@*}; \
+ ;; \
+ esac; \
case $$dir in \
/*) ;; \
*) dir=${PORTSDIR}/$$dir ;; \
esac; \
- (cd $$dir; ${MAKE} fetch); \
+ (cd $$dir; ${MAKE} FLAVOR=$${flavor} fetch); \
done
.endif
@@ -4323,6 +4363,7 @@
INDEX_OUT=/dev/stdout
. endif
+. if empty(FLAVORS) || defined(DESCRIBE_FLAVORED)
describe:
@(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
${ECHO_CMD} -n ${COMMENT:Q}; \
@@ -4337,6 +4378,13 @@
;; \
esac; \
done < ${DESCR}; ${ECHO_CMD}) >>${INDEX_OUT}
+. else # empty(FLAVORS)
+describe: ${FLAVORS:S/^/describe-/}
+. for f in ${FLAVORS}
+describe-${f}:
+ @cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -DDESCRIBE_FLAVORED describe
+. endfor
+. endif # empty(FLAVORS)
. endif
www-site:
@@ -4618,6 +4666,25 @@
.endif
.endif
+pretty-flavors-package-names:
+.if empty(FLAVORS)
+ @${ECHO_CMD} "no flavor: ${PKGNAME}"
+.else
+.for f in ${FLAVORS}
+ @${ECHO_CMD} -n "${f}: "
+ @cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -V PKGNAME
+.endfor
+.endif
+
+flavors-package-names:
+.if empty(FLAVORS)
+ @${ECHO_CMD} "${PKGNAME}"
+.else
+.for f in ${FLAVORS}
+ @cd ${.CURDIR} && ${MAKE} -B FLAVOR=${f} -V PKGNAME
+.endfor
+.endif
+
# Fake installation of package so that user can pkg delete it later.
.if !target(fake-pkg)
STAGE_ARGS= -i ${STAGEDIR}
Index: Tools/scripts/MOVEDlint.awk
===================================================================
--- Tools/scripts/MOVEDlint.awk
+++ Tools/scripts/MOVEDlint.awk
@@ -78,10 +78,20 @@
resurrected[$1] = NR
if ($2) {
+ flavor=""
+ if ($2 ~ "@") {
+ flavor=$2
+ sub("@.*", "", $2)
+ sub(".*@", "", flavor)
+ }
+
if (system("test -f " portsdir "/" $2 "/Makefile"))
missing[$2] = NR
-# else
-# delete resurrected[$2]
+ else
+ if (flavor != "") {
+ if (system("test \"" flavor "\" = \"`make -C " portsdir "/" $2 " -VFLAVORS:M" flavor "`\""))
+ printf "%5d: %s does not have the %s flavor\n", NR, $2, flavor | sort
+ }
}
# Produces too many false positives
@@ -89,7 +99,7 @@
# printf "Initial value of 'reason' is lowercase: %5d (%s)\n", NR, $4
if ($4 ~ /\.$/)
- printf "%5d: Final character is a dot: (%s)\n", NR, $4
+ printf "%5d: Final character is a dot: (%s)\n", NR, $4 | sort
}
END {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 14, 4:49 PM (15 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27638254
Default Alt Text
D12483.id34454.diff (6 KB)
Attached To
Mode
D12483: Add flavors helpers.
Attached
Detach File
Event Timeline
Log In to Comment