1 |
Author: zmedico |
2 |
Date: 2009-07-30 20:48:08 +0000 (Thu, 30 Jul 2009) |
3 |
New Revision: 13859 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/actions.py |
7 |
main/trunk/pym/portage/util.py |
8 |
Log: |
9 |
Rename get_updated_config_files() to find_updated_config_files() and make |
10 |
it an iterator of tuples. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/actions.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/actions.py 2009-07-30 20:36:02 UTC (rev 13858) |
16 |
+++ main/trunk/pym/_emerge/actions.py 2009-07-30 20:48:08 UTC (rev 13859) |
17 |
@@ -2610,7 +2610,8 @@ |
18 |
return settings, trees, mtimedb |
19 |
|
20 |
def chk_updated_cfg_files(target_root, config_protect): |
21 |
- result = portage.util.get_updated_config_files(target_root, config_protect) |
22 |
+ result = list( |
23 |
+ portage.util.find_updated_config_files(target_root, config_protect)) |
24 |
|
25 |
for x in result: |
26 |
print "\n"+colorize("WARN", " * IMPORTANT:"), |
27 |
@@ -2619,7 +2620,7 @@ |
28 |
else: # it's a protected dir |
29 |
print "%d config files in '%s' need updating." % (len(x[1]), x[0]) |
30 |
|
31 |
- if result != []: |
32 |
+ if result: |
33 |
print " "+yellow("*")+" See the "+colorize("INFORM","CONFIGURATION FILES")\ |
34 |
+ " section of the " + bold("emerge") |
35 |
print " "+yellow("*")+" man page to learn how to update config files." |
36 |
|
37 |
Modified: main/trunk/pym/portage/util.py |
38 |
=================================================================== |
39 |
--- main/trunk/pym/portage/util.py 2009-07-30 20:36:02 UTC (rev 13858) |
40 |
+++ main/trunk/pym/portage/util.py 2009-07-30 20:48:08 UTC (rev 13859) |
41 |
@@ -5,7 +5,7 @@ |
42 |
__all__ = ['apply_permissions', 'apply_recursive_permissions', |
43 |
'apply_secpass_permissions', 'apply_stat_permissions', 'atomic_ofstream', |
44 |
'cmp_sort_key', 'ConfigProtect', 'dump_traceback', 'ensure_dirs', |
45 |
- 'getconfig', 'getlibpaths', 'get_updated_config_files' 'grabdict', |
46 |
+ 'find_updated_config_files', 'getconfig', 'getlibpaths', 'grabdict', |
47 |
'grabdict_package', 'grabfile', 'grabfile_package', 'grablines', |
48 |
'initialize_logger', 'LazyItemsDict', 'map_dictlist_vals', |
49 |
'new_protect_filename', 'normalize_path', 'pickle_read', 'stack_dictlist', |
50 |
@@ -1291,7 +1291,7 @@ |
51 |
return old_pfile |
52 |
return new_pfile |
53 |
|
54 |
-def get_updated_config_files(target_root, config_protect): |
55 |
+def find_updated_config_files(target_root, config_protect): |
56 |
""" |
57 |
Return a list of configuration files that needs to be updated. |
58 |
The list contains tuple organized like this: |
59 |
@@ -1301,8 +1301,6 @@ |
60 |
If no configuration files needs to be updated, [] is returned |
61 |
""" |
62 |
|
63 |
- rval = [] |
64 |
- |
65 |
if config_protect: |
66 |
# directories with some protect files in them |
67 |
for x in config_protect: |
68 |
@@ -1342,12 +1340,10 @@ |
69 |
del files[-1] |
70 |
if files: |
71 |
if stat.S_ISDIR(mymode): |
72 |
- rval.append([x, files]) |
73 |
+ yield (x, files) |
74 |
else: |
75 |
- rval.append([x, None]) |
76 |
+ yield (x, None) |
77 |
|
78 |
- return rval |
79 |
- |
80 |
def getlibpaths(root): |
81 |
""" Return a list of paths that are used for library lookups """ |