diff options
author | necoro <> | 2006-12-10 11:43:26 +0000 |
---|---|---|
committer | necoro <> | 2006-12-10 11:43:26 +0000 |
commit | 43af2d836a54146a556a5c4f06ec98e882f6aa9e (patch) | |
tree | c7fa23bf5521fd34ac61081d9976adfb21171abe /portato/backend/package.py | |
parent | e368eb59dd4f7388fe93387492ef2e12c3993129 (diff) | |
download | portato-43af2d836a54146a556a5c4f06ec98e882f6aa9e.tar.gz portato-43af2d836a54146a556a5c4f06ec98e882f6aa9e.tar.bz2 portato-43af2d836a54146a556a5c4f06ec98e882f6aa9e.zip |
used sets for flags; make newuse work completly
Diffstat (limited to '')
-rw-r--r-- | portato/backend/package.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py index fc0bd02..225c06a 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.py @@ -38,6 +38,10 @@ class Package: self._settings = settings self._settingslock = settingslock + + self.forced_flags = set() + self.forced_flags.update(self._settings.usemask) + self.forced_flags.update(self._settings.useforce) try: self._status = portage.getmaskingstatus(self.get_cpv(), settings = self._settings) @@ -151,7 +155,7 @@ class Package: else: tree = porttree - return unique_array(self.get_env_var("IUSE", tree = tree).split()) + return list(set(self.get_env_var("IUSE", tree = tree).split()).difference(self.forced_flags)) def get_installed_use_flags (self): """Returns a list of the useflags enabled at installation time. If package is not installed, it returns an empty list. @@ -160,13 +164,10 @@ class Package: @rtype: string[]""" if self.is_installed(): - uses = self.get_use_flags().split() # all set at installation time - iuses = self.get_all_use_flags() # all you can set for the package - set = [] - for u in iuses: - if u in uses: - set.append(u) - return set + uses = set(self.get_use_flags().split()) # all set at installation time + iuses = set(self.get_all_use_flags(installed=True)) # all you can set for the package + + return list(uses.intersection(iuses)) else: return [] |