1 |
Author: zmedico |
2 |
Date: 2008-05-03 03:43:19 +0000 (Sat, 03 May 2008) |
3 |
New Revision: 10123 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Move --resume options handling to the beginning of action_build() so |
9 |
that the current options are updated with the saved options as soon |
10 |
as possible. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/_emerge/__init__.py 2008-05-03 03:28:06 UTC (rev 10122) |
16 |
+++ main/trunk/pym/_emerge/__init__.py 2008-05-03 03:43:19 UTC (rev 10123) |
17 |
@@ -7575,6 +7575,31 @@ |
18 |
|
19 |
def action_build(settings, trees, mtimedb, |
20 |
myopts, myaction, myfiles, spinner): |
21 |
+ |
22 |
+ resume = False |
23 |
+ if "--resume" in myopts and \ |
24 |
+ ("resume" in mtimedb or |
25 |
+ "resume_backup" in mtimedb): |
26 |
+ resume = True |
27 |
+ if "resume" not in mtimedb: |
28 |
+ mtimedb["resume"] = mtimedb["resume_backup"] |
29 |
+ del mtimedb["resume_backup"] |
30 |
+ mtimedb.commit() |
31 |
+ # "myopts" is a list for backward compatibility. |
32 |
+ resume_opts = mtimedb["resume"].get("myopts", []) |
33 |
+ if isinstance(resume_opts, list): |
34 |
+ resume_opts = dict((k,True) for k in resume_opts) |
35 |
+ for opt in ("--skipfirst", "--ask", "--tree"): |
36 |
+ resume_opts.pop(opt, None) |
37 |
+ myopts.update(resume_opts) |
38 |
+ # Adjust config according to options of the command being resumed. |
39 |
+ for myroot in trees: |
40 |
+ mysettings = trees[myroot]["vartree"].settings |
41 |
+ mysettings.unlock() |
42 |
+ adjust_config(myopts, mysettings) |
43 |
+ mysettings.lock() |
44 |
+ del myroot, mysettings |
45 |
+ |
46 |
ldpath_mtimes = mtimedb["ldpath"] |
47 |
favorites=[] |
48 |
merge_count = 0 |
49 |
@@ -7639,51 +7664,11 @@ |
50 |
if not show_spinner: |
51 |
spinner.update = spinner.update_quiet |
52 |
|
53 |
- if "--resume" in myopts and \ |
54 |
- ("resume" in mtimedb or |
55 |
- "resume_backup" in mtimedb): |
56 |
- if "resume" not in mtimedb: |
57 |
- mtimedb["resume"] = mtimedb["resume_backup"] |
58 |
- del mtimedb["resume_backup"] |
59 |
- mtimedb.commit() |
60 |
- |
61 |
- # Adjust config according to options of the command being resumed. |
62 |
- for myroot in trees: |
63 |
- mysettings = trees[myroot]["vartree"].settings |
64 |
- mysettings.unlock() |
65 |
- adjust_config(myopts, mysettings) |
66 |
- mysettings.lock() |
67 |
- del myroot, mysettings |
68 |
- |
69 |
+ if resume: |
70 |
favorites = mtimedb["resume"].get("favorites") |
71 |
if not isinstance(favorites, list): |
72 |
favorites = [] |
73 |
|
74 |
- # "myopts" is a list for backward compatibility. |
75 |
- resume_opts = mtimedb["resume"].get("myopts", []) |
76 |
- if isinstance(resume_opts, list): |
77 |
- resume_opts = dict((k,True) for k in resume_opts) |
78 |
- for opt in ("--skipfirst", "--ask", "--tree"): |
79 |
- resume_opts.pop(opt, None) |
80 |
- myopts.update(resume_opts) |
81 |
- |
82 |
- buildpkgonly = "--buildpkgonly" in myopts |
83 |
- pretend = "--pretend" in myopts |
84 |
- fetchonly = "--fetchonly" in myopts or "--fetch-all-uri" in myopts |
85 |
- ask = "--ask" in myopts |
86 |
- nodeps = "--nodeps" in myopts |
87 |
- tree = "--tree" in myopts |
88 |
- if nodeps and tree: |
89 |
- tree = False |
90 |
- del myopts["--tree"] |
91 |
- portage.writemsg(colorize("WARN", " * ") + \ |
92 |
- "--tree is broken with --nodeps. Disabling...\n") |
93 |
- verbose = "--verbose" in myopts |
94 |
- quiet = "--quiet" in myopts |
95 |
- if pretend or fetchonly: |
96 |
- # make the mtimedb readonly |
97 |
- mtimedb.filename = None |
98 |
- |
99 |
if show_spinner: |
100 |
print "Calculating dependencies ", |
101 |
myparams = create_depgraph_params(myopts, myaction) |
102 |
|
103 |
-- |
104 |
gentoo-commits@l.g.o mailing list |