diff options
author | necoro <> | 2007-02-11 01:08:43 +0000 |
---|---|---|
committer | necoro <> | 2007-02-11 01:08:43 +0000 |
commit | 9e981512aaba8804b25f14c0e1c34f4f93015a4f (patch) | |
tree | 889cccfb17f28f7600344d1ff91141133335ab4d /portato/backend | |
parent | 1d0b964184e12c8cb4fb8162ce02ffab7de62c61 (diff) | |
download | portato-9e981512aaba8804b25f14c0e1c34f4f93015a4f.tar.gz portato-9e981512aaba8804b25f14c0e1c34f4f93015a4f.tar.bz2 portato-9e981512aaba8804b25f14c0e1c34f4f93015a4f.zip |
Added method which checks, whether a use flag is enabled
Diffstat (limited to '')
-rw-r--r-- | portato/backend/package.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py index d4eff19..056d54c 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.py @@ -218,6 +218,28 @@ class Package: flags.remove_new_use_flags(self) + def is_use_flag_enabled (self, flag): + """Looks whether a given useflag is enabled for the package, taking all options + (ie. even the new flags) into account. + + @param flag: the flag to check + @type flag: string + @returns: True or False + @rtype: bool""" + + if self.is_installed() and flag in self.get_actual_use_flags(): # flags set during install + return True + + elif (not self.is_installed()) and flag in self.get_settings("USE").split() \ + and not flags.invert_use_flag(flag) in pkg.get_new_use_flags(): # flags that would be set + return True + + elif flag in self.get_new_use_flags(): + return True + + else: + return False + def get_matched_dep_packages (self, depvar): """This function looks for all dependencies which are resolved. In normal case it makes only sense for installed packages, but should work for uninstalled ones too. |