public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eutils.eclass: Remove built_with_use().
@ 2018-01-19 20:57 Ulrich Müller
  0 siblings, 0 replies; only message in thread
From: Ulrich Müller @ 2018-01-19 20:57 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3596 bytes --]

The function was deprecated in 2010 and is no longer used in the tree.
Use EAPI 2 use deps and has_version as replacement.

Closes: https://bugs.gentoo.org/261562
---
To be committed after removal of x-modular.eclass which is scheduled
for 2018-02-01.

 eclass/eutils.eclass | 92 ----------------------------------------------------
 1 file changed, 92 deletions(-)

diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 63f73db290f4..be8251f5794a 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -164,98 +164,6 @@ strip-linguas() {
 	export LINGUAS=${newls:1}
 }
 
-# @FUNCTION: built_with_use
-# @USAGE: [--hidden] [--missing <action>] [-a|-o] <DEPEND ATOM> <List of USE flags>
-# @DESCRIPTION:
-#
-# Deprecated: Use EAPI 2 use deps in DEPEND|RDEPEND and with has_version calls.
-#
-# A temporary hack until portage properly supports DEPENDing on USE
-# flags being enabled in packages.  This will check to see if the specified
-# DEPEND atom was built with the specified list of USE flags.  The
-# --missing option controls the behavior if called on a package that does
-# not actually support the defined USE flags (aka listed in IUSE).
-# The default is to abort (call die).  The -a and -o flags control
-# the requirements of the USE flags.  They correspond to "and" and "or"
-# logic.  So the -a flag means all listed USE flags must be enabled
-# while the -o flag means at least one of the listed IUSE flags must be
-# enabled.  The --hidden option is really for internal use only as it
-# means the USE flag we're checking is hidden expanded, so it won't be found
-# in IUSE like normal USE flags.
-#
-# Remember that this function isn't terribly intelligent so order of optional
-# flags matter.
-built_with_use() {
-	local hidden="no"
-	if [[ $1 == "--hidden" ]] ; then
-		hidden="yes"
-		shift
-	fi
-
-	local missing_action="die"
-	if [[ $1 == "--missing" ]] ; then
-		missing_action=$2
-		shift ; shift
-		case ${missing_action} in
-			true|false|die) ;;
-			*) die "unknown action '${missing_action}'";;
-		esac
-	fi
-
-	local opt=$1
-	[[ ${opt:0:1} = "-" ]] && shift || opt="-a"
-
-	local PKG=$(best_version $1)
-	[[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
-	shift
-
-	has "${EAPI:-0}" 0 1 2 && local EROOT=${ROOT}
-	local USEFILE=${EROOT}/var/db/pkg/${PKG}/USE
-	local IUSEFILE=${EROOT}/var/db/pkg/${PKG}/IUSE
-
-	# if the IUSE file doesn't exist, the read will error out, we need to handle
-	# this gracefully
-	if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} == "no" ]] ; then
-		case ${missing_action} in
-			true)	return 0;;
-			false)	return 1;;
-			die)	die "Unable to determine what USE flags $PKG was built with";;
-		esac
-	fi
-
-	if [[ ${hidden} == "no" ]] ; then
-		local IUSE_BUILT=( $(<"${IUSEFILE}") )
-		# Don't check USE_EXPAND #147237
-		local expand
-		for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]') ; do
-			if [[ $1 == ${expand}_* ]] ; then
-				expand=""
-				break
-			fi
-		done
-		if [[ -n ${expand} ]] ; then
-			if ! has $1 ${IUSE_BUILT[@]#[-+]} ; then
-				case ${missing_action} in
-					true)  return 0;;
-					false) return 1;;
-					die)   die "$PKG does not actually support the $1 USE flag!";;
-				esac
-			fi
-		fi
-	fi
-
-	local USE_BUILT=$(<${USEFILE})
-	while [[ $# -gt 0 ]] ; do
-		if [[ ${opt} = "-o" ]] ; then
-			has $1 ${USE_BUILT} && return 0
-		else
-			has $1 ${USE_BUILT} || return 1
-		fi
-		shift
-	done
-	[[ ${opt} = "-a" ]]
-}
-
 # @FUNCTION: make_wrapper
 # @USAGE: <wrapper> <target> [chdir] [libpaths] [installpath]
 # @DESCRIPTION:
-- 
2.16.0

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-19 21:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-19 20:57 [gentoo-dev] [PATCH] eutils.eclass: Remove built_with_use() Ulrich Müller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox