From cc2e6123deac772c34e8fb1794c590226a162828 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 30 May 2007 22:33:10 +0000 Subject: [PATCH] Show deprecation warnings if the "clone" parameters are used for the binartree, vartree, or portagetree constructors. svn path=/main/trunk/; revision=6676 --- pym/portage/dbapi/bintree.py | 2 ++ pym/portage/dbapi/porttree.py | 2 ++ pym/portage/dbapi/vartree.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index ab4b88ae9..7942a45dc 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -95,6 +95,8 @@ class binarytree(object): "this tree scans for a list of all packages available in PKGDIR" def __init__(self, root, pkgdir, virtual=None, settings=None, clone=None): if clone: + writemsg("binartree.__init__(): deprecated " + \ + "use of clone parameter\n", noiselevel=-1) # XXX This isn't cloning. It's an instance of the same thing. self.root = clone.root self.pkgdir = clone.pkgdir diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 86d70416f..c99b0193c 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -727,6 +727,8 @@ class portagetree(object): """ if clone: + writemsg("portagetree.__init__(): deprecated " + \ + "use of clone parameter\n", noiselevel=-1) self.root = clone.root self.portroot = clone.portroot self.pkglines = clone.pkglines diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 906c3c97f..3c4077e70 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -669,6 +669,8 @@ class vartree(object): def __init__(self, root="/", virtual=None, clone=None, categories=None, settings=None): if clone: + writemsg("vartree.__init__(): deprecated " + \ + "use of clone parameter\n", noiselevel=-1) self.root = clone.root[:] self.dbapi = copy.deepcopy(clone.dbapi) self.populated = 1 -- 2.26.2