From 07a674c8daadbaa11b6b3eb76c8c6be9fd5e305a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 25 Jun 2009 19:41:48 +0000 Subject: 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 --- pym/portage/__init__.py | 23 +++++++++++++---------- 1 file 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: -- cgit v1.2.3-1-g7c22