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 1ScP2J-0001EF-Ek for garchives@archives.gentoo.org; Wed, 06 Jun 2012 22:49:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9139DE0540; Wed, 6 Jun 2012 22:48:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 52451E058A for ; Wed, 6 Jun 2012 22:48:54 +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 4D82F1B4004 for ; Wed, 6 Jun 2012 22:48:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 0D0A0E5430 for ; Wed, 6 Jun 2012 22:48:53 +0000 (UTC) From: "Slava Bacherikov" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Slava Bacherikov" Message-ID: <1339018360.20ce0df8e5a4a3a08973f595a900ef6f5309b28e.bacher09@gentoo> Subject: [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/, gpackages/libs/ X-VCS-Repository: proj/gentoo-packages X-VCS-Files: gpackages/apps/packages/scan.py gpackages/libs/generic.py gpackages/libs/porttree.py X-VCS-Directories: gpackages/apps/packages/ gpackages/libs/ X-VCS-Committer: bacher09 X-VCS-Committer-Name: Slava Bacherikov X-VCS-Revision: 20ce0df8e5a4a3a08973f595a900ef6f5309b28e X-VCS-Branch: master Date: Wed, 6 Jun 2012 22:48:53 +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: b28be6d9-eef2-4456-952f-15a7f0136930 X-Archives-Hash: e16db7769dad9848fb2347694d512c55 commit: 20ce0df8e5a4a3a08973f595a900ef6f5309b28e Author: Slava Bacherikov bacher09 org> AuthorDate: Wed Jun 6 21:32:40 2012 +0000 Commit: Slava Bacherikov bacherikov org ua> CommitDate: Wed Jun 6 21:32:40 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoo-packag= es.git;a=3Dcommit;h=3D20ce0df8 Changes in portage layer --- gpackages/apps/packages/scan.py | 1 - gpackages/libs/generic.py | 6 +++++- gpackages/libs/porttree.py | 20 ++++++++++++++------ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gpackages/apps/packages/scan.py b/gpackages/apps/packages/sc= an.py index add62f1..f316900 100644 --- a/gpackages/apps/packages/scan.py +++ b/gpackages/apps/packages/scan.py @@ -330,7 +330,6 @@ def scanpackages(porttree, porttree_obj, delete =3D T= rue, force_update =3D False): existend_packages.append(package_object.pk) if not package_created: if package_object.check_or_need_update(package) or force= _update: - print package # need update update_package(package, package_object) else: diff --git a/gpackages/libs/generic.py b/gpackages/libs/generic.py index c3d8d2b..bc1cd55 100644 --- a/gpackages/libs/generic.py +++ b/gpackages/libs/generic.py @@ -2,8 +2,12 @@ import os.path import hashlib from datetime import datetime =20 +__all__ =3D ('StrThatIgnoreCase', 'ToStrMixin', 'file_get_content', 'fil= e_sha1', \ + 'file_mtime', 'cached_property' ) + class StrThatIgnoreCase(unicode): - =20 + __slots__ =3D ('_forcmp',) + def __init__(self, value): super(StrThatIgnoreCase, self).__init__(value) self._forcmp =3D value.lower() diff --git a/gpackages/libs/porttree.py b/gpackages/libs/porttree.py index 5b1dba8..dec4867 100644 --- a/gpackages/libs/porttree.py +++ b/gpackages/libs/porttree.py @@ -6,6 +6,7 @@ from portage.exception import PortageException, FileNotFo= und, InvalidAtom, \ =20 from gentoolkit.package import Package as PackageInfo from gentoolkit.metadata import MetaData +from gentoolkit import errors from generic import ToStrMixin, file_sha1, file_mtime, cached_property, = \ file_get_content, StrThatIgnoreCase from use_info import get_uses_info, get_local_uses_info @@ -266,12 +267,9 @@ class Package(ToStrMixin): ebuilds =3D PORTDB.cp_list(self.package, mytree =3D self.category.porttree.portt= ree) for ebuild in ebuilds: - try: - PORTDB.aux_get(ebuild, [], mytree =3D self.category.port= tree_path) - except KeyError: - pass - else: - yield Ebuild(self ,ebuild) + ebuild_obj =3D Ebuild(self, ebuild) + if ebuild_obj.is_valid: + yield ebuild_obj =20 def __unicode__(self): return '%s' % self.package @@ -345,6 +343,16 @@ class Ebuild(ToStrMixin): return self.package_object.environment("KEYWORDS", prefer_vdb =3D= False) =20 @property + def is_valid(self): + try: + self.package_object.environment("EAPI") + except errors.GentoolkitFatalError: + return False + else: + return True + + + @property def keywords(self): return list(set(self.keywords_env.split())) =20