diff options
author | Norbert Preining <preining@logic.at> | 2010-10-29 04:03:40 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-10-29 04:03:40 +0000 |
commit | 909c5365c11d30f855cb78d0e2c777e41e5a86c3 (patch) | |
tree | ab9bb28f3a7faeb9a6760ccad2ec26de5b2a5855 /Master/texmf | |
parent | 59773a7950983d75af04062a43e4972f71d30ff7 (diff) |
support tlmgr search --all which searches all but filenames
git-svn-id: svn://tug.org/texlive/trunk@20243 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 652b82f9231..8e68c5c1521 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -168,6 +168,7 @@ sub main { "file" => 1, "keyword" => 1, "list" => 1, + "all" => 1, "characterization" => 1, "functionality" => 1, "taxonomy" => 1 }, @@ -1234,6 +1235,7 @@ sub action_search { $search_type_nr++ if $opts{"characterization"}; $search_type_nr++ if $opts{"functionality"}; $search_type_nr++ if $opts{"keyword"}; + $search_type_nr++ if $opts{"all"}; if ($search_type_nr > 1) { tlwarn("tlmgr: please specify only one thing to search for!\n"); return; @@ -1245,8 +1247,18 @@ sub action_search { } else { $tlpdb = $localtlpdb; } - if ($opts{"taxonomy"} || $opts{"characterization"} || $opts{"functionality"} - || $opts{"keyword"}) { + my $search_characterization = + $opts{"characterization"} || $opts{"taxonomy"} || $opts{"all"}; + my $search_functionality = + $opts{"functionality"} || $opts{"taxonomy"} || $opts{"all"}; + my $search_keyword = + $opts{"keyword"} || $opts{"taxonomy"} || $opts{"all"}; + my $search_tlpdb = + $opts{"all"} || + !($opts{"taxonomy"} || $opts{"characterization"} || + $opts{"functionality"} || $opts{"keyword"}); + if ($opts{"all"} || $opts{"taxonomy"} || $opts{"characterization"} + || $opts{"functionality"} || $opts{"keyword"}) { $taxonomy = load_taxonomy_datafile(); if (!defined($taxonomy)) { tlwarn("tlmgr: Cannot load taxonomy file;", @@ -1254,19 +1266,19 @@ sub action_search { return; } if ($opts{"list"}) { - if ($opts{"keyword"} || $opts{"taxonomy"}) { + if ($search_keyword) { print "\f Keywords:\n"; for (sort keys %{$taxonomy->{'by-taxonomy'}{'keyword'}}) { print "\t$_\n"; } print "\n"; } - if ($opts{"functionality"} || $opts{"taxonomy"}) { + if ($search_functionality) { print "\f Functionalities:\n"; &walk_level_tree($taxonomy->{'by-taxonomy'}{'functionality'}, "", 0); print "\n"; } - if ($opts{"characterization"} || $opts{"taxonomy"}) { + if ($search_characterization) { # Assume all possible characterizations occur under the primary ones! print "\f Characterizations:\n"; &walk_level_tree($taxonomy->{'by-taxonomy'}{'primary'}, "", 0); @@ -1293,31 +1305,22 @@ sub action_search { next if ($pkg =~ m/\./); # the other searching is done together my $t = ""; - if ($opts{"taxonomy"}) { + if ($search_keyword) { $t = $t . join('\n', @{$taxonomy->{'by-package'}{'keyword'}{$pkg}}) if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})); - $t .= "\n"; - $t = "$t$taxonomy->{'by-package'}{'primary'}{$pkg}\n" - if (defined($taxonomy->{'by-package'}{'primary'}{$pkg})); - $t .= "\n"; - $t = "$t$taxonomy->{'by-package'}{'secondary'}{$pkg}\n" - if (defined($taxonomy->{'by-package'}{'secondary'}{$pkg})); - $t .= "\n"; - $t = $t.join('\n', @{$taxonomy->{'by-package'}{'functionality'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})); - } elsif ($opts{"keyword"}) { - $t = $t . join('\n', @{$taxonomy->{'by-package'}{'keyword'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})); - } elsif ($opts{"functionality"}) { + } + if ($search_functionality) { $t = $t.join('\n', @{$taxonomy->{'by-package'}{'functionality'}{$pkg}}) if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})); - } elsif ($opts{"characterization"}) { + } + if ($search_characterization) { $t = "$t$taxonomy->{'by-package'}{'primary'}{$pkg}\n" if (defined($taxonomy->{'by-package'}{'primary'}{$pkg})); $t = "$t$taxonomy->{'by-package'}{'secondary'}{$pkg}\n" if (defined($taxonomy->{'by-package'}{'secondary'}{$pkg})); - } else { - $t = "$pkg\n"; + } + if ($search_tlpdb) { + $t .= "$pkg\n"; $t = "$t" . $tlp->shortdesc . "\n" if (defined($tlp->shortdesc)); $t = "$t" . $tlp->longdesc . "\n" @@ -5571,6 +5574,8 @@ C<--print-arch> is a synonym. =head2 search [I<options>] --characterization I<what> +=head2 search [I<options>] --all I<what> + By default, search the names, short descriptions, and long descriptions of all locally installed packages for the argument I<what>, interpreted as a regular expression. @@ -5618,6 +5623,10 @@ List all filenames containing I<what>. Search in the corresponding taxonomy (or all) instead of the package descriptions. See L</"TAXONOMIES"> below. +=item B<--all> + +Search for package names, descriptions, and taxonomies, but not files. + =back |