diff options
author | Karl Berry <karl@freefriends.org> | 2014-12-16 19:03:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-12-16 19:03:03 +0000 |
commit | 1abeb648c1e8b4983df4b25b61c87b4bba4b5e1d (patch) | |
tree | 043406a0da8b291c0cad57bf6d0652614725b759 /Master/texmf-dist/scripts | |
parent | 97f8439b082e70bd39e12bb467dcc934a0342cbb (diff) |
remove taxonomy support, since the data is no longer being updated (but do not remove the actual texcatalogue.keywords file yet, until some testing is done)
git-svn-id: svn://tug.org/texlive/trunk@35840 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 320 | ||||
-rw-r--r-- | Master/texmf-dist/scripts/texlive/tlmgrgui.pl | 53 |
2 files changed, 34 insertions, 339 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index a6da8eb001f..91b21bca056 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -187,17 +187,8 @@ sub main { "search" => { "global" => 1, "word" => 1, "file" => 1, - "keyword" => 1, - "list" => 1, - "all" => 1, - "characterization" => 1, - "functionality" => 1, - "taxonomy" => 1 }, + "all" => 1, }, "info" => { "list" => 1, - "taxonomy" => 1, - "keyword" => 1, - "characterization" => 1, - "functionality" => 1, "only-installed" => 1 }, "dump-tlpdb" => { "local" => 1, "remote" => 1 }, @@ -1191,15 +1182,7 @@ sub action_dumptlpdb { # sub action_info { init_local_db(); - my $taxonomy; - if ($opts{"taxonomy"} || $opts{"characterization"} || $opts{"functionality"} - || $opts{"keyword"}) { - $taxonomy = load_taxonomy_datafile(); - if (!defined($taxonomy)) { - tlwarn("$prg: Cannot load taxonomy file, showing taxonomies not supported.\n"); - } - } - my ($what, @todo) = @ARGV; + my ($what,@todo) = @ARGV; # # tlmgr info # tlmgr info collection @@ -1213,7 +1196,7 @@ sub action_info { # we are still here, so $what is defined and neither collection nor scheme, # so assume the arguments are package names foreach my $ppp ($what, @todo) { - my ($pkg, $tag) = split '@', $ppp, 2; + my ($pkg, $tag) = split ('@', $ppp, 2); my $tlpdb = $localtlpdb; my $source_found; my $tlp = $localtlpdb->get_package($pkg); @@ -1365,36 +1348,6 @@ sub action_info { print "cat-license: ", $tlp->cataloguedata->{'license'}, "\n" if $tlp->cataloguedata->{'license'}; print "collection: ", @colls, "\n" if (@colls); - if ($opts{"keyword"} || $opts{"taxonomy"}) { - print "keywords: "; - if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})) { - print join(', ',@{$taxonomy->{'by-package'}{'keyword'}{$pkg}}), "\n"; - } else { - print "(none found)\n"; - } - } - if ($opts{"functionality"} || $opts{"taxonomy"}) { - print "function: "; - if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})) { - print join(', ',@{$taxonomy->{'by-package'}{'functionality'}{$pkg}}), "\n"; - } else { - print "(none found)\n"; - } - } - if ($opts{"characterization"} || $opts{"taxonomy"}) { - print "primary characterization: "; - if (defined($taxonomy->{'by-package'}{'primary'}{$pkg})) { - print $taxonomy->{'by-package'}{'primary'}{$pkg}, "\n"; - } else { - print "(none found)\n"; - } - print "secondary characterization: "; - if (defined($taxonomy->{'by-package'}{'secondary'}{$pkg})) { - print $taxonomy->{'by-package'}{'secondary'}{$pkg}, "\n"; - } else { - print "(none found)\n"; - } - } if ($opts{"list"}) { if ($tlp->category eq "Collection" || $tlp->category eq "Scheme") { # in the case of collections of schemes we list the deps @@ -1453,83 +1406,26 @@ sub action_info { } - -# taxonomy subroutines -# -sub load_taxonomy_datafile { - init_local_db(); - my $taxonomy; - my $fpath = $localtlpdb->root - . "/texmf-dist/scripts/texlive/var/texcatalogue.keywords"; - if (! -r $fpath) { - tlwarn("$prg: taxonomy file $fpath not readable: $!\n"); - return; - } - if (!open (TAXF, $fpath)) { - tlwarn("$prg: taxonomy file $fpath cannot be opened: $!\n"); - return; - } - # suck in the whole file contents - my @foo = <TAXF>; - close(TAXF); - my $foo = "@foo"; - no strict "vars"; - # the no strict "vars" is *ABSOLUTELY* necessary otherwise the file is - # not evaluated, no idea why! - eval "$foo"; - use strict "vars"; - return $taxonomy; -} - -sub walk_level_tree { - my $cp = shift; - my $prestring = shift; - my $print_packages = shift; - if (defined($cp->{'_packages_'})) { - print "$prestring\n"; - if ($print_packages) { - my @pkgs = sort @{$cp->{'_packages_'}}; - print "\t@pkgs\n"; - } - } - for my $cz (keys %$cp) { - if ($cz ne '_packages_') { - my $nextstring = "$prestring > $cz"; - my $np = $cp->{$cz}; - &walk_level_tree($np,$nextstring); - } - } -} - # SEARCH # sub action_search { - my $r = shift @ARGV; + my ($r) = @ARGV; my $ret = ""; my $tlpdb; - my $taxonomy; - # - if (!$opts{"list"} && (!defined($r) || !$r)) { - - tlwarn("$prg: nothing to search for.\n"); - return; - } - if ($opts{"extended"}) { - tlwarn("$prg: sorry, extended searching not implemented by now.\n"); - return; - } # check the arguments my $search_type_nr = 0; $search_type_nr++ if $opts{"file"}; - $search_type_nr++ if $opts{"taxonomy"}; - $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("$prg: please specify only one thing to search for!\n"); + tlwarn("$prg: please specify only one thing to search for\n"); return; } + # + if (!defined($r) || !$r) { + tlwarn("$prg: nothing to search for.\n"); + return; + } + init_local_db(); if ($opts{"global"}) { init_tlmedia_or_die(); @@ -1537,49 +1433,9 @@ sub action_search { } else { $tlpdb = $localtlpdb; } - 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("$prg: Cannot load taxonomy file;", - " searching/listing for taxonomies not supported.\n"); - return; - } - if ($opts{"list"}) { - if ($search_keyword) { - print "\f Keywords:\n"; - for (sort keys %{$taxonomy->{'by-taxonomy'}{'keyword'}}) { - print "\t$_\n"; - } - print "\n"; - } - if ($search_functionality) { - print "\f Functionalities:\n"; - &walk_level_tree($taxonomy->{'by-taxonomy'}{'functionality'}, "", 0); - print "\n"; - } - if ($search_characterization) { - # Assume all possible characterizations occur under the primary ones! - print "\f Characterizations:\n"; - &walk_level_tree($taxonomy->{'by-taxonomy'}{'primary'}, "", 0); - print "\n"; - } - return; - } - } foreach my $pkg ($tlpdb->list_packages) { my $tlp = $tlpdb->get_package($pkg); - if ($opts{"file"}) { + if ($opts{"file"} || $opts{"all"}) { my @files = $tlp->all_files; if ($tlp->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } @@ -1593,36 +1449,14 @@ sub action_search { } } else { next if ($pkg =~ m/\./); - # the other searching is done together - my $t = ""; - if ($search_keyword) { - $t = $t . join('\n', @{$taxonomy->{'by-package'}{'keyword'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'keyword'}{$pkg})); - } - if ($search_functionality) { - $t = $t.join('\n', @{$taxonomy->{'by-package'}{'functionality'}{$pkg}}) - if (defined($taxonomy->{'by-package'}{'functionality'}{$pkg})); - } - 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})); - } - if ($search_tlpdb) { - $t .= "$pkg\n"; - $t = "$t" . $tlp->shortdesc . "\n" - if (defined($tlp->shortdesc)); - $t = "$t" . $tlp->longdesc . "\n" - if (defined($tlp->longdesc)); - } - my $shortdesc = $tlp->shortdesc; - $shortdesc |= ""; + # glom description strings together for one search + my $t = "$pkg\n"; + $t = $t . $tlp->shortdesc . "\n" if (defined($tlp->shortdesc)); + $t = $t . $tlp->longdesc . "\n" if (defined($tlp->longdesc)); my $pat = $r; - if ($opts{"word"}) { - $pat = '\W' . $r . '\W'; - } + $pat = '\W' . $r . '\W' if ($opts{"word"}); if ($t =~ m/$pat/i) { + my $shortdesc = $tlp->shortdesc || ""; $ret .= " $pkg - $shortdesc\n"; } } @@ -6587,18 +6421,6 @@ not be used; only locally installed packages, collections, or schemes are listed. (Does not work for listing of packages for now) -=item B<--taxonomy> - -=item B<--keyword> - -=item B<--functionality> - -=item B<--characterization> - -In addition to the normal data displayed, also display information for -given packages from the corresponding taxonomy (or all of them). See -L</TAXONOMIES> below for details. - =back @@ -7038,66 +6860,35 @@ otherwise, all operations will fail! =head3 search [I<option>...] --file I<what> -=head3 search [I<option>...] --taxonomy I<what> - -=head3 search [I<option>...] --keyword I<what> - -=head3 search [I<option>...] --functionality I<what> - -=head3 search [I<option>...] --characterization I<what> - =head3 search [I<option>...] --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. +as a (Perl) regular expression. Options: =over 4 -=item B<--global> - -Search the TeX Live Database of the installation medium, instead of the -local installation. - -=item B<--word> - -Restrict the search to match only full words. For example, searching for -C<table> with this option will not output packages containing the -word C<tables> (unless they also contain the word C<table> on its own). - -=item B<--list> - -If a search for any (or all) taxonomies is done, by specifying one of -the taxonomy options below, then instead of searching for packages, list -the entire corresponding taxonomy (or all of them). See -L</TAXONOMIES> below. - -=back - -Other search options are selected by specifying one of the following: - -=over 4 - =item B<--file> List all filenames containing I<what>. -=item B<--taxonomy> - -=item B<--keyword> +=item B<--all> -=item B<--functionality> +Search everything: package names, descriptions and filenames. -=item B<--characterization> +=item B<--global> -Search in the corresponding taxonomy (or all) instead of the package -descriptions. See L</TAXONOMIES> below. +Search the TeX Live Database of the installation medium, instead of the +local installation. -=item B<--all> +=item B<--word> -Search for package names, descriptions, and taxonomies, but not files. +Restrict the search of package names and descriptions (but not +filenames) to match only full words. For example, searching for +C<table> with this option will not output packages containing the word +C<tables> (unless they also contain the word C<table> on its own). =back @@ -7409,52 +7200,6 @@ switches between the full GUI and a simplified GUI with only the important and mostly used settings. -=head1 TAXONOMIES - -tlmgr allows searching and listing of various categorizations, which we -call I<taxonomies>, as provided by an enhanced TeX Catalogue (available -for testing at L<http://az.ctan.org>). This is useful when, for -example, you don't know a specific package name but have an idea of the -functionality you need; or when you want to see all packages relating to -a given area. - -There are three different taxonomies, specified by the following -options: - -=over 4 - -=item C<--keyword> - -The keywords, as specified at L<http://az.ctan.org/keyword>. - -=item C<--functionality> - -The ``by-topic'' categorization created by J\"urgen Fenn, as specified -at L<http://az.ctan.org/characterization/by-function>. - -=item C<--characterization> - -Both the primary and secondary functionalities, as specified at -L<http://az.ctan.org/characterization/choose_dimen>. - -=item C<--taxonomy> - -Operate on all the taxonomies. - -=back - -The taxonomies are updated nightly and stored within TeX Live, so -Internet access is not required to search them. - -Examples: - - tlmgr search --taxonomy exercise # check all taxonomies for "exercise" - tlmgr search --taxonomy --word table # check for "table" on its own - tlmgr search --list --keyword # dump entire keyword taxonomy - tlmgr show --taxonomy pdftex # show pdftex package information, - # including all taxonomy entries - - =head1 MULTIPLE REPOSITORIES The main TeX Live repository contains a vast array of packages. @@ -7595,10 +7340,9 @@ above. =item Match -Select packages matching for a specific pattern. By default, this uses -the same algorithm as C<tlmgr search>, i.e., searches everything: -descriptions, taxonomies, and/or filenames. You can also select any -subset for searching. +Select packages matching for a specific pattern. By default, this +searches both descriptions and filenames. You can also select a subset +for searching. =item Selection diff --git a/Master/texmf-dist/scripts/texlive/tlmgrgui.pl b/Master/texmf-dist/scripts/texlive/tlmgrgui.pl index 85e9c4d7092..6a469c5c37f 100644 --- a/Master/texmf-dist/scripts/texlive/tlmgrgui.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgrgui.pl @@ -88,7 +88,6 @@ my @htype = qw/-relief ridge/; # the list of packages as shown by TixGrid # my %Packages; -my $taxonomy; my $mw; my $tlmgrrev; my $menu; @@ -126,7 +125,6 @@ my $show_collections = 1; my $show_schemes = 1; my $match_descriptions = 1; my $match_filenames = 1; -my $match_taxonomies = 1; my $match_text = ""; my $selection_value = 0; @@ -217,10 +215,6 @@ sub guimain { chomp($tlmgrrev); setup_menu_system(); - $taxonomy = load_taxonomy_datafile(); - if (!defined($taxonomy)) { - info(__("Cannot load taxonomy file") . "\n"); - } do_rest_of_gui(); $bgcolor = $loaded_text->cget('-background'); @@ -341,10 +335,6 @@ sub do_rest_of_gui { $filter_match->Checkbutton(-text => __("descriptions"), -command => \&update_grid, -variable => \$match_descriptions)->pack(@a_w); - $filter_match->Checkbutton(-text => __("taxonomies"), - -command => \&update_grid, - -state => (defined($taxonomy) ? "normal" : "disabled"), - -variable => \$match_taxonomies)->pack(@a_w); $filter_match->Checkbutton(-text => __("filenames"), -command => \&update_grid, -variable => \$match_filenames)->pack(@a_w); @@ -354,13 +344,11 @@ sub do_rest_of_gui { my ($new_val, undef, $old_val) = @_; # if (!$new_val) { # $match_descriptions = 0; - # $match_taxonomies = 0; # $match_filenames = 0; # } else { # # if something is already in the search field don't change selection # if (!$old_val) { # $match_descriptions = 1; - # $match_taxonomies = 1 if (defined($taxonomy)); # $match_filenames = 1; # } # } @@ -394,7 +382,6 @@ sub do_rest_of_gui { $show_schemes = 1; $selection_value = 0; $match_descriptions = 1; - $match_taxonomies = 1; $match_filenames = 1; update_grid(); })->pack(@x_x, @a_c); @@ -947,7 +934,7 @@ sub MatchesFilters { # + no search target selected # -> show empty list (maybe show warning "select something") # - if ($match_descriptions || $match_taxonomies || $match_filenames) { + if ($match_descriptions || $match_filenames) { my $found = 0; my $r = $match_text; if ($r eq "") { @@ -963,14 +950,7 @@ sub MatchesFilters { $found = 1; } } - if (!$found) { - if (defined($taxonomy) && $match_taxonomies) { - if ($Packages{$p}{'taxonomy'} =~ m/$r/i) { - $found = 1; - } - } - } - # if we already dound, don't check the next condition! + # if we already found something, don't check the next condition! if (!$found) { if ($match_filenames) { if ($Packages{$p}{'match_files'} =~ m/$r/i) { @@ -2060,35 +2040,6 @@ sub populate_Packages { $Packages{$p}{'match_desc'} .= "\n"; $Packages{$p}{'match_desc'} .= ($tlp->longdesc || ""); # - # taxonomy matching - if (defined($taxonomy)) { - $Packages{$p}{'taxonomy'} = ""; - if (defined($taxonomy->{'by-package'}{'keyword'}{$p})) { - $Packages{$p}{'keyword'} = - join(", ", @{$taxonomy->{'by-package'}{'keyword'}{$p}}); - $Packages{$p}{'taxonomy'} .= - join('\n', @{$taxonomy->{'by-package'}{'keyword'}{$p}}); - $Packages{$p}{'taxonomy'} .= '\n'; - } - if (defined($taxonomy->{'by-package'}{'functionality'}{$p})) { - $Packages{$p}{'functionality'} = - join(' > ', @{$taxonomy->{'by-package'}{'functionality'}{$p}}); - $Packages{$p}{'taxonomy'} .= - join('\n', @{$taxonomy->{'by-package'}{'functionality'}{$p}}); - $Packages{$p}{'taxonomy'} .= '\n'; - } - if (defined($taxonomy->{'by-package'}{'primary'}{$p})) { - $Packages{$p}{'primary'} = $taxonomy->{'by-package'}{'primary'}{$p}; - $Packages{$p}{'taxonomy'} .= $taxonomy->{'by-package'}{'primary'}{$p}; - $Packages{$p}{'taxonomy'} .= "\n"; - } - if (defined($taxonomy->{'by-package'}{'secondary'}{$p})) { - $Packages{$p}{'secondary'} = $taxonomy->{'by-package'}{'secondary'}{$p}; - $Packages{$p}{'taxonomy'} .= $taxonomy->{'by-package'}{'secondary'}{$p}; - $Packages{$p}{'taxonomy'} .= "\n"; - } - } - # # file matching my @all_f = $tlp->all_files; if ($tlp->relocated) { for (@all_f) { s:^$RelocPrefix/:$RelocTree/:; } } |