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 1QfRlT-0008Ut-IW for garchives@archives.gentoo.org; Sat, 09 Jul 2011 07:15:47 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D8F6021C058; Sat, 9 Jul 2011 07:15:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AD5A521C058 for ; Sat, 9 Jul 2011 07:15:40 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38E972AC10B for ; Sat, 9 Jul 2011 07:15:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id EBF5A80042 for ; Sat, 9 Jul 2011 07:15:38 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <613cc058d3955b9527ccd34879ded887137b2ecc.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/pkgcorepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/pkgcorepm/repo.py X-VCS-Directories: gentoopm/pkgcorepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 613cc058d3955b9527ccd34879ded887137b2ecc Date: Sat, 9 Jul 2011 07:15:38 +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: 28e7e55de9c77414860250fdab369179 commit: 613cc058d3955b9527ccd34879ded887137b2ecc Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Sat Jul 9 07:16:05 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Sat Jul 9 07:16:20 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D613cc058 pkgcore: fix chaining filters. --- gentoopm/pkgcorepm/repo.py | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/gentoopm/pkgcorepm/repo.py b/gentoopm/pkgcorepm/repo.py index c923c69..cd25359 100644 --- a/gentoopm/pkgcorepm/repo.py +++ b/gentoopm/pkgcorepm/repo.py @@ -3,6 +3,8 @@ # (c) 2011 Micha=C5=82 G=C3=B3rny # Released under the terms of the 2-clause BSD license. =20 +import pkgcore.restrictions.boolean as br + from gentoopm.basepm.repo import PMRepository, PMRepositoryDict, \ PMEbuildRepository from gentoopm.pkgcorepm.pkg import PkgCorePackage @@ -48,6 +50,18 @@ class PkgCoreFilteredRepo(PkgCoreRepository): for pkg in self._repo._repo.match(self._filt): yield PkgCorePackage(pkg, index) =20 + def filter(self, *args, **kwargs): + r =3D self + filt, newargs, newkwargs =3D transform_filters(args, kwargs) + + if filt: + r =3D PkgCoreFilteredRepo(self._repo, + br.AndRestriction(self._filt, filt)) + if newargs or newkwargs: + r =3D PMRepository.filter(r, *args, **kwargs) + + return r + class PkgCoreEbuildRepo(PkgCoreRepository, PMEbuildRepository): def __init__(self, repo_obj, index): PkgCoreRepository.__init__(self, repo_obj)