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 BD7A01381F3 for ; Wed, 28 Aug 2013 15:54:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30961E0CD9; Wed, 28 Aug 2013 15:54:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B0461E0C38 for ; Wed, 28 Aug 2013 15:54:32 +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 99F77335E2B for ; Wed, 28 Aug 2013 15:54:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4D52DE468F for ; Wed, 28 Aug 2013 15:54:30 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1377705062.9db31e67bd33d0486a3499063a4cc0830efb7759.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/packageinfo.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 9db31e67bd33d0486a3499063a4cc0830efb7759 X-VCS-Branch: master Date: Wed, 28 Aug 2013 15:54:30 +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: 65577f59-baa8-47da-bd44-ad8b3d4a05ca X-Archives-Hash: e1087656db51653456a86fd1e43895ef commit: 9db31e67bd33d0486a3499063a4cc0830efb7759 Author: André Erdmann mailerd de> AuthorDate: Wed Aug 28 15:51:02 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Aug 28 15:51:02 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=9db31e67 packageinfo: create_vartable() creates a dict with variables like P, PN, PF, ... for "parsing" ebuilds. --- roverlay/packageinfo.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/roverlay/packageinfo.py b/roverlay/packageinfo.py index b4e38f1..a3be89b 100644 --- a/roverlay/packageinfo.py +++ b/roverlay/packageinfo.py @@ -861,6 +861,23 @@ class PackageInfo ( object ): self._use_filename ( os.path.basename ( filepath ) ) # --- end of _use_filepath (...) --- + def create_vartable ( self, category ): + PN = self._info ['name'] + PV = str ( self._info ['version'] ) + PR = str ( self._info ['rev'] ) + PVR = PV if PR == '0' else ( PV + '-' + PR ) + + return { + 'P' : PN + '-' + PV, + 'PN' : PN, + 'PV' : PV, + 'PR' : PR, + 'PVR' : PVR, + 'PF' : PN + PVR, + 'CATEGORY' : category, + } + # --- end of create_vartable (...) --- + def __str__ ( self ): return "".format ( pkg=self.get (