diff options
-rwxr-xr-x | Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords (renamed from Master/tlpkg/bin/parse-texcatalogue-keywords) | 0 | ||||
-rw-r--r-- | Master/tlpkg/dev/keyword-search/read-dump-and-pretty-print.pl | 52 | ||||
-rw-r--r-- | Master/tlpkg/dev/keyword-search/tlmgr-interface.txt | 35 |
3 files changed, 87 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/parse-texcatalogue-keywords b/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords index 281542022cc..281542022cc 100755 --- a/Master/tlpkg/bin/parse-texcatalogue-keywords +++ b/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords diff --git a/Master/tlpkg/dev/keyword-search/read-dump-and-pretty-print.pl b/Master/tlpkg/dev/keyword-search/read-dump-and-pretty-print.pl new file mode 100644 index 00000000000..ca5a7ba7d76 --- /dev/null +++ b/Master/tlpkg/dev/keyword-search/read-dump-and-pretty-print.pl @@ -0,0 +1,52 @@ +$^W = 1; +use strict; +# how to read in!!! +my $seikaku; +my $kw_pkg; +my $cz_pkg; +my $foo = `cat tc-dump`; +# the no strict "vars" is *ABSOLUT* necessary otherwise the file is not +# evaluated, no idea why! +no strict "vars"; +eval "$foo"; +use strict "vars"; +# +print_keywords($kw_pkg); +print "\n===================\nprimary characterizations\n"; +walk_cz_tree($cz_pkg->{'primary'}, "PRIM"); +print "\n===================\nsecondary characterizations\n"; +walk_cz_tree($cz_pkg->{'secondary'}, "SEC"); +print "\n===================\nby-function characterizations\n"; +walk_cz_tree($cz_pkg->{'by-function'}, "BFUNC"); + + +sub print_keywords { + my $kw_pkg = shift; + for my $k (keys %$kw_pkg) { + my @pkgl = @{$kw_pkg->{$k}}; + if (defined(@pkgl)) { + print "keyword = $k\n package = @pkgl\n"; + } else { + print "keyword = $k\n package = NO PACKAGE FOUND!\n"; + } + } +} + + +sub walk_cz_tree { + my $cp = shift; + my $prestring = shift; + if (defined($cp->{'_packages_'})) { + my @pkgs = sort @{$cp->{'_packages_'}}; + print "$prestring\n"; + print "--> @pkgs\n"; + } + for my $cz (keys %$cp) { + if ($cz ne '_packages_') { + my $nextstring = "$prestring > $cz"; + my $np = $cp->{$cz}; + &walk_cz_tree($np,$nextstring); + } + } +} + diff --git a/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt b/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt new file mode 100644 index 00000000000..c6405c490d8 --- /dev/null +++ b/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt @@ -0,0 +1,35 @@ +How to interface tlmgr search with keywords + +new search interface: + +tlmgr search <options> <terms> + +<options> ::= --global | --word | --list [keywords|functions|characterizations] + +<terms> ::= <term> | <term> <terms> +<term> ::= AND | OR | LEFT | RIGHT + keyword=<literal> | function=<levels> | + characterization=<levels> | + package-name=<literal> | title=<literal> | + description=<literal> | file=<literal> + +<levels> ::= <level> | <level> " > " <levels> +<level> ::= <literal> + + +defaults = package-names=ARG OR titles=ARG OR descriptions=ARG +AND -> conjunction +OR -> disjunction +LEFT|RIGHT -> parenthesis for grouping of and and or + +<literal> may contain wildcards and it is matched in a glob style (no re!!) + + +example + tlmgr search keyword=paragraph AND description=dropped +should give back the lettrine package + + tlmgr search characterization=bibliography +searches for all packages with characterization containing anywhere the string +"bibliography" (case insensitive). + |