Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 29 Jan 2018 07:10:52
Message-Id: 1517209706.28ef9023d24bab72dec94e21237982be78c67c08.ulm@gentoo
1 commit: 28ef9023d24bab72dec94e21237982be78c67c08
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 19 20:57:20 2018 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 07:08:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28ef9023
7
8 eutils.eclass: Remove built_with_use().
9
10 The function was deprecated in 2010 and is no longer used in the tree.
11 Use EAPI 2 use deps and has_version as replacement.
12
13 Closes: https://bugs.gentoo.org/261562
14
15 eclass/eutils.eclass | 92 ----------------------------------------------------
16 1 file changed, 92 deletions(-)
17
18 diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
19 index 63f73db290f..be8251f5794 100644
20 --- a/eclass/eutils.eclass
21 +++ b/eclass/eutils.eclass
22 @@ -164,98 +164,6 @@ strip-linguas() {
23 export LINGUAS=${newls:1}
24 }
25
26 -# @FUNCTION: built_with_use
27 -# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags>
28 -# @DESCRIPTION:
29 -#
30 -# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls.
31 -#
32 -# A temporary hack until portage properly supports DEPENDing on USE
33 -# flags being enabled in packages. This will check to see if the specified
34 -# DEPEND atom was built with the specified list of USE flags. The
35 -# --missing option controls the behavior if called on a package that does
36 -# not actually support the defined USE flags (aka listed in IUSE).
37 -# The default is to abort (call die). The -a and -o flags control
38 -# the requirements of the USE flags. They correspond to "and" and "or"
39 -# logic. So the -a flag means all listed USE flags must be enabled
40 -# while the -o flag means at least one of the listed IUSE flags must be
41 -# enabled. The --hidden option is really for internal use only as it
42 -# means the USE flag we're checking is hidden expanded, so it won't be found
43 -# in IUSE like normal USE flags.
44 -#
45 -# Remember that this function isn't terribly intelligent so order of optional
46 -# flags matter.
47 -built_with_use() {
48 - local hidden="no"
49 - if [[ $1 == "--hidden" ]] ; then
50 - hidden="yes"
51 - shift
52 - fi
53 -
54 - local missing_action="die"
55 - if [[ $1 == "--missing" ]] ; then
56 - missing_action=$2
57 - shift ; shift
58 - case ${missing_action} in
59 - true|false|die) ;;
60 - *) die "unknown action '${missing_action}'";;
61 - esac
62 - fi
63 -
64 - local opt=$1
65 - [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
66 -
67 - local PKG=$(best_version $1)
68 - [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
69 - shift
70 -
71 - has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
72 - local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE
73 - local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE
74 -
75 - # if the IUSE file doesn't exist, the read will error out, we need to handle
76 - # this gracefully
77 - if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} == "no" ]] ; then
78 - case ${missing_action} in
79 - true) return 0;;
80 - false) return 1;;
81 - die) die "Unable to determine what USE flags $PKG was built with";;
82 - esac
83 - fi
84 -
85 - if [[ ${hidden} == "no" ]] ; then
86 - local IUSE_BUILT=( $(<"${IUSEFILE}") )
87 - # Don't check USE_EXPAND #147237
88 - local expand
89 - for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]') ; do
90 - if [[ $1 == ${expand}_* ]] ; then
91 - expand=""
92 - break
93 - fi
94 - done
95 - if [[ -n ${expand} ]] ; then
96 - if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then
97 - case ${missing_action} in
98 - true) return 0;;
99 - false) return 1;;
100 - die) die "$PKG does not actually support the $1 USE flag!";;
101 - esac
102 - fi
103 - fi
104 - fi
105 -
106 - local USE_BUILT=$(<${USEFILE})
107 - while [[ $# -gt 0 ]] ; do
108 - if [[ ${opt} = "-o" ]] ; then
109 - has $1 ${USE_BUILT} && return 0
110 - else
111 - has $1 ${USE_BUILT} || return 1
112 - fi
113 - shift
114 - done
115 - [[ ${opt} = "-a" ]]
116 -}
117 -
118 # @FUNCTION: make_wrapper
119 # @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
120 # @DESCRIPTION: