Bug#449229: tex-common: texdoc finds html pages from catalogue first
Hi Frank, hi all the new luatex 0.20.0 ships os.tmpdir, but unfortunately a crippled version which *ALWAYS* tries to create the tmpdir in .! I have made a patch for luatex/os.tmpdir so that it takes a template and send it to Taco. For texdoclua I have applied the following patch: Patch texdoclua becasue lfs.tmpname creates a file already so that texdoclua breaks --- debian/texdoclua |9 + 1 file changed, 1 insertion(+), 8 deletions(-) Index: luatex-0.20.0/debian/texdoclua === --- luatex-0.20.0.orig/debian/texdoclua 2007-12-05 15:13:44.0 +0100 +++ luatex-0.20.0/debian/texdoclua 2007-12-05 15:17:43.0 +0100 @@ -299,14 +299,7 @@ -- than once (dvi besides ps or so) -- TODO: to be done - tmpdir = os.tmpname(); - is_ok_tmpdir,error_string = lfs.mkdir(tmpdir) - if is_ok_tmpdir then --- needs_cleanup = true; - else -print(error_string); -os.exit(1); - end + tmpdir = os.tmpdir(/tmp/texdoc.XX); unzip_commandline = unzip_command .. filename .... tmpdir .. / .. basename; if os.execute(unzip_commandline) then So Frank you might add it to upstream ;-). And yes, tmpdir should probably be checked for being nil or not? Next upload of luatex will have both patches (save that Taco or you come up with better patches than I did) Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- SCRANTON (n.) A person who, after the declaration of the bodmin (q.v.), always says,'... But I only had the tomato soup.' --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Hi all! On Do, 15 Nov 2007, Frank Küster wrote: do find the .dvi.gz file before the .html file. However, texdoclua returns only 'File exists' and *does not start the previewer*. I have See above... I'll have a look, but not this weekend. The problem is in the tmpdir creation: tmpdir = os.tmpname(); is_ok_tmpdir,error_string = lfs.mkdir(tmpdir) if is_ok_tmpdir then -- needs_cleanup = true; else print(error_string); os.exit(1); end The problem is the following: os.tmpname in luatex CREATES a temporary file, while the documentation of lua5.1 on the web tells that it only creates a temporary file. The problem is that tmpdir exists as file and lfs.mkdir returns an error. The following patch uses tmpdir (renamed to tmpfile) as tmpfile. Could be that this is racy and prone to symlink attack, no idea. Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- HALCRO (n.) An adhesive fibrous cloth used to hold babies' clothes together. Thousands of tiny pieces of jam 'hook' on to thousands of tiny-pieces of dribble, enabling the cloth to become 'sticky'. --- Douglas Adams, The Meaning of Liff --- /usr/bin/texdoc 2007-11-11 21:45:47.0 +0100 +++ texdoc 2007-11-17 10:44:21.0 +0100 @@ -298,23 +298,16 @@ -- uncompress only once per file, in case it is given more -- than once (dvi besides ps or so) -- TODO: to be done - - tmpdir = os.tmpname(); - is_ok_tmpdir,error_string = lfs.mkdir(tmpdir) - if is_ok_tmpdir then - -- needs_cleanup = true; - else - print(error_string); - os.exit(1); - end - unzip_commandline = unzip_command .. filename .... tmpdir .. / .. basename; + tmpfile = os.tmpname(); + + unzip_commandline = unzip_command .. filename .... tmpfile; if os.execute(unzip_commandline) then - filename = tmpdir .. / .. basename; + filename = tmpfile; else print(Error executing \n .. unzip_commandline); end - viewer_replacement = filename .. ';' .. rmfile_command .. filename .. ';' .. rmdir_command .. tmpdir; + viewer_replacement = filename .. ';' .. rmfile_command .. tmpfile ; else if ext == '' then -- fallback if complete filename has been specified @@ -347,4 +340,4 @@ end -- if construct case mode in end -- for docname --- cleanup_tmpdir(); +-- cleanup_tmpfile();
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Norbert Preining [EMAIL PROTECTED] wrote: On Di, 13 Nov 2007, Ralf Stubner wrote: Frank hinted at he might have solved this problem independently of the config settings, but maybe I missunderstood him. No, you didn't - I just don't know my code anymore. Anyway, I copied the texmf.cnf snippets from current tex-common svn to /etc/texmf/texmf.d and run update-texmf. After that both texdoclua and texdoc.notluatex do find the .dvi.gz file before the .html file. However, texdoclua returns only 'File exists' and *does not start the previewer*. I have no idea why. Frank, any idea? See above... I'll have a look, but not this weekend. Regards, Frank -- Frank Küster Debian Developer (teTeX/TeXLive)
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Di, 13 Nov 2007, Ralf Stubner wrote: Frank hinted at he might have solved this problem independently of the config settings, but maybe I missunderstood him. Anyway, I copied the texmf.cnf snippets from current tex-common svn to /etc/texmf/texmf.d and run update-texmf. After that both texdoclua and texdoc.notluatex do find the .dvi.gz file before the .html file. However, texdoclua returns only 'File exists' and *does not start the previewer*. I have no idea why. Frank, any idea? TEXDOCEXT looks fine now. I am still not convinced wrt to altering TEXMFCNF. Fine for texdocext,and texmfcnf is reverted. Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- SCAMBLEBY (n.) A small dog which resembles a throw-rug and appears to be dead. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On So, 11 Nov 2007, Frank Küster wrote: You'd better search in the texlive list archives, but I think the latest version is the one in my ~/bin directory. There's also a manpage, but Ok thanks. I only changed the version number.. --[[ Changelog 0.3 2007-06-28 ... progname = 'texdoc'; version = '0.2'; I made it a version = '0.3'; Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- FIUNARY (n.) The safe place you put something and then forget where it was. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Sun, Nov 11, 2007 at 23:03 +0100, Norbert Preining wrote: for ETCH: deb(-src) http://people.debian.org/~preining/TeX/ luatex/ Thanks a lot, Norbert! Ralf: Could you please test ... I have no etch but my cow/pbuilder. Thanks! Installation works. texdoclua also works. However, texdoclua does still find the html page from the catalogue first: [EMAIL PROTECTED]:~$ texdoclua -l everyshi /usr/share/texmf-texlive/doc/english/catalogue/entries/everyshi.html /usr/share/texmf-texlive/doc/latex/everyshi/everyshi.dvi.gz [EMAIL PROTECTED]:~$ texdoc.notluatex -l everyshi /usr/share/texmf-texlive/doc/english/catalogue/entries/everyshi.html /usr/share/texmf-texlive/doc/latex/everyshi/everyshi.dvi.gz I know nothing about lua, but at first glance this does not look to surprising: extlist = {'','.dvi', '.dvi.gz', '.dvi.bz2', '.pdf', '.pdf.gz', '.pdf.bz2', '.ps', '.ps.gz', '.ps.bz2', '.txt', '.txt.gz', '.txt.bz2', '.html'}; [...] extlist = set_listvar_from_expand_braces(extlist,'$TEXDOCEXT'); So while the default extlist is ok, this is then extended/overwritten by the content of TEXDOCEXT, which is not idealy set. cheerio ralf -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Hi Ralf, hi all! On Mo, 12 Nov 2007, Ralf Stubner wrote: Installation works. texdoclua also works. However, texdoclua does still find the html page from the catalogue first: Of course, you need tex-common 1.10 (AFAIR) which is still in svn but not released. Please can you check the current setting in texmf.cnf, or better its parts, in the svn repository, that should work better. (I am on a windows computer without any svn checkout ATM, and had too much wine to check it on the net, sorry) So while the default extlist is ok, this is then extended/overwritten by the content of TEXDOCEXT, which is not idealy set. Please, let us improve this before we release a new tex-common with all the int updates etc. Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- Someone down there is trying to kill us!' `Terrific,' said Arthur. `But don't you see what this means?' `Yes. We are going to die.' `Yes, but apart from that.' `APART from that?' `It means we must be on to something!' `How soon can we get off it?' --- Zaphod and Arthur in a certain death situation over --- Magrathea. --- Douglas Adams, The Hitchhikers Guide to the Galaxy -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Mon, Nov 12, 2007 at 23:37 +0100, Norbert Preining wrote: On Mo, 12 Nov 2007, Ralf Stubner wrote: Installation works. texdoclua also works. However, texdoclua does still find the html page from the catalogue first: Of course, you need tex-common 1.10 (AFAIR) which is still in svn but not released. Please can you check the current setting in texmf.cnf, or better its parts, in the svn repository, that should work better. Frank hinted at he might have solved this problem independently of the config settings, but maybe I missunderstood him. Anyway, I copied the texmf.cnf snippets from current tex-common svn to /etc/texmf/texmf.d and run update-texmf. After that both texdoclua and texdoc.notluatex do find the .dvi.gz file before the .html file. However, texdoclua returns only 'File exists' and *does not start the previewer*. I have no idea why. So while the default extlist is ok, this is then extended/overwritten by the content of TEXDOCEXT, which is not idealy set. Please, let us improve this before we release a new tex-common with all the int updates etc. TEXDOCEXT looks fine now. I am still not convinced wrt to altering TEXMFCNF. cheerio ralf -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Di, 13 Nov 2007, Ralf Stubner wrote: TEXDOCEXT looks fine now. I am still not convinced wrt to altering TEXMFCNF. Ok, I removed /var/lib/texmf/web2c from TEXMFCNF again. I trust you on this. Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- RAMSGATE (n.) All institutional buildings must, by law, contain at least twenty ramsgates. These are doors which open the opposite way to the one you expect. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Question/Suggestion/Idea: What about if we ship texdoclua for NOW with luatex and make dpkg diversion of texdoc Frank, what would you say? On So, 11 Nov 2007, Norbert Preining wrote: If someone wants to take over this it would be great ... I will give it a try tomorrow. Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- HUNSINGORE (n.) Medieval ceremonial brass horn with which the successful execution of an araglin (q.v.) is trumpeted from the castle battlements. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On So, 11 Nov 2007, Frank Küster wrote: On the other hand, introducing alternatives would be overkill. Go ahead. Can you send me the last version AND (grin grin) a man page ;-) Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- NASEBY (n.) The stout metal instrument used for clipping labels on to exhibits at flower shows. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Norbert Preining [EMAIL PROTECTED] wrote: Question/Suggestion/Idea: What about if we ship texdoclua for NOW with luatex Sounds interesting. and make dpkg diversion of texdoc Frank, what would you say? I hate diversions, I think the concept is flawed. However, it's mostly problematic if the diverted/ing packages are by different maintainers, and it's unlikely that anyone will ever maintain luatex separately from us. On the other hand, introducing alternatives would be overkill. Go ahead. Regards, Frank -- Frank Küster Debian Developer (teTeX/TeXLive)
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Norbert Preining [EMAIL PROTECTED] wrote: On So, 11 Nov 2007, Frank Küster wrote: On the other hand, introducing alternatives would be overkill. Go ahead. Can you send me the last version AND (grin grin) a man page ;-) You'd better search in the texlive list archives, but I think the latest version is the one in my ~/bin directory. There's also a manpage, but I'm not sure whether I've updated it to the latest changes. Regards, Frank -- Frank Küster Debian Developer (teTeX/TeXLive) #!/usr/bin/env texlua --[[ Written in lua by Frank Küster (2007) based on the shell script by Thomas Esser, David Aspinall, and Simon Wilkinson. Public domain.]] --[[ Changelog 0.3 2007-06-28 - added changelog - better OS detection for default viewer settings - removed some debugging code - -s now works in dirs without ls-R, too 0.2 2007-06-28 - implemented reading of configuration from texmf.cnf - fixed -s option 0.1 - initial public release ]] progname = 'texdoc'; version = '0.2'; usage = ' Usage: ' .. progname ..' [-h|--help] name\ -h|--help\t\t Show this help\ -V|--version\t\t Print the version of the program\ -v|--verbose\t\t Show the command being used to display the documentation\ -l|--list\t\t List matching files, do not start a viewer.\ -s|--search\t\t search for name as a pattern'; if not arg[1] then print (usage); return end mode = 'view'; verbose = false; while table.maxn(arg) 0 and string.match(arg[1],'^%-') do curr_arg = table.remove(arg,1) if string.match (curr_arg,'-h') or string.match (curr_arg,'--help') then print (usage); os.exit(0); elseif string.match (curr_arg,'-V') or string.match (curr_arg,'--version') then print (progname .. ' version: ' .. version ); os.exit(0); elseif string.match (curr_arg,'-v') or string.match (curr_arg,'--verbose') then verbose = true; elseif string.match (curr_arg,'-l') or string.match (curr_arg,'--list' ) then mode = 'list'; elseif string.match (curr_arg,'-s') or string.match (curr_arg,'--search' ) then mode = 'search'; end end --[[ function definitions ]] function list_iter (t) local i = 0 local n = table.getn(t) return function () i = i + 1 if i = n then return t[i] end end end -- [[ functions for the search option ]] no_lsr_doctrees = {}; function get_lsr_files () local lsr_files = {}; local pathlist = kpse.expand_braces('$TEXDOCS'); for path in string.gmatch(pathlist, [^:;]+) do path = string.gsub(path,'//$','') local tree_root tree_root = string.gsub(path,'doc$','') tree_root = string.gsub(tree_root,'^!!','') if lfs.isfile(tree_root .. ls-R) then table.insert(lsr_files,tree_root .. ls-R) else if not string.match(path,'^%.$') and lfs.isdir(path) then table.insert(no_lsr_doctrees,path) end end -- does lsRfile exist? end -- for path local i = 0 local n = table.getn(lsr_files) -- TODO: We completely ignore trees without ls-R files. Since I -- don't know how to get the output of find without resorting to -- temporary files, anyway, I don't care. return function () i = i +1 if i = n then return lsr_files[i] end end end -- get_lsr_files() function deluaficate(oldpat) local newpat -- better use long strings here, no escaping of \ needed there. newpat = string.gsub(oldpat,'([^\\])%-','%1%%%-') newpat = string.gsub(newpat,'\\','') return newpat end --deluaficate docdirs = {} docfiles = {} function pattern_search (pattern) pattern = deluaficate(pattern) -- populate docdirs and doclines list for database in get_lsr_files() do local texmf_tree = string.gsub(database,'ls%-R$','') is_docline = false local this_dir -- changed to each individual docdir for line in io.lines(database) do if string.match(line,'^./') then -- a directory this_dir = string.gsub(line,'^./',texmf_tree) this_dir = string.gsub(this_dir,':$','/') if string.match(line,'^./doc') then -- the next file lines are in docdir this_dir is_docline = true -- save it in the docdirs table table.insert(docdirs,this_dir) else is_docline = false end -- docdir elseif string.match(line,'^%s*$') then -- empty line, do nothing -- now we have only file lines left, are they a docline? elseif is_docline then local fullpath = this_dir .. line -- print(fullpath) table.insert(docfiles,fullpath) end -- line starting with ./ end -- for line end -- for database for no_lsr_dir in list_iter(no_lsr_doctrees) do recurse_tree(no_lsr_dir) end print(Directories that match:) for dir in
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On So, 11 Nov 2007, Norbert Preining wrote: Yes I did, but the last version (0.11 etc) I didn't till now because it would need the packport of the libpoppler patch (or etch backports ship with compiled-in xpdf). I used the new libpoppler patch from texlive and adapted it for luatex, but didn't do it for now for the old (etch) luatex patch. Well, there it is ... for ETCH: deb(-src) http://people.debian.org/~preining/TeX/ luatex/ for SID: deb(-src) http://people.debian.org/~preining/TeX/ luatex-sid/ It already includes the diversion of texdoc ... and packages the current beta/snapshot. Ralf: Could you please test ... I have no etch but my cow/pbuilder. Thanks! You might ask why etch-luatex, sid-luatex-sid: I would like to have backport to etch on people.debian.org, esp since I have announced it several times that there you could find the etch packages, too... Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- KIMMERIDGE (n.) The light breeze which blows through your armpit hair when you are stretched out sunbathing. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Sun, Nov 04, 2007 at 22:19 +0100, Frank Küster wrote: Ralf Stubner [EMAIL PROTECTED] wrote: * fix texdoc so that it does not matter if a file is compressed or not You could give texdoclua a test, which I sent to the texlive list already, and attach again to this mail. Although I've written it, I'm not sure whether the problem is fixed there, but I hope it is. Thanks Frank. Has anybody of you tried to backport luatex to etch? cheerio ralf
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Ralf Stubner [EMAIL PROTECTED] wrote: On Sun, Nov 04, 2007 at 22:19 +0100, Frank Küster wrote: Ralf Stubner [EMAIL PROTECTED] wrote: * fix texdoc so that it does not matter if a file is compressed or not You could give texdoclua a test, which I sent to the texlive list already, and attach again to this mail. Although I've written it, I'm not sure whether the problem is fixed there, but I hope it is. Thanks Frank. Has anybody of you tried to backport luatex to etch? Yes: $ zgrep luatex /var/log/aptitude* /var/log/aptitude.5.gz:[INSTALL] luatex-snapshot /var/log/aptitude.5.gz:[UPGRADE] luatex-snapshot 20070426-1~alocalbackport.1 - 20070619-1~alocalbackport.1 /var/log/aptitude.5.gz:[UPGRADE] luatex-snapshot 20070619-1~alocalbackport.1 - 20070626.2-1~etch.np.1 In other words, I seem to have done it twice, later Norbert provided one. By the way, why doesn't it find the removal - it's currently removed for reasons I don't remember. Regards, Frank -- Frank Küster Debian Developer (teTeX/TeXLive)
Bug#449229: tex-common: texdoc finds html pages from catalogue first
On Sa, 10 Nov 2007, Ralf Stubner wrote: Thanks Frank. Has anybody of you tried to backport luatex to etch? Yes I did, but the last version (0.11 etc) I didn't till now because it would need the packport of the libpoppler patch (or etch backports ship with compiled-in xpdf). I used the new libpoppler patch from texlive and adapted it for luatex, but didn't do it for now for the old (etch) luatex patch. If someone wants to take over this it would be great ... Best wishes Norbert --- Dr. Norbert Preining [EMAIL PROTECTED]Vienna University of Technology Debian Developer [EMAIL PROTECTED] Debian TeX Group gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 --- BROATS A pair of trousers with a career behind them. Broats are most commonly seen on elderly retired army officers. Originally the brats were part of their best suit back in the thirties; then in the fifties they were demounted and used for gardening. Recently pensions not being what they were, the broats have been called out of retirement and reinstated as part of the best suit again. --- Douglas Adams, The Meaning of Liff -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Package: tex-common Version: 1.9 Severity: normal ,[ 90TeXDoc.cnf ] | % the default extensions for documentation | TEXDOCSSUFFIX = .pdf:.dvi:.ps:.txt | % we allow some compression methods | TEXDOCSCOMPRESS = :.gz:.bz2 | % put html at the very end, to avoid showing the Catalogue: | TEXDOCHTML = .html | % and put that all now together | TEXDOCEXT = {$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}:{$TEXDOCHTML}{$TEXDOCSCOMPRESS} ` However, this does not work, since TEXDOCEXT is already defined by 45TeXinputs.cnf and texmf.cnf is odd in that *earlier* entries take precedence. This can be seen from $ kpsewhich -var-value=TEXDOCEXT {:.pdf:.ps:.dvi:.html:.txt:.tex}{:.gz:.bz2:.zip:.Z} which is the value defined in 45TeXinputs.cnf. The effect of this is that, eg, for everyshi the html page from the Catalogue is found first: $ texdoc -l everyshi /usr/share/texmf-texlive/doc/english/catalogue/entries/everyshi.html /usr/share/texmf-texlive/doc/latex/everyshi/everyshi.dvi.gz This does not happen with many other packages, since their documentation comes in (uncompressed) PDF files: $ texdoc -l array /usr/share/texmf-texlive/doc/latex/tools/array.pdf /usr/share/texmf-texlive/doc/english/catalogue/entries/array.html Possbile solutions: * put 90TeXDoc.cnf as 40TeXDoc.cnf before 45TeXinputs.cnf * replace the definitions in 45TeXinputs.cnf by those in 90TeXDoc.cnf and remove the latter file * fix texdoc so that it does not matter if a file is compressed or not cheerio ralf -- System Information: Debian Release: 4.0 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-5-686 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages tex-common depends on: ii debconf 1.5.11 Debian configuration management sy ii ucf 2.0020 Update Configuration File: preserv tex-common recommends no packages. Versions of packages texlive-base depends on: ii texlive-base-bin 2007-14.np.etch.1 TeX Live: Essential binaries ii texlive-common 2007-12 TeX Live: Base component ii texlive-doc-base 2007-3TeX Live: Base documentation -- debconf information: tex-common/check_texmf_wrong: tex-common/check_texmf_missing: -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#449229: tex-common: texdoc finds html pages from catalogue first
Ralf Stubner [EMAIL PROTECTED] wrote: Possbile solutions: * put 90TeXDoc.cnf as 40TeXDoc.cnf before 45TeXinputs.cnf * replace the definitions in 45TeXinputs.cnf by those in 90TeXDoc.cnf and remove the latter file I think we have already included these variables upstream, and Debian should put them at the corresponding place. * fix texdoc so that it does not matter if a file is compressed or not You could give texdoclua a test, which I sent to the texlive list already, and attach again to this mail. Although I've written it, I'm not sure whether the problem is fixed there, but I hope it is. Regards, Frank -- Frank Küster Debian Developer (teTeX/TeXLive) #!/usr/bin/env texlua --[[ Written in lua by Frank Küster (2007) based on the shell script by Thomas Esser, David Aspinall, and Simon Wilkinson. Public domain.]] --[[ Changelog 0.3 2007-06-28 - added changelog - better OS detection for default viewer settings - removed some debugging code - -s now works in dirs without ls-R, too 0.2 2007-06-28 - implemented reading of configuration from texmf.cnf - fixed -s option 0.1 - initial public release ]] progname = 'texdoc'; version = '0.2'; usage = ' Usage: ' .. progname ..' [-h|--help] name\ -h|--help\t\t Show this help\ -V|--version\t\t Print the version of the program\ -v|--verbose\t\t Show the command being used to display the documentation\ -l|--list\t\t List matching files, do not start a viewer.\ -s|--search\t\t search for name as a pattern'; if not arg[1] then print (usage); return end mode = 'view'; verbose = false; while table.maxn(arg) 0 and string.match(arg[1],'^%-') do curr_arg = table.remove(arg,1) if string.match (curr_arg,'-h') or string.match (curr_arg,'--help') then print (usage); os.exit(0); elseif string.match (curr_arg,'-V') or string.match (curr_arg,'--version') then print (progname .. ' version: ' .. version ); os.exit(0); elseif string.match (curr_arg,'-v') or string.match (curr_arg,'--verbose') then verbose = true; elseif string.match (curr_arg,'-l') or string.match (curr_arg,'--list' ) then mode = 'list'; elseif string.match (curr_arg,'-s') or string.match (curr_arg,'--search' ) then mode = 'search'; end end --[[ function definitions ]] function list_iter (t) local i = 0 local n = table.getn(t) return function () i = i + 1 if i = n then return t[i] end end end -- [[ functions for the search option ]] no_lsr_doctrees = {}; function get_lsr_files () local lsr_files = {}; local pathlist = kpse.expand_braces('$TEXDOCS'); for path in string.gmatch(pathlist, [^:;]+) do path = string.gsub(path,'//$','') local tree_root tree_root = string.gsub(path,'doc$','') tree_root = string.gsub(tree_root,'^!!','') if lfs.isfile(tree_root .. ls-R) then table.insert(lsr_files,tree_root .. ls-R) else if not string.match(path,'^%.$') and lfs.isdir(path) then table.insert(no_lsr_doctrees,path) end end -- does lsRfile exist? end -- for path local i = 0 local n = table.getn(lsr_files) -- TODO: We completely ignore trees without ls-R files. Since I -- don't know how to get the output of find without resorting to -- temporary files, anyway, I don't care. return function () i = i +1 if i = n then return lsr_files[i] end end end -- get_lsr_files() function deluaficate(oldpat) local newpat -- better use long strings here, no escaping of \ needed there. newpat = string.gsub(oldpat,'([^\\])%-','%1%%%-') newpat = string.gsub(newpat,'\\','') return newpat end --deluaficate docdirs = {} docfiles = {} function pattern_search (pattern) pattern = deluaficate(pattern) -- populate docdirs and doclines list for database in get_lsr_files() do local texmf_tree = string.gsub(database,'ls%-R$','') is_docline = false local this_dir -- changed to each individual docdir for line in io.lines(database) do if string.match(line,'^./') then -- a directory this_dir = string.gsub(line,'^./',texmf_tree) this_dir = string.gsub(this_dir,':$','/') if string.match(line,'^./doc') then -- the next file lines are in docdir this_dir is_docline = true -- save it in the docdirs table table.insert(docdirs,this_dir) else is_docline = false end -- docdir elseif string.match(line,'^%s*$') then -- empty line, do nothing -- now we have only file lines left, are they a docline? elseif is_docline then local fullpath = this_dir .. line -- print(fullpath) table.insert(docfiles,fullpath) end -- line starting with ./