Page MenuHomeFreeBSD

D12577.id33946.diff
No OneTemporary

D12577.id33946.diff

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.port.mk
===================================================================
--- Mk/bsd.port.mk
+++ Mk/bsd.port.mk
@@ -1058,8 +1058,7 @@
NOTPHONY?=
FLAVORS?=
FLAVOR?=
-# 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} \
@@ -1075,18 +1074,6 @@
.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
-.endif
-
-.if !empty(FLAVORS) && empty(FLAVOR)
-FLAVOR= ${FLAVORS:[1]}
-.endif
-
# Do not leak flavors to childs make
.MAKEOVERRIDES:= ${MAKEOVERRIDES:NFLAVOR=*}
@@ -1463,6 +1450,18 @@
.include "${USESDIR}/${f:C/\:.*//}.mk"
.endfor
+.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
+.endif
+
+.if !empty(FLAVORS) && empty(FLAVOR)
+FLAVOR= ${FLAVORS:[1]}
+.endif
+
EXTRACT_SUFX?= .tar.gz
.if defined(USE_LINUX_PREFIX)
@@ -1555,6 +1554,9 @@
LOCALBASE=${LOCALBASE} \
"STRIP=${STRIP}" \
TMPPLIST=${TMPPLIST} \
+ CURDIR='${.CURDIR}' \
+ FLAVOR=${FLAVOR} \
+ FLAVORS='${FLAVORS}' \
BUNDLE_LIBS=${BUNDLE_LIBS} \
LDCONFIG_DIR="${LDCONFIG_DIR}" \
PKGORIGIN=${PKGORIGIN} \
@@ -4311,6 +4313,7 @@
INDEX_OUT=/dev/stdout
. endif
+. if empty(FLAVORS) || defined(DESCRIBE_FLAVORED)
describe:
@(${ECHO_CMD} -n "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \
${ECHO_CMD} -n ${COMMENT:Q}; \
@@ -4325,6 +4328,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:
@@ -4606,6 +4616,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}

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 18, 10:27 PM (20 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31736127
Default Alt Text
D12577.id33946.diff (3 KB)

Event Timeline