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

Diff of /eclass/confutils.eclass

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

Revision 1.21 Revision 1.22
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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/confutils.eclass,v 1.21 2008/02/20 13:07:50 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/confutils.eclass,v 1.22 2008/02/27 09:53:04 hollow Exp $
4 4
5# @ECLASS: confutils.eclass 5# @ECLASS: confutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Benedikt Böhm <hollow@gentoo.org> 7# Benedikt Böhm <hollow@gentoo.org>
8# @BLURB: utility functions to help with configuring a package 8# @BLURB: utility functions to help with configuring a package
34 if [[ ${EBUILD_SUPPORTS_SHAREDEXT} == 1 ]] && use sharedext; then 34 if [[ ${EBUILD_SUPPORTS_SHAREDEXT} == 1 ]] && use sharedext; then
35 shared="=${1:-shared}" 35 shared="=${1:-shared}"
36 else 36 else
37 shared= 37 shared=
38 fi 38 fi
39}
40
41# @FUNCTION: confutils_require_one
42# @USAGE: <flag> [more flags ...]
43# @DESCRIPTION:
44# Use this function to ensure exactly one of the specified USE flags have been
45# enabled
46confutils_require_one() {
47 local required_flags="$@"
48 local success=0
49
50 for flag in ${required_flags}; do
51 use ${flag} && ((success++))
52 done
53
54 [[ ${success} -eq 1 ]] && return
55
56 echo
57 eerror "You *must* enable *exactly* one of the following USE flags:"
58 eerror " ${required_flags}"
59 eerror
60 eerror "You can do this by enabling *one* of these flag in /etc/portage/package.use:"
61
62 set -- ${required_flags}
63 eerror " =${CATEGORY}/${PN}-${PVR} ${1}"
64 shift
65
66 for flag in $@; do
67 eerror " OR =${CATEGORY}/${PN}-${PVR} ${flag}"
68 done
69
70 echo
71 die "Missing or conflicting USE flags"
39} 72}
40 73
41# @FUNCTION: confutils_require_any 74# @FUNCTION: confutils_require_any
42# @USAGE: <flag> [more flags ...] 75# @USAGE: <flag> [more flags ...]
43# @DESCRIPTION: 76# @DESCRIPTION:

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20