From 6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5 Mon Sep 17 00:00:00 2001
From: Zac Medico <zmedico@gentoo.org>
Date: Mon, 21 Sep 2009 15:24:12 +0000
Subject: [PATCH] Show deprecation warnings when dep_* legacy code is
 triggered.

svn path=/main/trunk/; revision=14324
---
 pym/portage/dep.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 4a2514474..b89278bdd 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -18,7 +18,7 @@
 #
 
 import re, sys
-import weakref
+import warnings
 from itertools import chain
 import portage.exception
 from portage.exception import InvalidData, InvalidAtom
@@ -641,6 +641,9 @@ def get_operator(mydep):
 		pass
 
 	# Fall back to legacy code for backward compatibility.
+	warnings.warn(_("%s is deprecated, use %s instead") % \
+		('portage.dep.get_operator()', 'portage.dep.Atom.operator'),
+		DeprecationWarning)
 	operator = None
 	if mydep:
 		mydep = remove_slot(mydep)
@@ -684,6 +687,9 @@ def dep_getcpv(mydep):
 		pass
 
 	# Fall back to legacy code for backward compatibility.
+	warnings.warn(_("%s is deprecated, use %s instead") % \
+		('portage.dep.dep_getcpv()', 'portage.dep.Atom.cpv'),
+		DeprecationWarning)
 	mydep_orig = mydep
 	if mydep:
 		mydep = remove_slot(mydep)
@@ -927,6 +933,9 @@ def dep_getkey(mydep):
 			pass
 
 	# Fall back to legacy code for backward compatibility.
+	warnings.warn(_("%s is deprecated, use %s instead") % \
+		('portage.dep.dep_getkey()', 'portage.dep.Atom.cp'),
+		DeprecationWarning)
 	mydep = dep_getcpv(mydep)
 	if mydep and isspecific(mydep):
 		mysplit = catpkgsplit(mydep)
-- 
2.26.2