diff options
author | Necoro <> | 2008-01-20 01:55:36 +0000 |
---|---|---|
committer | Necoro <> | 2008-01-20 01:55:36 +0000 |
commit | 6647e99ec83e2a934346bb4ca58e93a2e216a831 (patch) | |
tree | a40ca9933e589db43595846adad58e0cefe86724 /portato/backend/package.py | |
parent | 7281cbcb12c40aa8335c2dbf0a4781ff799761a4 (diff) | |
download | portato-6647e99ec83e2a934346bb4ca58e93a2e216a831.tar.gz portato-6647e99ec83e2a934346bb4ca58e93a2e216a831.tar.bz2 portato-6647e99ec83e2a934346bb4ca58e93a2e216a831.zip |
r680@Devoty: necoro | 2008-01-20 02:53:30 +0100
Fixed flag handling
Diffstat (limited to '')
-rw-r--r-- | portato/backend/package.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py index 4f90765..16cee0e 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.py @@ -12,6 +12,7 @@ from __future__ import absolute_import +from ..helper import debug from . import _Package, system, flags class Package (_Package): @@ -96,15 +97,22 @@ class Package (_Package): @rtype: string[]""" i_flags = self.get_global_settings("USE", installed = False).split() + m_flags = system.get_global_settings("USE").split() for f in self.get_new_use_flags(): + removed = False + + if f[0] == "~": + f = f[1:] + removed = True if f[0] == '-': - if flags.invert_use_flag(f) in i_flags: + if flags.invert_use_flag(f) in i_flags and not (removed and flags.invert_use_flag(f) in m_flags): i_flags.remove(flags.invert_use_flag(f)) - + elif f not in i_flags: - i_flags.append(f) - + if not (removed and flags.invert_use_flag(f) in m_flags): + i_flags.append(f) + return i_flags def set_use_flag (self, flag): @@ -130,7 +138,7 @@ class Package (_Package): @returns: USE_EXPAND-value on success @rtype: string or None""" - if not suggest is None: + if suggest is not None: if flag.startswith(suggest.lower()): return suggest |