From 9fca5b4cf316df27359c58f6f46ddcc8e4a47f96 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Mon, 5 Apr 2010 08:09:07 +0000 Subject: Real texdoc search function. git-svn-id: svn://tug.org/texlive/trunk@17704 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/tetex/texdoctk.pl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Master') diff --git a/Master/texmf/scripts/tetex/texdoctk.pl b/Master/texmf/scripts/tetex/texdoctk.pl index 58764ac6181..6f4673d3781 100755 --- a/Master/texmf/scripts/tetex/texdoctk.pl +++ b/Master/texmf/scripts/tetex/texdoctk.pl @@ -815,10 +815,22 @@ sub srchtd { my ($string) = @_; my @res; my $idx = -1; # dummy index for @packname, @topic and @keywords - $packname[-1][0] = "texdoc"; - $topic[-1][0] = "Find documentation in TeX Live"; - $doc[-1][0] = "texdoc/texdoc.pdf"; - return (-1, 0); + my $tdout = `texdoc -M -l $string`; + if ($?) { + &popmsg(0,"texdoc failed, sorry: $!\n". + "Please report this problem on the texlive mailing list.\n"); + return; + } else { + my $i = 0; + for my $line (split /\n/, $tdout) { + my @fields = split /\t/, $line; + $doc[$idx][$i] = $fields[2]; + $topic[$idx][$i] = basename($fields[2]); + $packname[$idx][$i] = "no package name"; + push @res, ($idx, $i++); + } + return @res; + } } # search a string in @packname, @topic and @keywords -- cgit v1.2.3