1 |
Author: zmedico |
2 |
Date: 2008-05-03 21:08:27 +0000 (Sat, 03 May 2008) |
3 |
New Revision: 10139 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/_emerge/__init__.py |
7 |
Log: |
8 |
When loadResumeCommand() rejects a resume list, give a more informative |
9 |
explanation. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/_emerge/__init__.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/_emerge/__init__.py 2008-05-03 19:52:39 UTC (rev 10138) |
15 |
+++ main/trunk/pym/_emerge/__init__.py 2008-05-03 21:08:27 UTC (rev 10139) |
16 |
@@ -4837,8 +4837,8 @@ |
17 |
# This probably means that a required package |
18 |
# was dropped via --skipfirst. It makes the |
19 |
# resume list invalid, so convert it to a |
20 |
- # PackageNotFound exception. |
21 |
- raise portage.exception.PackageNotFound( |
22 |
+ # UnsatisfiedResumeDep exception. |
23 |
+ raise self.UnsatisfiedResumeDep( |
24 |
self._unsatisfied_deps[0].atom) |
25 |
self._serialized_tasks_cache = None |
26 |
try: |
27 |
@@ -4908,6 +4908,13 @@ |
28 |
if arg not in refs: |
29 |
refs.append(arg) |
30 |
|
31 |
+ class UnsatisfiedResumeDep(portage.exception.PortageException): |
32 |
+ """ |
33 |
+ A dependency of a resume list is not installed. This |
34 |
+ can occur when a required package is dropped from the |
35 |
+ merge list via --skipfirst. |
36 |
+ """ |
37 |
+ |
38 |
class _internal_exception(portage.exception.PortageException): |
39 |
def __init__(self, value=""): |
40 |
portage.exception.PortageException.__init__(self, value) |
41 |
@@ -7763,14 +7770,34 @@ |
42 |
success = False |
43 |
try: |
44 |
success = mydepgraph.loadResumeCommand(mtimedb["resume"]) |
45 |
- except portage.exception.PackageNotFound: |
46 |
+ except (portage.exception.PackageNotFound, |
47 |
+ mydepgraph.UnsatisfiedResumeDep), e: |
48 |
if show_spinner: |
49 |
print |
50 |
+ from textwrap import wrap |
51 |
from portage.output import EOutput |
52 |
out = EOutput() |
53 |
- out.eerror("Error: The resume list contains packages that are no longer") |
54 |
- out.eerror(" available to be emerged. Please restart/continue") |
55 |
- out.eerror(" the merge operation manually.") |
56 |
+ |
57 |
+ if isinstance(e, mydepgraph.UnsatisfiedResumeDep): |
58 |
+ out.eerror("An expected dependency " + \ |
59 |
+ "is not installed: %s" % str(e)) |
60 |
+ out.eerror("") |
61 |
+ msg = "The resume list contains packages " + \ |
62 |
+ "with dependencies that have not been " + \ |
63 |
+ "installed yet. Please restart/continue " + \ |
64 |
+ "the operation manually." |
65 |
+ for line in wrap(msg, 72): |
66 |
+ out.eerror(line) |
67 |
+ elif isinstance(e, portage.exception.PackageNotFound): |
68 |
+ out.eerror("An expected package is " + \ |
69 |
+ "not available: %s" % str(e)) |
70 |
+ out.eerror("") |
71 |
+ msg = "The resume list contains one or more " + \ |
72 |
+ "packages that are no longer " + \ |
73 |
+ "available. Please restart/continue " + \ |
74 |
+ "the operation manually." |
75 |
+ for line in wrap(msg, 72): |
76 |
+ out.eerror(line) |
77 |
else: |
78 |
if show_spinner: |
79 |
print "\b\b... done!" |
80 |
|
81 |
-- |
82 |
gentoo-commits@l.g.o mailing list |