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 (+47 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
1749
	local desc=$1
1750
	local flag=0
1751
	local innercount=0
1752
	local innerflag=0
1753
	shift
1754
	for i; do
1755
		for j in $i; do
1756
			if has_version "$j"; then
1757
				flag=1
1758
			else
1759
				flag=0
1760
				break
1761
			fi
1762
		done
1763
		if [[ $flag -eq 1 ]]; then
1764
			break
1765
		fi
1766
	done
1767
	if [[ $flag -eq 0 ]]; then
1768
		for i; do
1769
			local msg=" "
1770
			for j in $i; do
1771
				msg="${msg} ${j} and"
1772
			done
1773
			msg="${msg:0: -4} for ${desc}"
1774
			elog "${msg}"
1775
		done
1776
	fi
1777
}
1778
1732
fi
1779
fi

Return to bug 498988