From fdc8ab4222e781544cba285564b5bb368b9734a1 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Mon, 14 May 2007 19:30:24 +0000 Subject: added the display of the masking reason --- portato/backend/package.py | 6 ++++++ portato/backend/portage/package.py | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'portato/backend') diff --git a/portato/backend/package.py b/portato/backend/package.py index 59d552b..b32268f 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.py @@ -283,6 +283,12 @@ class Package: @rtype: boolean""" raise NotImplementedError + + def get_masking_reason (self): + """Returns the reason for masking the package. If this is not possible for the system, return None. + + @returns: the reason for masking the package + @rtype: string""" def get_all_use_flags (self, installed = False): """Returns a list of _all_ useflags for this package, i.e. all useflags you can set for this package. diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py index e39dbe2..9f40137 100644 --- a/portato/backend/portage/package.py +++ b/portato/backend/portage/package.py @@ -112,6 +112,14 @@ class PortagePackage (Package): return False + def get_masking_reason(self): + reason = portage.getmaskingreason(self.get_cpv(), settings = self._settings.settings) + + if reason: + return reason[:-1] # strip of last \n + else: + return reason + def get_all_use_flags (self, installed = False): if installed or not self.is_in_system(): tree = self._settings.vartree -- cgit v1.2.3-70-g09d2