summaryrefslogtreecommitdiff
path: root/geneticone/package.py
diff options
context:
space:
mode:
authornecoro <>2006-09-19 21:19:27 +0000
committernecoro <>2006-09-19 21:19:27 +0000
commit5134c7f1f86a1cb4594d3bffef7b9435ed4d3a12 (patch)
tree829dc4678711869c08215465149e55898abb382f /geneticone/package.py
parent96bb19e776bf1c4663752ba9d8194000cd2e777e (diff)
downloadportato-5134c7f1f86a1cb4594d3bffef7b9435ed4d3a12.tar.gz
portato-5134c7f1f86a1cb4594d3bffef7b9435ed4d3a12.tar.bz2
portato-5134c7f1f86a1cb4594d3bffef7b9435ed4d3a12.zip
Added licence informations.
Diffstat (limited to 'geneticone/package.py')
-rw-r--r--geneticone/package.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/geneticone/package.py b/geneticone/package.py
index 6ec2299..4e18392 100644
--- a/geneticone/package.py
+++ b/geneticone/package.py
@@ -1,5 +1,16 @@
#!/usr/bin/python
+#
+# File: geneticone/package.py
+# This file is part of the Genetic/One-Project, a graphical portage-frontend.
+#
+# Copyright (C) 2006 Necoro d.M.
+# This is free software. You may redistribute copies of it under the terms of
+# the GNU General Public License version 2.
+# There is NO WARRANTY, to the extent permitted by law.
+#
+# Written by Necoro d.M. <necoro@necoro.net>
+
from geneticone import *
import gentoolkit
@@ -10,6 +21,8 @@ class Package (gentoolkit.Package):
"""This is just a subclass of the Package-class of gentoolkit."""
def __init__ (self, cpv):
+ if isinstance(cpv, gentoolkit.Package):
+ cpv = cpv.get_cpv()
gentoolkit.Package.__init__(self, cpv)
def get_mask_status(self):
@@ -154,6 +167,13 @@ class Package (gentoolkit.Package):
return True
return False
+ def matches (self, criterion):
+ """This checks, whether this package matches a specific verisioning criterion - e.g.: "<=net-im/foobar-1.2"."""
+ if portage.match_from_list(criterion, [self.get_cpv()]) == []:
+ return False
+ else:
+ return True
+
def _parse_deps(self,deps,curuse=[],level=0):
"""Modified method "_parse_deps" of gentoolkit.Package.
Do NOT ignore blocks."""