Show a DeprecationWarning if the deprecated pordbapi constructor parameter
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 19:49:50 +0000 (19:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 19:49:50 +0000 (19:49 -0000)
is used incorrectly. (trunk r15292)

svn path=/main/branches/2.1.7/; revision=15531

pym/portage/dbapi/porttree.py

index 452674bb8d2f0970b88cc4340cd1a7477a968699..d5ecce987619c85c385d528a2175f885130864ed 100644 (file)
@@ -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