On 02/28/2013 09:30 AM, Michał Górny wrote:
> 
> Setting that variable would invalidate metadata cache.
> 

different approach attached
--- eclass/multilib-minimal.eclass
+++ eclass/multilib-minimal.eclass
@@ -18,12 +18,6 @@
 #
 # If you need generic install rules, use multilib_src_install_all function.
 
-# @ECLASS-VARIABLE: DISABLE_MULTILIB
-# @DESCRIPTION:
-# set to ON to disable multilib entirely
-# this is not meant to be set in the ebuild
-: ${DISABLE_MULTILIB:=OFF}
-
 
 # EAPI=5 is required for meaningful MULTILIB_USEDEP.
 case ${EAPI:-0} in
@@ -31,22 +25,28 @@
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-_multilib_inherit=
-if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
-	_multilib_inherit="multilib-build"
-fi
 
-inherit ${_multilib_inherit}
+inherit multilib-build
 
 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
 
+
+unset DISABLE_MULTILIB
+_multilib-minimal_set_globals() {
+	if [[ $(multilib_get_enabled_abis) == ${DEFAULT_ABI} ]] ; then
+		DISABLE_MULTILIB="ON"
+	fi
+}
+_multilib-minimal_set_globals
+
+
 multilib_copy_sources() {
 	_abi_copy_sources() {
 		einfo "${ABI}: copying to ${BUILD_DIR}"
 		cp -pR "${S}" "${BUILD_DIR}" || die "failed to copy sources"
 	}
 
-	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
+	if [[ -z ${DISABLE_MULTILIB} ]] ; then
 		einfo "Will copy sources to abi-specific dirs"
 		multilib_foreach_abi _abi_copy_sources
 	fi
@@ -70,7 +70,7 @@
 		popd >/dev/null || die
 	}
 
-	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
+	if [[ -z ${DISABLE_MULTILIB} ]] ; then
 		multilib_foreach_abi _abi_src_configure
 	else
 		_common_src_configure
@@ -94,7 +94,7 @@
 		popd >/dev/null || die
 	}
 
-	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
+	if [[ -z ${DISABLE_MULTILIB} ]] ; then
 		multilib_foreach_abi _abi_src_compile
 	else
 		_common_src_compile
@@ -118,7 +118,7 @@
 		popd >/dev/null || die
 	}
 
-	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
+	if [[ -z ${DISABLE_MULTILIB} ]] ; then
 		multilib_foreach_abi _abi_src_test
 	else
 		_common_src_test
@@ -143,7 +143,7 @@
 		popd >/dev/null || die
 	}
 
-	if [[ ${DISABLE_MULTILIB} == "OFF" ]] ; then
+	if [[ -z ${DISABLE_MULTILIB} ]] ; then
 		multilib_foreach_abi _abi_src_install
 	else
 		_common_src_install

Reply via email to