1 |
Author: zmedico |
2 |
Date: 2010-02-17 05:30:40 +0000 (Wed, 17 Feb 2010) |
3 |
New Revision: 15363 |
4 |
|
5 |
Modified: |
6 |
main/trunk/cnf/sets.conf |
7 |
main/trunk/pym/_emerge/depgraph.py |
8 |
main/trunk/pym/_emerge/main.py |
9 |
main/trunk/pym/portage/sets/dbapi.py |
10 |
Log: |
11 |
Add @rebuilt-binaries set which uses BUILD_TIME to pull in binary packages |
12 |
that have a different build time from a currently installed package of the |
13 |
exact same version. |
14 |
|
15 |
|
16 |
Modified: main/trunk/cnf/sets.conf |
17 |
=================================================================== |
18 |
--- main/trunk/cnf/sets.conf 2010-02-17 03:50:39 UTC (rev 15362) |
19 |
+++ main/trunk/cnf/sets.conf 2010-02-17 05:30:40 UTC (rev 15363) |
20 |
@@ -65,6 +65,12 @@ |
21 |
world-candidate = False |
22 |
files = %(ROOT)slib/modules |
23 |
|
24 |
+# Binary packages that have a different build time from a currently |
25 |
+# installed package of the exact same version. |
26 |
+[rebuilt-binaries] |
27 |
+class = portage.sets.dbapi.RebuiltBinaries |
28 |
+world-candidate = False |
29 |
+ |
30 |
# Installed packages for which the highest visible ebuild |
31 |
# version is lower than the currently installed version. |
32 |
[downgrade] |
33 |
|
34 |
Modified: main/trunk/pym/_emerge/depgraph.py |
35 |
=================================================================== |
36 |
--- main/trunk/pym/_emerge/depgraph.py 2010-02-17 03:50:39 UTC (rev 15362) |
37 |
+++ main/trunk/pym/_emerge/depgraph.py 2010-02-17 05:30:40 UTC (rev 15363) |
38 |
@@ -229,11 +229,6 @@ |
39 |
]["vartree"].dbapi._aux_cache_keys) |
40 |
dbs.append((vardb, "installed", True, True, db_keys)) |
41 |
self._filtered_trees[myroot]["dbs"] = dbs |
42 |
- if "--usepkg" in depgraph._frozen_config.myopts: |
43 |
- depgraph._frozen_config._trees_orig[myroot |
44 |
- ]["bintree"].populate( |
45 |
- "--getbinpkg" in depgraph._frozen_config.myopts, |
46 |
- "--getbinpkgonly" in depgraph._frozen_config.myopts) |
47 |
|
48 |
class depgraph(object): |
49 |
|
50 |
|
51 |
Modified: main/trunk/pym/_emerge/main.py |
52 |
=================================================================== |
53 |
--- main/trunk/pym/_emerge/main.py 2010-02-17 03:50:39 UTC (rev 15362) |
54 |
+++ main/trunk/pym/_emerge/main.py 2010-02-17 05:30:40 UTC (rev 15363) |
55 |
@@ -1208,10 +1208,43 @@ |
56 |
config_protect_check(trees) |
57 |
check_procfs() |
58 |
|
59 |
+ if "getbinpkg" in settings.features: |
60 |
+ myopts["--getbinpkg"] = True |
61 |
+ |
62 |
+ if "--getbinpkgonly" in myopts: |
63 |
+ myopts["--getbinpkg"] = True |
64 |
+ |
65 |
+ if "--getbinpkgonly" in myopts: |
66 |
+ myopts["--usepkgonly"] = True |
67 |
+ |
68 |
+ if "--getbinpkg" in myopts: |
69 |
+ myopts["--usepkg"] = True |
70 |
+ |
71 |
+ if "--usepkgonly" in myopts: |
72 |
+ myopts["--usepkg"] = True |
73 |
+ |
74 |
+ if "buildpkg" in settings.features or "--buildpkgonly" in myopts: |
75 |
+ myopts["--buildpkg"] = True |
76 |
+ |
77 |
+ if "--buildpkgonly" in myopts: |
78 |
+ # --buildpkgonly will not merge anything, so |
79 |
+ # it cancels all binary package options. |
80 |
+ for opt in ("--getbinpkg", "--getbinpkgonly", |
81 |
+ "--usepkg", "--usepkgonly"): |
82 |
+ myopts.pop(opt, None) |
83 |
+ |
84 |
for mytrees in trees.values(): |
85 |
mydb = mytrees["porttree"].dbapi |
86 |
# Freeze the portdbapi for performance (memoize all xmatch results). |
87 |
mydb.freeze() |
88 |
+ |
89 |
+ if "--usepkg" in myopts: |
90 |
+ # Populate the bintree with current --getbinpkg setting. |
91 |
+ # This needs to happen before expand_set_arguments(), in case |
92 |
+ # any sets use the bintree. |
93 |
+ mytrees["bintree"].populate( |
94 |
+ getbinpkgs="--getbinpkg" in myopts) |
95 |
+ |
96 |
del mytrees, mydb |
97 |
|
98 |
if "moo" in myfiles: |
99 |
@@ -1270,42 +1303,12 @@ |
100 |
spinner.update = spinner.update_quiet |
101 |
portage.util.noiselimit = -1 |
102 |
|
103 |
- # Always create packages if FEATURES=buildpkg |
104 |
- # Imply --buildpkg if --buildpkgonly |
105 |
- if ("buildpkg" in settings.features) or ("--buildpkgonly" in myopts): |
106 |
- if "--buildpkg" not in myopts: |
107 |
- myopts["--buildpkg"] = True |
108 |
- |
109 |
- # Always try and fetch binary packages if FEATURES=getbinpkg |
110 |
- if ("getbinpkg" in settings.features): |
111 |
- myopts["--getbinpkg"] = True |
112 |
- |
113 |
- if "--buildpkgonly" in myopts: |
114 |
- # --buildpkgonly will not merge anything, so |
115 |
- # it cancels all binary package options. |
116 |
- for opt in ("--getbinpkg", "--getbinpkgonly", |
117 |
- "--usepkg", "--usepkgonly"): |
118 |
- myopts.pop(opt, None) |
119 |
- |
120 |
if "--fetch-all-uri" in myopts: |
121 |
myopts["--fetchonly"] = True |
122 |
|
123 |
if "--skipfirst" in myopts and "--resume" not in myopts: |
124 |
myopts["--resume"] = True |
125 |
|
126 |
- if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts): |
127 |
- myopts["--usepkgonly"] = True |
128 |
- |
129 |
- if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts): |
130 |
- myopts["--getbinpkg"] = True |
131 |
- |
132 |
- if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts): |
133 |
- myopts["--usepkg"] = True |
134 |
- |
135 |
- # Also allow -K to apply --usepkg/-k |
136 |
- if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts): |
137 |
- myopts["--usepkg"] = True |
138 |
- |
139 |
# Allow -p to remove --ask |
140 |
if "--pretend" in myopts: |
141 |
myopts.pop("--ask", None) |
142 |
|
143 |
Modified: main/trunk/pym/portage/sets/dbapi.py |
144 |
=================================================================== |
145 |
--- main/trunk/pym/portage/sets/dbapi.py 2010-02-17 03:50:39 UTC (rev 15362) |
146 |
+++ main/trunk/pym/portage/sets/dbapi.py 2010-02-17 05:30:40 UTC (rev 15363) |
147 |
@@ -21,7 +21,7 @@ |
148 |
"atoms to match all installed packages" |
149 |
_filter = None |
150 |
|
151 |
- def __init__(self, vdbapi): |
152 |
+ def __init__(self, vdbapi, **kwargs): |
153 |
super(EverythingSet, self).__init__() |
154 |
self._db = vdbapi |
155 |
|
156 |
@@ -313,3 +313,26 @@ |
157 |
return AgeSet(vardb=trees["vartree"].dbapi, mode=mode, age=age) |
158 |
|
159 |
singleBuilder = classmethod(singleBuilder) |
160 |
+ |
161 |
+class RebuiltBinaries(EverythingSet): |
162 |
+ _operations = ('merge',) |
163 |
+ _aux_keys = ('BUILD_TIME',) |
164 |
+ |
165 |
+ def __init__(self, vardb, bindb=None): |
166 |
+ super(RebuiltBinaries, self).__init__(vardb, bindb=bindb) |
167 |
+ self._bindb = bindb |
168 |
+ |
169 |
+ def _filter(self, atom): |
170 |
+ cpv = self._db.match(atom)[0] |
171 |
+ inst_build_time, = self._db.aux_get(cpv, self._aux_keys) |
172 |
+ try: |
173 |
+ bin_build_time, = self._bindb.aux_get(cpv, self._aux_keys) |
174 |
+ except KeyError: |
175 |
+ return False |
176 |
+ return inst_build_time != bin_build_time |
177 |
+ |
178 |
+ def singleBuilder(cls, options, settings, trees): |
179 |
+ return RebuiltBinaries(trees["vartree"].dbapi, |
180 |
+ bindb=trees["bintree"].dbapi) |
181 |
+ |
182 |
+ singleBuilder = classmethod(singleBuilder) |