1 |
Author: zmedico |
2 |
Date: 2009-06-25 19:41:48 +0000 (Thu, 25 Jun 2009) |
3 |
New Revision: 13694 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/__init__.py |
7 |
Log: |
8 |
Make config.regenerate() detect api-level updates to ACCEPT_LICENSE, for use |
9 |
in implementing the "free" filter for the packagekit backend. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/__init__.py 2009-06-25 06:35:25 UTC (rev 13693) |
15 |
+++ main/trunk/pym/portage/__init__.py 2009-06-25 19:41:48 UTC (rev 13694) |
16 |
@@ -1202,6 +1202,7 @@ |
17 |
self.uvlist = [] |
18 |
self._accept_chost_re = None |
19 |
self._accept_license = None |
20 |
+ self._accept_license_str = None |
21 |
|
22 |
self.virtuals = {} |
23 |
self.virts_p = {} |
24 |
@@ -2860,17 +2861,19 @@ |
25 |
# ACCEPT_LICENSE is a lazily evaluated incremental, so that * can be |
26 |
# used to match all licenses without every having to explicitly expand |
27 |
# it to all licenses. |
28 |
- if self._accept_license is None: |
29 |
- if self.local_config: |
30 |
- mysplit = [] |
31 |
- for curdb in mydbs: |
32 |
- mysplit.extend(curdb.get('ACCEPT_LICENSE', '').split()) |
33 |
- if mysplit: |
34 |
- self.configlist[-1]['ACCEPT_LICENSE'] = ' '.join(mysplit) |
35 |
+ if self.local_config: |
36 |
+ mysplit = [] |
37 |
+ for curdb in mydbs: |
38 |
+ mysplit.extend(curdb.get('ACCEPT_LICENSE', '').split()) |
39 |
+ accept_license_str = ' '.join(mysplit) |
40 |
+ if accept_license_str: |
41 |
+ self.configlist[-1]['ACCEPT_LICENSE'] = accept_license_str |
42 |
+ if accept_license_str != self._accept_license_str: |
43 |
+ self._accept_license_str = accept_license_str |
44 |
self._accept_license = tuple(self.expandLicenseTokens(mysplit)) |
45 |
- else: |
46 |
- # repoman will accept any license |
47 |
- self._accept_license = () |
48 |
+ else: |
49 |
+ # repoman will accept any license |
50 |
+ self._accept_license = () |
51 |
|
52 |
for mykey in myincrementals: |