1 |
Author: grobian |
2 |
Date: 2010-02-28 14:11:50 +0000 (Sun, 28 Feb 2010) |
3 |
New Revision: 15498 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/man/emerge.1 |
7 |
main/branches/prefix/pym/_emerge/actions.py |
8 |
main/branches/prefix/pym/_emerge/help.py |
9 |
main/branches/prefix/pym/_emerge/main.py |
10 |
main/branches/prefix/pym/portage/_global_updates.py |
11 |
main/branches/prefix/pym/portage/dbapi/bintree.py |
12 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
13 |
Log: |
14 |
Merged from trunk -r15477:15489 |
15 |
|
16 |
| 15486 | Add a --quiet-unmerge-warn option to disable the warning | |
17 |
| zmedico | message that's shown prior to --unmerge actions. Thanks to | |
18 |
| | Thomas Sachau <tommy@g.o> for the suggestion. | |
19 |
|
20 |
| 15487 | Make _global_updates ensure that the binarytree is only | |
21 |
| zmedico | populated with local packages (getbinpkgs=0), and fix | |
22 |
| | binarytree.populate() to behave properly when called more | |
23 |
| | than once. | |
24 |
|
25 |
| 15488 | Make bindbapi override cpv_inject and cpv_remove, for | |
26 |
| zmedico | deleting stale values from self._aux_cache. Also, add a | |
27 |
| | comment about stale cache handling inside aux_update. | |
28 |
|
29 |
| 15489 | Fix vardbapi.move_ent and aux_update to clear relevant | |
30 |
| zmedico | caches. | |
31 |
|
32 |
|
33 |
Modified: main/branches/prefix/man/emerge.1 |
34 |
=================================================================== |
35 |
--- main/branches/prefix/man/emerge.1 2010-02-28 11:31:45 UTC (rev 15497) |
36 |
+++ main/branches/prefix/man/emerge.1 2010-02-28 14:11:50 UTC (rev 15498) |
37 |
@@ -477,6 +477,12 @@ |
38 |
Redirect all build output to logs alone, and do not |
39 |
display it on stdout. |
40 |
.TP |
41 |
+.BR \-\-quiet\-unmerge\-warn |
42 |
+Disable the warning message that's shown prior to |
43 |
+\fB\-\-unmerge\fR actions. This option is intended |
44 |
+to be set in the \fBmake.conf\fR(5) |
45 |
+\fBEMERGE_DEFAULT_OPTS\fR variable. |
46 |
+.TP |
47 |
.BR "\-\-rebuilt\-binaries[=n]" |
48 |
Replace installed packages with binary packages that have |
49 |
been rebuilt. Rebuilds are detected by comparison of |
50 |
|
51 |
Modified: main/branches/prefix/pym/_emerge/actions.py |
52 |
=================================================================== |
53 |
--- main/branches/prefix/pym/_emerge/actions.py 2010-02-28 11:31:45 UTC (rev 15497) |
54 |
+++ main/branches/prefix/pym/_emerge/actions.py 2010-02-28 14:11:50 UTC (rev 15498) |
55 |
@@ -2330,7 +2330,9 @@ |
56 |
if files and not valid_atoms: |
57 |
return 1 |
58 |
|
59 |
- if action == 'unmerge' and '--quiet' not in opts: |
60 |
+ if action == 'unmerge' and \ |
61 |
+ '--quiet' not in opts and \ |
62 |
+ '--quiet-unmerge-warn' not in opts: |
63 |
msg = "This action can remove important packages! " + \ |
64 |
"In order to be safer, use " + \ |
65 |
"`emerge -pv --depclean <atom>` to check for " + \ |
66 |
|
67 |
Modified: main/branches/prefix/pym/_emerge/help.py |
68 |
=================================================================== |
69 |
--- main/branches/prefix/pym/_emerge/help.py 2010-02-28 11:31:45 UTC (rev 15497) |
70 |
+++ main/branches/prefix/pym/_emerge/help.py 2010-02-28 14:11:50 UTC (rev 15498) |
71 |
@@ -506,6 +506,14 @@ |
72 |
for line in wrap(desc, desc_width): |
73 |
print(desc_indent + line) |
74 |
print() |
75 |
+ print(" "+green("--quiet-unmerge-warn")) |
76 |
+ desc = "Disable the warning message that's shown prior to " + \ |
77 |
+ "--unmerge actions. This option is intended " + \ |
78 |
+ "to be set in the make.conf(5) " + \ |
79 |
+ "EMERGE_DEFAULT_OPTS variable." |
80 |
+ for line in wrap(desc, desc_width): |
81 |
+ print(desc_indent + line) |
82 |
+ print() |
83 |
print(" "+green("--rebuilt-binaries") + "[=%s]" % turquoise("n")) |
84 |
desc = "Replace installed packages with binary packages that have " + \ |
85 |
"been rebuilt. Rebuilds are detected by comparison of " + \ |
86 |
|
87 |
Modified: main/branches/prefix/pym/_emerge/main.py |
88 |
=================================================================== |
89 |
--- main/branches/prefix/pym/_emerge/main.py 2010-02-28 11:31:45 UTC (rev 15497) |
90 |
+++ main/branches/prefix/pym/_emerge/main.py 2010-02-28 14:11:50 UTC (rev 15498) |
91 |
@@ -70,6 +70,7 @@ |
92 |
"--onlydeps", "--pretend", |
93 |
"--quiet", |
94 |
"--quiet-build", |
95 |
+"--quiet-unmerge-warn", |
96 |
"--resume", |
97 |
"--searchdesc", |
98 |
"--skipfirst", |
99 |
|
100 |
Modified: main/branches/prefix/pym/portage/_global_updates.py |
101 |
=================================================================== |
102 |
--- main/branches/prefix/pym/portage/_global_updates.py 2010-02-28 11:31:45 UTC (rev 15497) |
103 |
+++ main/branches/prefix/pym/portage/_global_updates.py 2010-02-28 14:11:50 UTC (rev 15498) |
104 |
@@ -94,6 +94,10 @@ |
105 |
bindb = trees["/"]["bintree"].dbapi |
106 |
if not os.access(bindb.bintree.pkgdir, os.W_OK): |
107 |
bindb = None |
108 |
+ else: |
109 |
+ # Call binarytree.populate(), since we want to make sure it's |
110 |
+ # only populated with local packages here (getbinpkgs=0). |
111 |
+ bindb.bintree.populate() |
112 |
for update_cmd in myupd: |
113 |
if update_cmd[0] == "move": |
114 |
moves = vardb.move_ent(update_cmd) |
115 |
|
116 |
Modified: main/branches/prefix/pym/portage/dbapi/bintree.py |
117 |
=================================================================== |
118 |
--- main/branches/prefix/pym/portage/dbapi/bintree.py 2010-02-28 11:31:45 UTC (rev 15497) |
119 |
+++ main/branches/prefix/pym/portage/dbapi/bintree.py 2010-02-28 14:11:50 UTC (rev 15498) |
120 |
@@ -67,6 +67,14 @@ |
121 |
self.bintree.populate() |
122 |
return fakedbapi.match(self, *pargs, **kwargs) |
123 |
|
124 |
+ def cpv_inject(self, cpv, **kwargs): |
125 |
+ self._aux_cache.pop(cpv, None) |
126 |
+ fakedbapi.cpv_inject(cpv, **kwargs) |
127 |
+ |
128 |
+ def cpv_remove(self, cpv): |
129 |
+ self._aux_cache.pop(cpv, None) |
130 |
+ fakedbapi.cpv_remove(cpv) |
131 |
+ |
132 |
def aux_get(self, mycpv, wants): |
133 |
if self.bintree and not self.bintree.populated: |
134 |
self.bintree.populate() |
135 |
@@ -137,6 +145,7 @@ |
136 |
if not v: |
137 |
del mydata[k] |
138 |
mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata)) |
139 |
+ # inject will clear stale caches via cpv_inject. |
140 |
self.bintree.inject(cpv) |
141 |
|
142 |
def cp_list(self, *pargs, **kwargs): |
143 |
@@ -485,6 +494,13 @@ |
144 |
if (not os.path.isdir(self.pkgdir) and not getbinpkgs): |
145 |
return 0 |
146 |
|
147 |
+ # Clear all caches in case populate is called multiple times |
148 |
+ # as may be the case when _global_updates calls populate() |
149 |
+ # prior to performing package moves since it only wants to |
150 |
+ # operate on local packages (getbinpkgs=0). |
151 |
+ self._remotepkgs = None |
152 |
+ self.dbapi._clear_cache() |
153 |
+ self.dbapi._aux_cache.clear() |
154 |
if True: |
155 |
pkg_paths = {} |
156 |
self._pkg_paths = pkg_paths |
157 |
@@ -696,10 +712,7 @@ |
158 |
writemsg(_("!!! PORTAGE_BINHOST unset, but use is requested.\n"), |
159 |
noiselevel=-1) |
160 |
|
161 |
- if getbinpkgs and \ |
162 |
- "PORTAGE_BINHOST" in self.settings and \ |
163 |
- not self._remotepkgs: |
164 |
- |
165 |
+ if getbinpkgs and 'PORTAGE_BINHOST' in self.settings: |
166 |
base_url = self.settings["PORTAGE_BINHOST"] |
167 |
from portage.const import CACHE_PATH |
168 |
try: |
169 |
@@ -916,7 +929,6 @@ |
170 |
return |
171 |
slot = slot.strip() |
172 |
self.dbapi.cpv_inject(cpv) |
173 |
- self.dbapi._aux_cache.pop(cpv, None) |
174 |
|
175 |
# Reread the Packages index (in case it's been changed by another |
176 |
# process) and then updated it, all while holding a lock. |
177 |
|
178 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
179 |
=================================================================== |
180 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-28 11:31:45 UTC (rev 15497) |
181 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2010-02-28 14:11:50 UTC (rev 15498) |
182 |
@@ -1940,6 +1940,8 @@ |
183 |
#dest already exists; keep this puppy where it is. |
184 |
continue |
185 |
_movefile(origpath, newpath, mysettings=self.settings) |
186 |
+ self._clear_pkg_cache(self._dblink(mycpv)) |
187 |
+ self._clear_pkg_cache(self._dblink(mynewcpv)) |
188 |
|
189 |
# We need to rename the ebuild now. |
190 |
old_pf = catsplit(mycpv)[1] |
191 |
@@ -2336,6 +2338,7 @@ |
192 |
treetype="vartree", vartree=self.vartree) |
193 |
if not mylink.exists(): |
194 |
raise KeyError(cpv) |
195 |
+ self._clear_pkg_cache(mylink) |
196 |
for k, v in values.items(): |
197 |
if v: |
198 |
mylink.setfile(k, v) |