summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-06-25 19:41:48 +0000
committerZac Medico <zmedico@gentoo.org>2009-06-25 19:41:48 +0000
commit07a674c8daadbaa11b6b3eb76c8c6be9fd5e305a (patch)
treed4d1ba19298604026f9d6109001182876c96802c
parent2c5986b35f24c235a518aefa4ba3e5fed5cadd77 (diff)
downloadportage-07a674c8daadbaa11b6b3eb76c8c6be9fd5e305a.tar.gz
portage-07a674c8daadbaa11b6b3eb76c8c6be9fd5e305a.tar.bz2
portage-07a674c8daadbaa11b6b3eb76c8c6be9fd5e305a.zip
Make config.regenerate() detect api-level updates to ACCEPT_LICENSE, for use
in implementing the "free" filter for the packagekit backend. svn path=/main/trunk/; revision=13694
-rw-r--r--pym/portage/__init__.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 62af949ad..41da40cf7 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1202,6 +1202,7 @@ class config(object):
self.uvlist = []
self._accept_chost_re = None
self._accept_license = None
+ self._accept_license_str = None
self.virtuals = {}
self.virts_p = {}
@@ -2860,17 +2861,19 @@ class config(object):
# ACCEPT_LICENSE is a lazily evaluated incremental, so that * can be
# used to match all licenses without every having to explicitly expand
# it to all licenses.
- if self._accept_license is None:
- if self.local_config:
- mysplit = []
- for curdb in mydbs:
- mysplit.extend(curdb.get('ACCEPT_LICENSE', '').split())
- if mysplit:
- self.configlist[-1]['ACCEPT_LICENSE'] = ' '.join(mysplit)
+ if self.local_config:
+ mysplit = []
+ for curdb in mydbs:
+ mysplit.extend(curdb.get('ACCEPT_LICENSE', '').split())
+ accept_license_str = ' '.join(mysplit)
+ if accept_license_str:
+ self.configlist[-1]['ACCEPT_LICENSE'] = accept_license_str
+ if accept_license_str != self._accept_license_str:
+ self._accept_license_str = accept_license_str
self._accept_license = tuple(self.expandLicenseTokens(mysplit))
- else:
- # repoman will accept any license
- self._accept_license = ()
+ else:
+ # repoman will accept any license
+ self._accept_license = ()
for mykey in myincrementals: