Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 498988 | Differences between
and this patch

Collapse All | Expand All

(-)eutils.eclass (+45 lines)
Lines 1729-1732 Link Here
1729
1729
1730
check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; }
1730
check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; }
1731
1731
1732
# @FUNCTION: optfeature
1733
# @USAGE: <short description> <package atom to match> [other atoms]
1734
# @DESCRIPTION:
1735
# Print out a message suggesting an optional package (or packages) which
1736
# provide the described functionality
1737
#
1738
# The following snippet would suggest app-misc/foo for optional foo support,
1739
# app-misc/bar or app-misc/baz[bar] for optional bar support
1740
# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support.
1741
# @CODE:
1742
# 		optfeature "foo support" app-misc/foo
1743
# 		optfeature "bar support" app-misc/bar app-misc/baz[bar]
1744
#		optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c
1745
#
1746
optfeature() {
1747
	debug-print-function ${FUNCNAME} "$@"
1748
	local i j msg
1749
	local desc=$1
1750
	local flag=0
1751
	shift
1752
	for i; do
1753
		for j in $i; do
1754
			if has_version "$j"; then
1755
				flag=1
1756
			else
1757
				flag=0
1758
				break
1759
			fi
1760
		done
1761
		if [[ $flag -eq 1 ]]; then
1762
			break
1763
		fi
1764
	done
1765
	if [[ $flag -eq 0 ]]; then
1766
		for i; do
1767
			msg=" "
1768
			for j in $i; do
1769
				msg="${msg} ${j} and"
1770
			done
1771
			msg="${msg:0: -4} for ${desc}"
1772
			elog "${msg}"
1773
		done
1774
	fi
1775
}
1776
1732
fi
1777
fi

Return to bug 498988