From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QOM5M-0007nQ-LB for garchives@archives.gentoo.org; Mon, 23 May 2011 03:45:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C0C11C004; Mon, 23 May 2011 03:45:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 13D031C004 for ; Mon, 23 May 2011 03:45:29 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 626E21B401C for ; Mon, 23 May 2011 03:45:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 590BF80505 for ; Mon, 23 May 2011 03:45:28 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <665ee8fc8c85bceda7ec86e5df1c7f8c580d9be0.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/dependencies.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 665ee8fc8c85bceda7ec86e5df1c7f8c580d9be0 Date: Mon, 23 May 2011 03:45:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 81e1f27bbaea4a0d4e3b874d839d7f49 commit: 665ee8fc8c85bceda7ec86e5df1c7f8c580d9be0 Author: dol-sen gmail com> AuthorDate: Mon May 23 03:44:38 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Mon May 23 03:44:38 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D665ee8fc fix the Dependencies.graph_depends() api return value not being correct. --- pym/gentoolkit/dependencies.py | 41 ++++++++++++++++++----------------= ----- 1 files changed, 19 insertions(+), 22 deletions(-) diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies= .py index feced63..0396952 100644 --- a/pym/gentoolkit/dependencies.py +++ b/pym/gentoolkit/dependencies.py @@ -115,7 +115,7 @@ class Dependencies(Query): max_depth=3D1, printer_fn=3DNone, # The rest of these are only used internally: - depth=3D0, + depth=3D1, seen=3DNone, depcache=3DNone, result=3DNone @@ -151,32 +151,29 @@ class Dependencies(Query): except KeyError: pkgdep =3D Query(dep.atom).find_best() depcache[dep.atom] =3D pkgdep - if pkgdep and pkgdep.cpv in seen: + if not pkgdep: continue - if depth < max_depth or max_depth <=3D 0: - + elif pkgdep.cpv in seen: + continue + if depth <=3D max_depth or max_depth =3D=3D 0: if printer_fn is not None: printer_fn(depth, pkgdep, dep) - if not pkgdep: - continue + result.append((depth,pkgdep)) =20 seen.add(pkgdep.cpv) - result.append(( - depth, - pkgdep.deps.graph_depends( - max_depth=3Dmax_depth, - printer_fn=3Dprinter_fn, - # The rest of these are only used internally: - depth=3Ddepth+1, - seen=3Dseen, - depcache=3Ddepcache, - result=3Dresult - ) - )) - - if depth =3D=3D 0: - return result - return pkgdep + if depth < max_depth or max_depth =3D=3D 0: + # result is passed in and added to directly + # so rdeps is disposable + rdeps =3D pkgdep.deps.graph_depends( + max_depth=3Dmax_depth, + printer_fn=3Dprinter_fn, + # The rest of these are only used internally: + depth=3Ddepth+1, + seen=3Dseen, + depcache=3Ddepcache, + result=3Dresult + ) + return result =20 def graph_reverse_depends( self,