summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-01-30 16:55:15 +0000
committerZac Medico <zmedico@gentoo.org>2010-01-30 16:55:15 +0000
commitb3b332b940bd369e5e6e4654a69d837a907795f3 (patch)
treea5c260340ac19ade138c2ab59e9f5a37236bcbdd
parent5b672b36a01d72b8e32cff19847d883d3c1b369a (diff)
downloadportage-b3b332b940bd369e5e6e4654a69d837a907795f3.tar.gz
portage-b3b332b940bd369e5e6e4654a69d837a907795f3.tar.bz2
portage-b3b332b940bd369e5e6e4654a69d837a907795f3.zip
Show a DeprecationWarning if the deprecated pordbapi constructor parameter
is used incorrectly. svn path=/main/trunk/; revision=15292
-rw-r--r--pym/portage/dbapi/porttree.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 452674bb8..d5ecce987 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -157,16 +157,17 @@ class portdbapi(dbapi):
from portage import settings
self.mysettings = config(clone=settings)
- # enable this warning after this parameter is unused in stable portage
- if False and _unused_param is not None:
+ porttree_root = self.mysettings['PORTDIR']
+
+ # always show this warning after this parameter
+ # is unused in stable portage
+ if _unused_param is not None and _unused_param != porttree_root:
warnings.warn("The first parameter of the " + \
"portage.dbapi.porttree.portdbapi" + \
" constructor is now unused. Use " + \
"mysettings['PORTDIR'] instead.",
DeprecationWarning)
- porttree_root = self.mysettings['PORTDIR']
-
# This is strictly for use in aux_get() doebuild calls when metadata
# is generated by the depend phase. It's safest to use a clone for
# this purpose because doebuild makes many changes to the config