/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.431 Revision 1.432
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.431 2014/01/08 06:46:18 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.432 2014/03/15 00:47:42 creffett Exp $
4 4
5# @ECLASS: eutils.eclass 5# @ECLASS: eutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: many extra (but common) functions that are used in ebuilds 8# @BLURB: many extra (but common) functions that are used in ebuilds
1727 return 0 1727 return 0
1728} 1728}
1729 1729
1730check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; } 1730check_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#
1746optfeature() {
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
1732fi 1777fi

Legend:
Removed from v.1.431  
changed lines
  Added in v.1.432

  ViewVC Help
Powered by ViewVC 1.1.20