Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9667 - in main/branches/prefix: . bin pym/_emerge pym/portage pym/portage/dbapi
Date: Tue, 01 Apr 2008 18:22:53
Message-Id: E1Jgl8D-0005V5-Di@stork.gentoo.org
1 Author: grobian
2 Date: 2008-04-01 18:22:48 +0000 (Tue, 01 Apr 2008)
3 New Revision: 9667
4
5 Modified:
6 main/branches/prefix/RELEASE-NOTES
7 main/branches/prefix/bin/doins
8 main/branches/prefix/bin/md5check.py
9 main/branches/prefix/bin/newins
10 main/branches/prefix/bin/repoman
11 main/branches/prefix/pym/_emerge/__init__.py
12 main/branches/prefix/pym/portage/dbapi/vartree.py
13 main/branches/prefix/pym/portage/manifest.py
14 Log:
15 Merged from trunk 9619:9637
16
17 | 9621 | Move the AUTOCLEAN code into dblink.treewalk since it's |
18 | zmedico | already partially supported there anyway (for replacement of |
19 | | identical cpv). This has the benefit of guaranteeing that |
20 | | the order of installation and removal phases is always the |
21 | | same. |
22
23 | 9623 | Bug #211365 - Use catpkgsplit() instead of pkgsplit() for a |
24 | zmedico | cpv. |
25
26 | 9625 | Bug #211365 - Use catpkgsplit() instead of pkgsplit() for a |
27 | zmedico | cpv. |
28
29 | 9628 | Make doins clean up it's own temp files. This solves an odd |
30 | zmedico | issue in dyn_package() when portage 2.1.x is installing |
31 | | portage-2.2 and temp python module files from doins are |
32 | | imported instead of the expected ones. |
33
34 | 9630 | Fix display code that can triger a 'Invalid category' |
35 | zmedico | exception when it is given a blocker. It's only supposed to |
36 | | execute for normal packages. |
37
38 | 9632 | Fix typos. Thanks to Arfrever Frehtes Taifersar Arahesis |
39 | zmedico | <Arfrever.FTA@×××××.Com>. |
40
41 | 9634 | * Fix broken return value for doins. * Make newins cleanup |
42 | zmedico | temp files after itself. |
43
44 | 9636 | Make sure the all resume lists are deleted when a stale one |
45 | zmedico | is encountered. |
46
47 | 9637 | When dblink.treewalk() queries for other packages in the |
48 | zmedico | same slot, filter out old-style virtual matches since they |
49 | | are not desired. |
50
51
52 Modified: main/branches/prefix/RELEASE-NOTES
53 ===================================================================
54 --- main/branches/prefix/RELEASE-NOTES 2008-04-01 18:13:57 UTC (rev 9666)
55 +++ main/branches/prefix/RELEASE-NOTES 2008-04-01 18:22:48 UTC (rev 9667)
56 @@ -22,7 +22,7 @@
57 used without the prefix)
58 - they may currently only include simple and versioned atoms or other sets, use
59 conditionals or any-of constructs aren't possible yet
60 - - emerge makes no difference atm wether you pass a setname or all atoms contained
61 + - emerge makes no difference atm whether you pass a setname or all atoms contained
62 in the set to it, this means that without options packages will be remerged if
63 already installed, or in the case of --unmerge all atoms in a set will be
64 unmerged even if they are depended upon by other packages. This may change in
65
66 Modified: main/branches/prefix/bin/doins
67 ===================================================================
68 --- main/branches/prefix/bin/doins 2008-04-01 18:13:57 UTC (rev 9666)
69 +++ main/branches/prefix/bin/doins 2008-04-01 18:22:48 UTC (rev 9667)
70 @@ -36,14 +36,18 @@
71 [[ ! -d ${ED}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
72
73 _doins() {
74 - local mysrc="$1" mydir="$2"
75 + local mysrc="$1" mydir="$2" cleanup="" rval
76
77 if [ -L "$mysrc" ] ; then
78 cp "$mysrc" "${T}"
79 mysrc="${T}/${mysrc##*/}"
80 + cleanup=${mysrc}
81 fi
82
83 install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}"
84 + rval=$?
85 + [[ -n ${cleanup} ]] && rm -f "${cleanup}"
86 + return $rval
87 }
88
89 _xdoins() {
90 @@ -52,6 +56,8 @@
91 done
92 }
93
94 +success=0
95 +
96 for x in "$@" ; do
97 if [ -d "$x" ] ; then
98 if [ "${DOINSRECUR}" == "n" ] ; then
99 @@ -69,7 +75,10 @@
100 find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \;
101 find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins
102 popd >/dev/null
103 + ((++success))
104 else
105 - _doins "${x}"
106 + _doins "${x}" && ((++success))
107 fi
108 done
109 +
110 +[ $success -gt 0 ] && exit 0 || exit 1
111
112 Modified: main/branches/prefix/bin/md5check.py
113 ===================================================================
114 --- main/branches/prefix/bin/md5check.py 2008-04-01 18:13:57 UTC (rev 9666)
115 +++ main/branches/prefix/bin/md5check.py 2008-04-01 18:22:48 UTC (rev 9667)
116 @@ -79,7 +79,7 @@
117 if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \
118 (md5_list[mybn]["size"] != md5sums[mybn]["size"]):
119
120 - # This associates teh md5 with each file. [md5/size]
121 + # This associates the md5 with each file. [md5/size]
122 md5joins = md5_list[mybn][2].split(",")
123 md5joins = (" ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"],").join(md5joins)
124 md5joins += " ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"]"
125
126 Modified: main/branches/prefix/bin/newins
127 ===================================================================
128 --- main/branches/prefix/bin/newins 2008-04-01 18:13:57 UTC (rev 9666)
129 +++ main/branches/prefix/bin/newins 2008-04-01 18:22:48 UTC (rev 9667)
130 @@ -8,6 +8,9 @@
131 exit 1
132 fi
133
134 -rm -rf "${T}/${2}" && \
135 -cp -f "${1}" "${T}/${2}" && \
136 -exec doins "${T}/${2}"
137 +rm -rf "${T}/${2}" || exit $?
138 +cp -f "${1}" "${T}/${2}" || exit $?
139 +doins "${T}/${2}"
140 +ret=$?
141 +rm -rf "${T}/${2}"
142 +exit $ret
143
144 Modified: main/branches/prefix/bin/repoman
145 ===================================================================
146 --- main/branches/prefix/bin/repoman 2008-04-01 18:13:57 UTC (rev 9666)
147 +++ main/branches/prefix/bin/repoman 2008-04-01 18:22:48 UTC (rev 9667)
148 @@ -222,9 +222,9 @@
149
150 if opts.mode == 'commit' and not (opts.force or opts.pretend):
151 if opts.ignore_masked:
152 - parser.error('Commit mode and --ignore-masked are not compatable')
153 + parser.error('Commit mode and --ignore-masked are not compatible')
154 if opts.without_mask:
155 - parser.error('Commit mode and --without-mask are not compatable')
156 + parser.error('Commit mode and --without-mask are not compatible')
157
158 # Use the verbosity and quiet options to fiddle with the loglevel appropriately
159 for val in range(opts.verbosity):
160 @@ -1123,7 +1123,7 @@
161 fails["KEYWORDS.stupid"].append(x+"/"+y+".ebuild")
162
163 """
164 - Ebuilds that inherit a "Live" eclasss (darcs,subversion,git,cvs,etc..) should
165 + Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
166 not be allowed to be marked stable
167 """
168 if set(["darcs","cvs","subversion","git"]).intersection(
169
170 Modified: main/branches/prefix/pym/_emerge/__init__.py
171 ===================================================================
172 --- main/branches/prefix/pym/_emerge/__init__.py 2008-04-01 18:13:57 UTC (rev 9666)
173 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-04-01 18:22:48 UTC (rev 9667)
174 @@ -640,7 +640,7 @@
175 self.portdb.xmatch("match-all",match))
176 elif mtype == "desc":
177 full_package = match
178 - match = portage.pkgsplit(match)[0]
179 + match = portage.cpv_getkey(match)
180 elif mtype == "set":
181 print green("*")+" "+white(match)
182 print " ", darkgreen("Description:")+" ", self.sdict[match].getMetadata("DESCRIPTION")
183 @@ -3921,7 +3921,8 @@
184 show_repos = True
185 verboseadd += teal("[%s]" % repoadd)
186
187 - xs = list(portage.pkgsplit(x[2]))
188 + xs = [portage.cpv_getkey(pkg_key)] + \
189 + list(portage.catpkgsplit(pkg_key)[2:])
190 if xs[2] == "r0":
191 xs[2] = ""
192 else:
193 @@ -4037,23 +4038,24 @@
194 myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
195 p.append(myprint)
196
197 - mysplit = portage.pkgsplit(x[2])
198 - if "--tree" not in self.myopts and mysplit and \
199 - len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \
200 - x[1] == "/":
201 + mysplit = [portage.cpv_getkey(pkg_key)] + \
202 + list(portage.catpkgsplit(pkg_key)[2:])
203 + if "--tree" not in self.myopts and mysplit and \
204 + len(mysplit) == 3 and mysplit[0] == "sys-apps/portage" and \
205 + x[1] == "/":
206 +
207 + if mysplit[2] == "r0":
208 + myversion = mysplit[1]
209 + else:
210 + myversion = "%s-%s" % (mysplit[1], mysplit[2])
211 +
212 + if myversion != portage.VERSION and "--quiet" not in self.myopts:
213 + if mylist_index < len(mylist) - 1:
214 + p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
215 + p.append(colorize("WARN", " then resume the merge."))
216 + print
217 + del mysplit
218
219 - if mysplit[2] == "r0":
220 - myversion = mysplit[1]
221 - else:
222 - myversion = "%s-%s" % (mysplit[1], mysplit[2])
223 -
224 - if myversion != portage.VERSION and "--quiet" not in self.myopts:
225 - if mylist_index < len(mylist) - 1 and EPREFIX == BPREFIX:
226 - p.append(colorize("WARN", "*** Portage will stop merging at this point and reload itself,"))
227 - p.append(colorize("WARN", " then resume the merge."))
228 - print
229 - del mysplit
230 -
231 for x in p:
232 print x
233 for x in blockers:
234 @@ -4827,24 +4829,10 @@
235 if "--pretend" not in self.myopts and \
236 "--fetchonly" not in self.myopts and \
237 "--fetch-all-uri" not in self.myopts:
238 - # Clean the old package that we have merged over top of it.
239 - if pkgsettings.get("AUTOCLEAN", "yes") == "yes":
240 - xsplit=portage.pkgsplit(x[2])
241 - emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0])
242 - retval = unmerge(self.trees[myroot]["root_config"],
243 - self.myopts,
244 - "clean", [xsplit[0]], ldpath_mtimes, autoclean=1)
245 - if not retval:
246 - emergelog(xterm_titles,
247 - " --- AUTOCLEAN: Nothing unmerged.")
248 - else:
249 - portage.writemsg_stdout(colorize("WARN", "WARNING:")
250 - + " AUTOCLEAN is disabled. This can cause serious"
251 - + " problems due to overlapping packages.\n")
252
253 # Figure out if we need a restart.
254 - mysplit=portage.pkgsplit(x[2])
255 - if mysplit[0] == "sys-apps/portage" and x[1] == "/":
256 + if myroot == "/" and \
257 + portage.dep_getkey(pkg_key) == "sys-apps/portage":
258 if len(mymergelist) > mergecount and EPREFIX == BPREFIX:
259 emergelog(xterm_titles,
260 " ::: completed emerge ("+ \
261 @@ -6980,7 +6968,11 @@
262 out.eerror("Error: The resume list contains packages that are no longer")
263 out.eerror(" available to be emerged. Please restart/continue")
264 out.eerror(" the merge operation manually.")
265 - del mtimedb["resume"]
266 +
267 + # delete the current list and also the backup
268 + # since it's probably stale too.
269 + for k in ("resume", "resume_backup"):
270 + mtimedb.pop(k, None)
271 mtimedb.commit()
272 return 1
273 if show_spinner:
274
275 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
276 ===================================================================
277 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-04-01 18:13:57 UTC (rev 9666)
278 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-04-01 18:22:48 UTC (rev 9667)
279 @@ -21,7 +21,7 @@
280
281 from portage import listdir, dep_expand, flatten, key_expand, \
282 doebuild_environment, doebuild, env_update, prepare_build_dirs, \
283 - abssymlink, movefile, _movefile, bsd_chflags
284 + abssymlink, movefile, _movefile, bsd_chflags, cpv_getkey
285
286 from portage.elog import elog_process
287 from portage.elog.messages import ewarn
288 @@ -1871,8 +1871,11 @@
289 for v in self.vartree.dbapi.cp_list(self.mysplit[0]):
290 otherversions.append(v.split("/")[1])
291
292 - slot_matches = self.vartree.dbapi.match(
293 - "%s:%s" % (self.mysplit[0], slot))
294 + # filter any old-style virtual matches
295 + slot_matches = [cpv for cpv in self.vartree.dbapi.match(
296 + "%s:%s" % (cpv_getkey(self.mycpv), slot)) \
297 + if cpv_getkey(cpv) == cpv_getkey(self.mycpv)]
298 +
299 if self.mycpv not in slot_matches and \
300 self.vartree.dbapi.cpv_exists(self.mycpv):
301 # handle multislot or unapplied slotmove
302 @@ -2163,11 +2166,11 @@
303 "portage" == pkgsplit(self.pkg)[0]:
304 reinstall_self = True
305
306 + autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes"
307 for dblnk in list(others_in_slot):
308 if dblnk is self:
309 continue
310 - if dblnk.mycpv != self.mycpv and \
311 - not reinstall_self:
312 + if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self):
313 continue
314 writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
315 others_in_slot.remove(dblnk) # dblnk will unmerge itself now
316 @@ -2176,9 +2179,13 @@
317 # TODO: Check status and abort if necessary.
318 dblnk.delete()
319 writemsg_stdout(">>> Original instance of package unmerged safely.\n")
320 - if not reinstall_self:
321 - break
322
323 + if len(others_in_slot) > 1:
324 + from portage.output import colorize
325 + writemsg_stdout(colorize("WARN", "WARNING:")
326 + + " AUTOCLEAN is disabled. This can cause serious"
327 + + " problems due to overlapping packages.\n")
328 +
329 # We hold both directory locks.
330 self.dbdir = self.dbpkgdir
331 self.delete()
332
333 Modified: main/branches/prefix/pym/portage/manifest.py
334 ===================================================================
335 --- main/branches/prefix/pym/portage/manifest.py 2008-04-01 18:13:57 UTC (rev 9666)
336 +++ main/branches/prefix/pym/portage/manifest.py 2008-04-01 18:22:48 UTC (rev 9667)
337 @@ -262,7 +262,7 @@
338 del self.fhashdict[ftype][fname]
339
340 def hasFile(self, ftype, fname):
341 - """ Return wether the Manifest contains an entry for the given type,filename pair """
342 + """ Return whether the Manifest contains an entry for the given type,filename pair """
343 return (fname in self.fhashdict[ftype])
344
345 def findFile(self, fname):
346
347 --
348 gentoo-commits@l.g.o mailing list