From: Zac Medico Date: Mon, 21 Sep 2009 15:24:12 +0000 (-0000) Subject: Show deprecation warnings when dep_* legacy code is triggered. X-Git-Tag: v2.2_rc42~78 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5;p=portage.git Show deprecation warnings when dep_* legacy code is triggered. svn path=/main/trunk/; revision=14324 --- 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)