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 1SbGZP-0003D8-Cc for garchives@archives.gentoo.org; Sun, 03 Jun 2012 19:34:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 70A45E08B0; Sun, 3 Jun 2012 19:34:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2CC95E08B0 for ; Sun, 3 Jun 2012 19:34: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 081F01B4027 for ; Sun, 3 Jun 2012 19:34:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 99598E5404 for ; Sun, 3 Jun 2012 19:34:25 +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: <1338742586.98a85554f37151983f7cd70da08889a90d0b7ab0.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/models.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: 98a85554f37151983f7cd70da08889a90d0b7ab0 X-VCS-Branch: master Date: Sun, 3 Jun 2012 19:34:25 +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: c2a37ca2-75d7-4596-b6b6-1e5c24d8280f X-Archives-Hash: 57a79eb766bc145c4bc500ea9cef16c5 commit: 98a85554f37151983f7cd70da08889a90d0b7ab0 Author: Slava Bacherikov bacher09 org> AuthorDate: Sun Jun 3 16:56:26 2012 +0000 Commit: Slava Bacherikov bacherikov org ua> CommitDate: Sun Jun 3 16:56:26 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoo-packag= es.git;a=3Dcommit;h=3D98a85554 Save chagnelog to database. --- gpackages/apps/packages/models.py | 5 +++-- gpackages/libs/porttree.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gpackages/apps/packages/models.py b/gpackages/apps/packages/= models.py index 0fc1dc0..cf1cf1b 100644 --- a/gpackages/apps/packages/models.py +++ b/gpackages/apps/packages/models.py @@ -141,6 +141,7 @@ class PackageModel(models.Model): def update_info(self, package): self.mtime =3D package.mtime self.changelog_mtime =3D package.changelog_mtime + self.changelog =3D package.changelog self.changelog_hash =3D package.changelog_sha1 self.manifest_mtime =3D package.manifest_mtime self.manifest_hash =3D package.manifest_sha1 @@ -181,8 +182,8 @@ class EbuildModel(models.Model): homepages =3D models.ManyToManyField(HomepageModel, blank =3D True) description =3D models.TextField(blank =3D True, null =3D True) =20 - eapi =3D models.PositiveSmallIntegerField(default =3D 0) - slot =3D models.PositiveSmallIntegerField(default =3D 0) + #eapi =3D models.PositiveSmallIntegerField(default =3D 0) + #slot =3D models.PositiveSmallIntegerField(default =3D 0) =20 =20 =20 diff --git a/gpackages/libs/porttree.py b/gpackages/libs/porttree.py index 8bee3dd..e1a7dcc 100644 --- a/gpackages/libs/porttree.py +++ b/gpackages/libs/porttree.py @@ -161,12 +161,13 @@ class Category(ToStrMixin): =20 class Package(ToStrMixin): =20 - __slots__ =3D ('category', 'package', '_metadata') + __slots__ =3D ('category', 'package', '_metadata', '_changelog') =20 def __init__(self, category, package): self.category =3D category self.package =3D package self._metadata =3D None + self._changelog =3D None =20 def iter_ebuilds(self): ebuilds =3D PORTDB.cp_list(self.package, mytree=3Dself.category.= porttree.porttree) @@ -205,6 +206,13 @@ class Package(ToStrMixin): changelog_mtime =3D property(_file_mtime("changelog_path")) metadata_mtime =3D property(_file_mtime("metadata_path")) =20 + @property + def changelog(self): + if self._changelog is not None: + return self._changelog + self._changelog =3D open(self.changelog_path,'r').read() + return self._changelog + =20 class Ebuild(ToStrMixin): =20 @@ -272,6 +280,8 @@ class Ebuild(ToStrMixin): homepage_val =3D property(_ebuild_environment('HOMEPAGE')) license =3D property(_ebuild_environment('LICENSE')) description =3D property(_ebuild_environment('DESCRIPTION')) + eapi =3D property(_ebuild_environment('EAPI')) + slot =3D property(_ebuild_environment('SLOT')) =20 @property def homepages(self):