public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/
@ 2013-08-28 15:54 99% André Erdmann
  0 siblings, 0 replies; 1+ results
From: André Erdmann @ 2013-08-28 15:54 UTC (permalink / raw
  To: gentoo-commits

commit:     9db31e67bd33d0486a3499063a4cc0830efb7759
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Aug 28 15:51:02 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> 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 "<PackageInfo for {pkg}>".format (
          pkg=self.get (


^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-08-28 15:54 99% [gentoo-commits] proj/R_overlay:master commit in: roverlay/ André Erdmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox