From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E376D138010 for ; Sun, 14 Oct 2012 21:35:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7EB48E0478; Sun, 14 Oct 2012 21:35:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0ABF6E0478 for ; Sun, 14 Oct 2012 21:35:27 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6FBC733C6B6 for ; Sun, 14 Oct 2012 21:35:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 23CB7E5436 for ; Sun, 14 Oct 2012 21:35:26 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1350250426.f58c5799b4bd26cb6485f8ceb796f07a79cac0ee.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/pkgcorepm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/pkgcorepm/__init__.py gentoopm/pkgcorepm/repo.py X-VCS-Directories: gentoopm/pkgcorepm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: f58c5799b4bd26cb6485f8ceb796f07a79cac0ee X-VCS-Branch: master Date: Sun, 14 Oct 2012 21:35:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f4639cfd-cb5d-48ef-aab4-d4e8c85a9768 X-Archives-Hash: 03a6f9678ac0a9bae001844411d9d96c commit: f58c5799b4bd26cb6485f8ceb796f07a79cac0ee Author: Michał Górny gentoo org> AuthorDate: Sun Oct 14 21:33:46 2012 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Oct 14 21:33:46 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=f58c5799 Fix compatibility with pkgcore-0.8.4 API. --- gentoopm/pkgcorepm/__init__.py | 8 ++++++-- gentoopm/pkgcorepm/repo.py | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gentoopm/pkgcorepm/__init__.py b/gentoopm/pkgcorepm/__init__.py index aa117a0..27d980d 100644 --- a/gentoopm/pkgcorepm/__init__.py +++ b/gentoopm/pkgcorepm/__init__.py @@ -33,8 +33,12 @@ class PkgCorePM(PackageManager): @property def installed(self): - return PkgCoreInstalledRepo(self._domain.named_repos['vdb'], - self._domain) + try: + repos = self._domain.repos_raw + except AttributeError: + repos = self._domain.named_repos + + return PkgCoreInstalledRepo(repos['vdb'], self._domain) @property def Atom(self): diff --git a/gentoopm/pkgcorepm/repo.py b/gentoopm/pkgcorepm/repo.py index dc43148..44bd745 100644 --- a/gentoopm/pkgcorepm/repo.py +++ b/gentoopm/pkgcorepm/repo.py @@ -20,12 +20,16 @@ class PkgCoreRepoDict(PMRepositoryDict): def __iter__(self): try: trees = self._domain.named_repos['repo-stack'].trees - except KeyError: # pkgcore-0.7.5+ + except (KeyError, AttributeError): # pkgcore-0.7.5+ def _match_ebuild_repos(x): return isinstance(x, UnconfiguredTree) - trees = filter(_match_ebuild_repos, - self._domain.named_repos.values()) + try: + all_repos = self._domain.repos_raw + except AttributeError: + all_repos = self._domain.named_repos + + trees = filter(_match_ebuild_repos, all_repos.values()) rev = -1 else: rev = 1