public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eutils: Warn on built_with_use usage
@ 2012-09-16  7:51 Brian Harring
  2012-09-17  2:10 ` [gentoo-dev] " Mike Frysinger
  0 siblings, 1 reply; 13+ messages in thread
From: Brian Harring @ 2012-09-16  7:51 UTC (permalink / raw
  To: gentoo-dev; +Cc: vapier, Brian Harring

At this point, the functionality built_with_use provides should
be covered near or more likely, in full, but USE deps in EAPI2 and
EAPI4; thus warn on usage.

While this may be a bit annoying, this is the only major consumer
left at this point that knows about /var/db/pkg layout; once that's
gone, alternative VDB formats can occur (meaning faster package
manager operations, or at least the potential if implemented sanely).

This patch is a rough first stab at the wording (english isn't
exactly my forte) to use for warning; better/clearer warning text
would be appreciated.
---
 eutils.eclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/eutils.eclass b/eutils.eclass
index 8bfc2bc..7f5a616 100644
--- a/eutils.eclass
+++ b/eutils.eclass
@@ -1196,7 +1196,9 @@ built_with_use() {
 	fi
 
 	local missing_action="die"
+	local missing_was_set=false
 	if [[ $1 == "--missing" ]] ; then
+		missing_was_set=true
 		missing_action=$2
 		shift ; shift
 		case ${missing_action} in
@@ -1205,6 +1207,17 @@ built_with_use() {
 		esac
 	fi
 
+	if ! has $EAPI 0 1 2 3; then
+		eqawarn "built_with_use should not be used in $EAPI; use USE deps."
+	elif has $EAPI 2 3; then
+		if [[ $hidden == yes ]] || $missing_was_set; then
+			eqawarn "built_with_use in EAPI=$EAPI without --missing or --hidden usage, should use USE deps instead."
+		else
+			eqawarn "built_with_use should not be used; upgrade to EAPI=4 instead"
+		fi
+	fi
+
+
 	local opt=$1
 	[[ ${opt:0:1} = "-" ]] && shift || opt="-a"
 
-- 
1.7.12



^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-09-19  5:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-16  7:51 [gentoo-dev] [PATCH] eutils: Warn on built_with_use usage Brian Harring
2012-09-17  2:10 ` [gentoo-dev] " Mike Frysinger
2012-09-17  2:41   ` Brian Harring
2012-09-17  6:45     ` Ralph Sennhauser
2012-09-17  6:58       ` Ralph Sennhauser
2012-09-17 22:10       ` Brian Harring
2012-09-18 20:35         ` Ryan Hill
2012-09-18  9:31           ` Brian Harring
2012-09-17  7:58     ` Gregory M. Turner
2012-09-17  8:00       ` Ciaran McCreesh
2012-09-17  9:24         ` Gregory M. Turner
2012-09-17  8:10       ` Ralph Sennhauser
2012-09-19  5:42     ` Mike Frysinger

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