summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-04-28 09:10:02 -0700
committerZac Medico <zmedico@gentoo.org>2011-04-28 09:10:02 -0700
commitebb887ee7606ec2dd7b266dd3538e68b31ac3a38 (patch)
tree523dcdf1235fc6ef3dc62fb84989b217567d6b82
parenta35835dda585b128c8390ce87ec3b4ab6c8a0334 (diff)
downloadportage-ebb887ee7606ec2dd7b266dd3538e68b31ac3a38.tar.gz
portage-ebb887ee7606ec2dd7b266dd3538e68b31ac3a38.tar.bz2
portage-ebb887ee7606ec2dd7b266dd3538e68b31ac3a38.zip
emerge: add --misspell-suggestions=n option
This will fix bug #363137.
-rw-r--r--man/emerge.18
-rw-r--r--pym/_emerge/depgraph.py4
-rw-r--r--pym/_emerge/help.py9
-rw-r--r--pym/_emerge/main.py6
4 files changed, 25 insertions, 2 deletions
diff --git a/man/emerge.1 b/man/emerge.1
index 67f3e4796..56823a880 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -1,4 +1,4 @@
-.TH "EMERGE" "1" "Mar 2011" "Portage VERSION" "Portage"
+.TH "EMERGE" "1" "Apr 2011" "Portage VERSION" "Portage"
.SH "NAME"
emerge \- Command\-line interface to the Portage system
.SH "SYNOPSIS"
@@ -438,6 +438,12 @@ order to avoid excess load. See \fBmake\fR(1) for information about
analogous options that should be configured via \fBMAKEOPTS\fR in
\fBmake.conf\fR(5).
.TP
+.BR "\-\-misspell\-suggestions < y | n >"
+Enable or disable misspell suggestions. By default, emerge will show
+a list of packages with similar names when a package doesn't exist.
+The \fIEMERGE_DEFAULT_OPTS\fR variable may be used to disable this
+option by default.
+.TP
.BR "\-\-newuse " (\fB\-N\fR)
Tells emerge to include installed packages where USE
flags have changed since compilation. This option
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 84e7d24f1..7db5ae3f3 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2757,7 +2757,9 @@ class depgraph(object):
mask_docs = True
else:
writemsg_stdout("\nemerge: there are no ebuilds to satisfy "+green(xinfo)+".\n", noiselevel=-1)
- if isinstance(myparent, AtomArg):
+ if isinstance(myparent, AtomArg) and \
+ self._frozen_config.myopts.get(
+ "--misspell-suggestions", "y") != "n":
cp = myparent.atom.cp.lower()
cat, pkg = portage.catsplit(cp)
if cat == "null":
diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py
index a928a85fb..fb1e129e7 100644
--- a/pym/_emerge/help.py
+++ b/pym/_emerge/help.py
@@ -512,6 +512,15 @@ def help(myopts, havecolor=1):
for line in wrap(desc, desc_width):
print(desc_indent + line)
print()
+ print(" " + green("--misspell-suggestions") + " < %s | %s >" % \
+ (turquoise("y"), turquoise("n")))
+ desc = "Enable or disable misspell suggestions. By default, " + \
+ "emerge will show a list of packages with similar names " + \
+ "when a package doesn't exist. The EMERGE_DEFAULT_OPTS " + \
+ "variable may be used to disable this option by default"
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" "+green("--newuse")+" ("+green("-N")+" short option)")
desc = "Tells emerge to include installed packages where USE " + \
"flags have changed since compilation. This option " + \
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 6ae267f5a..82b1444c5 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -686,6 +686,12 @@ def parse_opts(tmpcmdline, silent=False):
"action" : "store"
},
+ "--misspell-suggestions": {
+ "help" : "enable package name misspell suggestions",
+ "type" : "choice",
+ "choices" : ("y", "n")
+ },
+
"--with-bdeps": {
"help":"include unnecessary build time dependencies",
"type":"choice",