Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12746 - main/trunk/pym/_emerge
Date: Wed, 04 Mar 2009 04:14:21
Message-Id: E1LeiUt-0001Yd-RW@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-03-04 04:14:18 +0000 (Wed, 04 Mar 2009)
3 New Revision: 12746
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Bug #256289 - When displaying an unsatisfied USE dep and all packages with
9 the required IUSE are masked, show a normal "masked package" message for
10 the package(s) that have the required IUSE (instead of showing the unmasked
11 packages with missing IUSE).
12
13
14 Modified: main/trunk/pym/_emerge/__init__.py
15 ===================================================================
16 --- main/trunk/pym/_emerge/__init__.py 2009-03-04 02:26:24 UTC (rev 12745)
17 +++ main/trunk/pym/_emerge/__init__.py 2009-03-04 04:14:18 UTC (rev 12746)
18 @@ -5934,6 +5934,7 @@
19 xinfo = xinfo.replace("null/", "")
20 masked_packages = []
21 missing_use = []
22 + masked_pkg_instances = set()
23 missing_licenses = []
24 have_eapi_mask = False
25 pkgsettings = self.pkgsettings[root]
26 @@ -5965,9 +5966,12 @@
27 # Filter out any such false matches here.
28 if not atom_set.findAtomForPackage(pkg):
29 continue
30 - if atom.use and not mreasons:
31 + if mreasons:
32 + masked_pkg_instances.add(pkg)
33 + if atom.use:
34 missing_use.append(pkg)
35 - continue
36 + if not mreasons:
37 + continue
38 masked_packages.append(
39 (root_config, pkgsettings, cpv, metadata, mreasons))
40
41 @@ -5997,16 +6001,28 @@
42 mreasons.append("Change USE: %s" % " ".join(changes))
43 missing_use_reasons.append((pkg, mreasons))
44
45 - if missing_iuse_reasons and not missing_use_reasons:
46 - missing_use_reasons = missing_iuse_reasons
47 - elif missing_use_reasons:
48 + unmasked_use_reasons = [(pkg, mreasons) for (pkg, mreasons) \
49 + in missing_use_reasons if pkg not in masked_pkg_instances]
50 +
51 + unmasked_iuse_reasons = [(pkg, mreasons) for (pkg, mreasons) \
52 + in missing_iuse_reasons if pkg not in masked_pkg_instances]
53 +
54 + show_missing_use = False
55 + if unmasked_use_reasons:
56 # Only show the latest version.
57 - del missing_use_reasons[1:]
58 + show_missing_use = unmasked_use_reasons[:1]
59 + elif unmasked_iuse_reasons:
60 + if missing_use_reasons:
61 + # All packages with required IUSE are masked,
62 + # so display a normal masking message.
63 + pass
64 + else:
65 + show_missing_use = unmasked_iuse_reasons
66
67 - if missing_use_reasons:
68 + if show_missing_use:
69 print "\nemerge: there are no ebuilds built with USE flags to satisfy "+green(xinfo)+"."
70 print "!!! One of the following packages is required to complete your request:"
71 - for pkg, mreasons in missing_use_reasons:
72 + for pkg, mreasons in show_missing_use:
73 print "- "+pkg.cpv+" ("+", ".join(mreasons)+")"
74
75 elif masked_packages: