diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-16 23:54:11 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-20 10:40:41 +0100 |
commit | 350b73f240f45cf3ae4d0f746090c9dbae039921 (patch) | |
tree | 2bde75cd34180087058aa49eb3573888c10a5cfd /meta/recipes-devtools/python | |
parent | fbec9200fd636a015d8e2d6209e01215e5465f8a (diff) | |
download | poky-350b73f240f45cf3ae4d0f746090c9dbae039921.tar.gz |
python-smartpm: Improve warnings/errors consistency
Sadly, smart is not deterministic so the same build can go down multiple different
pathways. We'd expect to see the same warnings however depending on the pathway
taken, it may or may not warn, particularly with Recommends since they're optional.
For example, where a Recommended package is available but has Conflicts, we'd expect
to see an warning that we couldn't install it. Some code paths silently hide this
(its a LOCKED_CONFLICT). We add printing of warnings for this case.
Also, if there are two compatible feeds available (e.g. i586 and core2_32), this
changes the code path from direct _install() to _pending() since there are multiple
providers. This patch adds warning handling to _pending() so we don't hit hard
failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb
on the autobuilder.
(From OE-Core rev: ab1eb2432b9a9823335450fd12476e910a95a2aa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch | 158 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python-smartpm_git.bb | 1 |
2 files changed, 159 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch new file mode 100644 index 0000000000..6e672b3321 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch | |||
@@ -0,0 +1,158 @@ | |||
1 | Sadly, smart is not deterministic so the same build can go down multiple different | ||
2 | pathways. We'd expect to see the same warnings however depending on the pathway | ||
3 | taken, it may or may not warn, particularly with Recommends since they're optional. | ||
4 | |||
5 | For example, where a Recommended package is available but has Conflicts, we'd expect | ||
6 | to see an warning that we couldn't install it. Some code paths silently hide this | ||
7 | (its a LOCKED_CONFLICT). We add printing of warnings for this case. | ||
8 | |||
9 | Also, if there are two compatible feeds available (e.g. i586 and core2_32), this | ||
10 | changes the code path from direct _install() to _pending() since there are multiple | ||
11 | providers. This patch adds warning handling to _pending() so we don't hit hard | ||
12 | failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb | ||
13 | on the autobuilder. | ||
14 | |||
15 | Upstream-Status: Pending | ||
16 | RP | ||
17 | 2015/7/16 | ||
18 | |||
19 | Index: git/smart/transaction.py | ||
20 | =================================================================== | ||
21 | --- git.orig/smart/transaction.py | ||
22 | +++ git/smart/transaction.py | ||
23 | @@ -651,13 +651,14 @@ class Transaction(object): | ||
24 | |||
25 | if not prvpkgs: | ||
26 | # No packages provide it at all. Give up. | ||
27 | + | ||
28 | + reasons = [] | ||
29 | + for prv in req.providedby: | ||
30 | + for prvpkg in prv.packages: | ||
31 | + lockedres = lockedpkgs.get(prvpkg, None) | ||
32 | + if lockedres: | ||
33 | + reasons.append(lock_reason(prvpkg, lockedres)) | ||
34 | if reqrequired: | ||
35 | - reasons = [] | ||
36 | - for prv in req.providedby: | ||
37 | - for prvpkg in prv.packages: | ||
38 | - lockedres = lockedpkgs.get(prvpkg, None) | ||
39 | - if lockedres: | ||
40 | - reasons.append(lock_reason(prvpkg, lockedres)) | ||
41 | if reasons: | ||
42 | raise Failed, _("Can't install %s: unable to install provider for %s:\n %s") % \ | ||
43 | (pkg, req, '\n '.join(reasons)) | ||
44 | @@ -665,7 +666,11 @@ class Transaction(object): | ||
45 | raise Failed, _("Can't install %s: no package provides %s") % \ | ||
46 | (pkg, req) | ||
47 | else: | ||
48 | + if reasons: | ||
49 | + iface.warning(_("Can't install %s: unable to install provider for %s:\n %s") % \ | ||
50 | + (pkg, req, '\n '.join(reasons))) | ||
51 | + | ||
52 | # It's only a recommend, skip | ||
53 | continue | ||
54 | |||
55 | if len(prvpkgs) == 1: | ||
56 | @@ -846,6 +852,14 @@ class Transaction(object): | ||
57 | isinst = changeset.installed | ||
58 | getweight = self._policy.getWeight | ||
59 | |||
60 | + attempt = sysconf.has("attempt-install", soft=True) | ||
61 | + | ||
62 | + def handle_failure(msg): | ||
63 | + if attempt: | ||
64 | + iface.warning(msg) | ||
65 | + else: | ||
66 | + raise Failed, msg | ||
67 | + | ||
68 | updown = [] | ||
69 | while pending: | ||
70 | item = pending.pop(0) | ||
71 | @@ -870,8 +884,9 @@ class Transaction(object): | ||
72 | |||
73 | if not prvpkgs: | ||
74 | # No packages provide it at all. Give up. | ||
75 | - raise Failed, _("Can't install %s: no package " | ||
76 | - "provides %s") % (pkg, req) | ||
77 | + handle_failure(_("Can't install %s: no package " | ||
78 | + "provides %s") % (pkg, req)) | ||
79 | + continue | ||
80 | |||
81 | if len(prvpkgs) > 1: | ||
82 | # More than one package provide it. We use _pending here, | ||
83 | @@ -894,9 +909,10 @@ class Transaction(object): | ||
84 | keeporder, cs, lk)) | ||
85 | keeporder += 0.000001 | ||
86 | if not alternatives: | ||
87 | - raise Failed, _("Can't install %s: all packages " | ||
88 | + handle_failure(_("Can't install %s: all packages " | ||
89 | "providing %s failed to install:\n%s")\ | ||
90 | - % (pkg, req, "\n".join(failures)) | ||
91 | + % (pkg, req, "\n".join(failures))) | ||
92 | + continue | ||
93 | alternatives.sort() | ||
94 | changeset.setState(alternatives[0][1]) | ||
95 | if len(alternatives) == 1: | ||
96 | @@ -954,18 +970,20 @@ class Transaction(object): | ||
97 | |||
98 | for reqpkg in reqpkgs: | ||
99 | if reqpkg in locked and isinst(reqpkg): | ||
100 | - raise Failed, _("Can't remove %s: requiring " | ||
101 | + handle_failure(_("Can't remove %s: requiring " | ||
102 | "package %s is locked") % \ | ||
103 | - (pkg, reqpkg) | ||
104 | + (pkg, reqpkg)) | ||
105 | + continue | ||
106 | for reqpkg in reqpkgs: | ||
107 | # We check again, since other actions may have | ||
108 | # changed their state. | ||
109 | if not isinst(reqpkg): | ||
110 | continue | ||
111 | if reqpkg in locked: | ||
112 | - raise Failed, _("Can't remove %s: requiring " | ||
113 | + handle_failure(_("Can't remove %s: requiring " | ||
114 | "package %s is locked") % \ | ||
115 | - (pkg, reqpkg) | ||
116 | + (pkg, reqpkg)) | ||
117 | + continue | ||
118 | self._remove(reqpkg, changeset, locked, | ||
119 | pending, depth) | ||
120 | continue | ||
121 | @@ -978,12 +996,14 @@ class Transaction(object): | ||
122 | try: | ||
123 | for reqpkg in reqpkgs: | ||
124 | if reqpkg in locked and isinst(reqpkg): | ||
125 | - raise Failed, _("%s is locked") % reqpkg | ||
126 | + handle_failure(_("%s is locked") % reqpkg) | ||
127 | + continue | ||
128 | for reqpkg in reqpkgs: | ||
129 | if not cs.installed(reqpkg): | ||
130 | continue | ||
131 | if reqpkg in lk: | ||
132 | - raise Failed, _("%s is locked") % reqpkg | ||
133 | + handle_failure(_("%s is locked") % reqpkg) | ||
134 | + continue | ||
135 | self._remove(reqpkg, cs, lk, None, depth) | ||
136 | except Failed, e: | ||
137 | failures.append(unicode(e)) | ||
138 | @@ -991,9 +1011,10 @@ class Transaction(object): | ||
139 | alternatives.append((getweight(cs), cs, lk)) | ||
140 | |||
141 | if not alternatives: | ||
142 | - raise Failed, _("Can't install %s: all packages providing " | ||
143 | + handle_failure(_("Can't install %s: all packages providing " | ||
144 | "%s failed to install:\n%s") \ | ||
145 | - % (pkg, prv, "\n".join(failures)) | ||
146 | + % (pkg, prv, "\n".join(failures))) | ||
147 | + continue | ||
148 | |||
149 | alternatives.sort() | ||
150 | changeset.setState(alternatives[0][1]) | ||
151 | @@ -1246,6 +1267,7 @@ class Transaction(object): | ||
152 | changeset.setRequested(pkg, True) | ||
153 | except Failed, e: | ||
154 | if sysconf.has("attempt-install", soft=True): | ||
155 | + iface.warning(_("Can't install %s: %s") % (pkg, str(e))) | ||
156 | if pkg in changeset: | ||
157 | del changeset[pkg] | ||
158 | continue | ||
diff --git a/meta/recipes-devtools/python/python-smartpm_git.bb b/meta/recipes-devtools/python/python-smartpm_git.bb index 18df892b9b..163461e592 100644 --- a/meta/recipes-devtools/python/python-smartpm_git.bb +++ b/meta/recipes-devtools/python/python-smartpm_git.bb | |||
@@ -18,6 +18,7 @@ SRC_URI = "\ | |||
18 | file://smart-improve-error-reporting.patch \ | 18 | file://smart-improve-error-reporting.patch \ |
19 | file://smart-channelsdir.patch \ | 19 | file://smart-channelsdir.patch \ |
20 | file://smart-attempt.patch \ | 20 | file://smart-attempt.patch \ |
21 | file://smart-attempt-fix.patch \ | ||
21 | file://smart-rpm4-fixes.patch \ | 22 | file://smart-rpm4-fixes.patch \ |
22 | file://smart-add-for-rpm-ignoresize-check.patch \ | 23 | file://smart-add-for-rpm-ignoresize-check.patch \ |
23 | file://smart-already-installed-message.patch \ | 24 | file://smart-already-installed-message.patch \ |