"includeOverlayTree": 0,
"includeMasked": 1,
"regex": 0,
+ "exact": 0,
"duplicates": 0
}
opts["includeMasked"] = 0
elif x in ["-f", "--full-regex"]:
opts["regex"] = 1
+ opts["exact"] = 1
+ elif x in ["-e", "--exact-name"]:
+ opts["exact"] = 1
elif x in ["-d", "--duplicates"]:
opts["duplicates"] = 1
else:
# replace empty strings with .* and escape regular expression syntax
if query != "":
if not opts["regex"]:
- filter_fn = lambda x: (cat+"/"+name in x)
- matches = package_finder(filter_fn)
cat, name, ver, rev = [re.sub('^$', ".*", re.escape(x)) for x in cat, name, ver, rev]
else:
cat, name, ver, rev = [re.sub('^$', ".*", x) for x in cat, name, ver, rev]
- try:
+
+ try:
+ if opts["exact"]:
filter_fn = lambda x: re.match(cat+"/"+name, x)
- matches = package_finder(filter_fn)
- except:
- die(2, "The query '" + pp.regexpquery(query) + "' does not appear to be a valid regular expression")
+ else:
+ filter_fn = lambda x: re.match(cat+"/.*"+name, x)
+ matches = package_finder(filter_fn)
+ except:
+ die(2, "The query '" + pp.regexpquery(query) + "' does not appear to be a valid regular expression")
else:
cat, name, ver, rev = [re.sub('^$', ".*", x) for x in cat, name, ver, rev]
filter_fn = lambda x: True
if ver == ".*": ver = "[0-9]+[^-]*"
if rev != ".*": # revision supplied
- rx = re.compile(cat + "/" + name + "-" + ver + "-" + rev)
- else:
+ ver = ver + "-" + rev
+
+ if opts["exact"]:
rx = re.compile(cat + "/" + name + "-" + ver)
+ else:
+ rx = re.compile(cat + "/.*" + name + ".*-" + ver)
if opts["includeInstalled"]:
self._print_installed(matches, rx)
" " + pp.localoption("-p, --portage-tree") + " - also search in portage tree (" + gentoolkit.settings["PORTDIR"] + ")\n" + \
" " + pp.localoption("-o, --overlay-tree") + " - also search in overlay tree (" + gentoolkit.settings["PORTDIR_OVERLAY"] + ")\n" + \
" " + pp.localoption("-f, --full-regex") + " - query is a regular expression\n" + \
+ " " + pp.localoption("-e, --exact-name") + " - list only those packages that exactly match\n" + \
" " + pp.localoption("-d, --duplicates") + " - list only installed duplicate packages\n"
class CmdFindUSEs(Command):
.B list <local\-opts> pkgspec
This command lists packages matching pkgspec in a user\-specified combination
of installed packages, packages which are not installed, the portage tree, and
-the portage overlay tree.
+the portage overlay tree. By default the list command searches for partial name matches.
<local\-opts> \-I cannot be used by itself;
if \-I is used, \-p and/or \-o must be also be present. By default, only installed
packages are searched. \-o searches only the overlay tree [and possibly
installed packages],
-.I not
-the main portage tree.
+\fInot\fR the main portage tree.
.B \-i, \-\-installed
search installed packages (default)
.B \-f, \-\-full\-regex
query is a regular expression
.br
+.B \-e, \-\-exact\-name
+list only those packages that exactly match
+.br
.B \-d, \-\-duplicates
only list installed duplicate packages
+.br
+
+\fBExamples:\fR
+
+equery list zilla \- list all installed versions of packages containing the string 'zilla'
+
+equery list \-\-exact\-name x11\-libs/gtk+ \- list all installed versions of x11\-libs/gtk+
+
+equery list \-\-full\-regex '(mozilla\-firefox|mozilla\-thunderbird)' \- list all installed versions of mozilla\-firefox and mozilla\-thunderbird
+
+equery list \-\-duplicates \- list all installed slotted packages
.PP
-.TP
.B size <local\-opts> pkgspec
This command outputs the number of files in the specified package, as well as
their total size in an appropriate unit.