From 1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Thu, 5 Oct 2006 20:29:58 +0000 Subject: Added first support for the masking stuff ... and hoping that it is going to work properly ;) --- geneticone/backend/package.py | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'geneticone/backend/package.py') diff --git a/geneticone/backend/package.py b/geneticone/backend/package.py index 20e65fd..fec346d 100644 --- a/geneticone/backend/package.py +++ b/geneticone/backend/package.py @@ -50,6 +50,29 @@ class Package (gentoolkit.Package): pkgmask = pkgmask + 2 return pkgmask + def is_masked (self): + """Returns True if either masked by package.mask or by profile. + @returns: mask-status + @rtype: boolean""" + # XXX: Better solution than string comparison? + status = flags.new_masking_status(self.get_cpv()) + if status != None: + if status == "masked": return True + elif status == "unmasked": return False + else: + debug("BUG in flags.new_masking_status. It returns "+status) + else: + status = portage.getmaskingstatus(self._cpv, settings = gentoolkit.settings) + if "profile" in status or "package.mask" in status: + return True + return False + + def set_masked (self, masking = False): + flags.set_masked(self, masked = masking) + + def remove_new_masked (self): + flags.remove_new_masked(self.get_cpv()) + def get_all_use_flags (self): """Returns a list of _all_ useflags for this package, i.e. all useflags you can set for this package. @@ -165,16 +188,6 @@ class Package (gentoolkit.Package): @rtype: string""" return self.get_category()+"/"+self.get_name() - def is_masked (self): - """Returns True if either masked by package.mask or by profile. - @returns: mask-status - @rtype: boolean""" - # XXX: Better solution than string comparison? - status = portage.getmaskingstatus(self._cpv) - if "profile" in status or "package.mask" in status: - 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". @param criterion: the criterion to match against -- cgit v1.2.3-70-g09d2