summaryrefslogtreecommitdiff
path: root/portato/backend
diff options
context:
space:
mode:
Diffstat (limited to 'portato/backend')
-rw-r--r--portato/backend/package.py22
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.
5f3e29880cfa&follow=1'>Improve the C modulesRené 'Necoro' Neumann3-37/+52 2010-04-14Small modifications made to the French translation (typos, grammar).Clement Bourgeois1-69/+69 2010-04-14Fixed the unicode support and stuff ... and also made eix faster :)René 'Necoro' Neumann1-20/+22 2010-04-14Disable debug messages by defaultRené 'Necoro' Neumann1-1/+1 2010-04-13Better eix error inheritance and handlingRené 'Necoro' Neumann1-2/+9 2010-04-13Fix the handling of FilterSets. Fixes bug #558887.René 'Necoro' Neumann2-56/+64 Now FilterSets are a subclass of InstalledSet. And return only these packages, which are installed ... but then all of them. 2010-04-12Updated newsRené 'Necoro' Neumann1-0/+1 2010-04-13Added my name to translators list.Clement Bourgeois1-0/+1