Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10140 - main/branches/2.1.2/bin
Date: Sat, 03 May 2008 21:17:09
Message-Id: E1JsP6Q-0003Lc-Qw@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-03 21:17:05 +0000 (Sat, 03 May 2008)
3 New Revision: 10140
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 Log:
8 When loadResumeCommand() rejects a resume list, give a more informative
9 explanation. (trunk r10139)
10
11
12 Modified: main/branches/2.1.2/bin/emerge
13 ===================================================================
14 --- main/branches/2.1.2/bin/emerge 2008-05-03 21:08:27 UTC (rev 10139)
15 +++ main/branches/2.1.2/bin/emerge 2008-05-03 21:17:05 UTC (rev 10140)
16 @@ -4992,8 +4992,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 @@ -5063,6 +5063,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 @@ -7774,14 +7781,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 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