1 |
Author: zmedico |
2 |
Date: 2008-09-13 05:53:18 +0000 (Sat, 13 Sep 2008) |
3 |
New Revision: 11508 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/__init__.py |
7 |
main/trunk/pym/portage/update.py |
8 |
Log: |
9 |
Move the world file update code out of update_config_files() since it should |
10 |
not be relative to PORTAGE_CONFIGROOT. Thanks to grobian for reporting. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/portage/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/portage/__init__.py 2008-09-13 05:34:55 UTC (rev 11507) |
16 |
+++ main/trunk/pym/portage/__init__.py 2008-09-13 05:53:18 UTC (rev 11508) |
17 |
@@ -117,7 +117,7 @@ |
18 |
import portage.eclass_cache |
19 |
from portage.localization import _ |
20 |
from portage.update import dep_transform, fixdbentries, grab_updates, \ |
21 |
- parse_updates, update_config_files, update_dbentries |
22 |
+ parse_updates, update_config_files, update_dbentries, update_dbentry |
23 |
|
24 |
# Need these functions directly in portage namespace to not break every external tool in existence |
25 |
from portage.versions import best, catpkgsplit, catsplit, pkgcmp, \ |
26 |
@@ -7069,6 +7069,7 @@ |
27 |
global secpass |
28 |
if secpass < 2 or "SANDBOX_ACTIVE" in os.environ: |
29 |
return |
30 |
+ root = "/" |
31 |
mysettings = trees["/"]["vartree"].settings |
32 |
updpath = os.path.join(mysettings["PORTDIR"], "profiles", "updates") |
33 |
|
34 |
@@ -7102,6 +7103,20 @@ |
35 |
for msg in errors: |
36 |
writemsg("%s\n" % msg, noiselevel=-1) |
37 |
|
38 |
+ world_file = os.path.join(root, WORLD_FILE) |
39 |
+ world_list = grabfile(world_file) |
40 |
+ world_modified = False |
41 |
+ for update_cmd in myupd: |
42 |
+ for pos, atom in enumerate(world_list): |
43 |
+ new_atom = update_dbentry(update_cmd, atom) |
44 |
+ if atom != new_atom: |
45 |
+ world_list[pos] = new_atom |
46 |
+ world_modified = True |
47 |
+ if world_modified: |
48 |
+ world_list.sort() |
49 |
+ write_atomic(world_file, |
50 |
+ "".join("%s\n" % (x,) for x in world_list)) |
51 |
+ |
52 |
update_config_files("/", |
53 |
mysettings.get("CONFIG_PROTECT","").split(), |
54 |
mysettings.get("CONFIG_PROTECT_MASK","").split(), |
55 |
|
56 |
Modified: main/trunk/pym/portage/update.py |
57 |
=================================================================== |
58 |
--- main/trunk/pym/portage/update.py 2008-09-13 05:34:55 UTC (rev 11507) |
59 |
+++ main/trunk/pym/portage/update.py 2008-09-13 05:53:18 UTC (rev 11508) |
60 |
@@ -177,19 +177,6 @@ |
61 |
del file_contents[x] |
62 |
continue |
63 |
|
64 |
- worldlist = grabfile(os.path.join(config_root, WORLD_FILE)) |
65 |
- modified = False |
66 |
- for update_cmd in update_iter: |
67 |
- for pos, atom in enumerate(worldlist): |
68 |
- new_atom = update_dbentry(update_cmd, atom) |
69 |
- if atom != new_atom: |
70 |
- worldlist[pos] = new_atom |
71 |
- modified = True |
72 |
- if modified: |
73 |
- worldlist.sort() |
74 |
- write_atomic(os.path.join(config_root, WORLD_FILE), |
75 |
- "\n".join(worldlist)+"\n") |
76 |
- |
77 |
# update /etc/portage/packages.* |
78 |
ignore_line_re = re.compile(r'^#|^\s*$') |
79 |
for update_cmd in update_iter: |