diff options
author | Zac Medico <zmedico@gentoo.org> | 2019-01-19 22:39:39 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2019-01-19 22:53:34 -0800 |
commit | bbe00f515b80be3d6e279e4033f1cbc776a7fe27 (patch) | |
tree | 16d6a25b575b1cfc5f0b68840f00047a260dd62c /lib | |
parent | ebuild.sh: fix try_source qa condition test (diff) | |
download | portage-bbe00f515b80be3d6e279e4033f1cbc776a7fe27.tar.gz portage-bbe00f515b80be3d6e279e4033f1cbc776a7fe27.tar.bz2 portage-bbe00f515b80be3d6e279e4033f1cbc776a7fe27.zip |
portagetree: getname and portroot DeprecationWarning
Bug: https://bugs.gentoo.org/668164
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/portage/dbapi/porttree.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py index 76b7967f7..2ff3e1b34 100644 --- a/lib/portage/dbapi/porttree.py +++ b/lib/portage/dbapi/porttree.py @@ -1339,11 +1339,19 @@ class portagetree(object): " constructor is unused", DeprecationWarning, stacklevel=2) - self.portroot = settings["PORTDIR"] self.__virtual = virtual self.dbapi = portdbapi(mysettings=settings) @property + def portroot(self): + """Deprecated. Use the portdbapi getRepositoryPath method instead.""" + warnings.warn("The portroot attribute of " + "portage.dbapi.porttree.portagetree is deprecated. Use the " + "portdbapi getRepositoryPath method instead.", + DeprecationWarning, stacklevel=3) + return self.settings['PORTDIR'] + + @property def root(self): warnings.warn("The root attribute of " + \ "portage.dbapi.porttree.portagetree" + \ @@ -1383,7 +1391,11 @@ class portagetree(object): return self.dbapi.cp_all() def getname(self, pkgname): - "returns file location for this particular package (DEPRECATED)" + """Deprecated. Use the portdbapi findname method instead.""" + warnings.warn("The getname method of " + "portage.dbapi.porttree.portagetree is deprecated. " + "Use the portdbapi findname method instead.", + DeprecationWarning, stacklevel=2) if not pkgname: return "" mysplit = pkgname.split("/") |