diff options
author | necoro <> | 2006-10-05 20:29:58 +0000 |
---|---|---|
committer | necoro <> | 2006-10-05 20:29:58 +0000 |
commit | 1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9 (patch) | |
tree | f6536d496e0cba2f57c92a6d281ed8b8d67fc2bc /geneticone/backend/package.py | |
parent | 7dba8ff93310e61c71b7124fad6df13bbf500b53 (diff) | |
download | portato-1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9.tar.gz portato-1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9.tar.bz2 portato-1e9ddc03e5667e5a9297508f7bec8b7f3ea46dc9.zip |
Added first support for the masking stuff ... and hoping that it is going to work properly ;)
Diffstat (limited to 'geneticone/backend/package.py')
-rw-r--r-- | geneticone/backend/package.py | 33 |
1 files changed, 23 insertions, 10 deletions
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 |