diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-09-21 15:24:12 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-09-21 15:24:12 +0000 |
commit | 6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5 (patch) | |
tree | 0132fd1f6ffbe0c7c479f13352489724f1255c16 | |
parent | e0bc361e32fcc4340bf31289f95e72cfa9ca1ed1 (diff) | |
download | portage-6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5.tar.gz portage-6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5.tar.bz2 portage-6caf1a0c17ac7fa7c4723e7ad2489f291c337eb5.zip |
Show deprecation warnings when dep_* legacy code is triggered.
svn path=/main/trunk/; revision=14324
-rw-r--r-- | pym/portage/dep.py | 11 |
1 files changed, 10 insertions, 1 deletions
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) |