texlive[62379] trunk: texdoc (3mar22)

commits+karl at tug.org commits+karl at tug.org
Thu Mar 3 22:09:20 CET 2022


Revision: 62379
          http://tug.org/svn/texlive?view=revision&revision=62379
Author:   karl
Date:     2022-03-03 22:09:20 +0100 (Thu, 03 Mar 2022)
Log Message:
-----------
texdoc (3mar22)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/man/man1/texdoc.1
    trunk/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf
    trunk/Master/texmf-dist/doc/support/texdoc/NEWS
    trunk/Master/texmf-dist/doc/support/texdoc/texdoc.pdf
    trunk/Master/texmf-dist/doc/support/texdoc/texdoc.tex
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu
    trunk/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
    trunk/Master/texmf-dist/texdoc/texdoc.cnf

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2022-03-03 21:09:20 UTC (rev 62379)
@@ -1,14 +1,14 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 61401 2021-12-24 22:42:10Z karl $
+# $Id: tlmgr.pl 62273 2022-02-28 08:52:17Z preining $
 #
-# Copyright 2008-2021 Norbert Preining
+# Copyright 2008-2022 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
 use strict; use warnings;
 
-my $svnrev = '$Revision: 61401 $';
-my $datrev = '$Date: 2021-12-24 23:42:10 +0100 (Fri, 24 Dec 2021) $';
+my $svnrev = '$Revision: 62273 $';
+my $datrev = '$Date: 2022-02-28 09:52:17 +0100 (Mon, 28 Feb 2022) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -4306,7 +4306,7 @@
         $binsize += $binsz{$a} if defined($binsz{$a});
         my $atlp = $tlpdb->get_package($tlp->name . ".$a");
         if (!$atlp) {
-          tlwarn("$prg: cannot find depending package" . $tlp->name . ".$a\n");
+          tlwarn("$prg: cannot find depending package " . $tlp->name . ".$a\n");
           return($F_WARNING);
         }
         my %abinsz = %{$atlp->binsize};
@@ -10236,7 +10236,7 @@
 distribution (L<https://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 61401 2021-12-24 22:42:10Z karl $
+$Id: tlmgr.pl 62273 2022-02-28 08:52:17Z preining $
 =cut
 
 # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/man/man1/texdoc.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/texdoc.1	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/doc/man/man1/texdoc.1	2022-03-03 21:09:20 UTC (rev 62379)
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "TEXDOC" "1" "May 2021" "Texdoc 3.3.1" "Texdoc manual"
+.TH "TEXDOC" "1" "March 2022" "Texdoc 3.4" "Texdoc manual"
 .
 .SH "NAME"
 \fBtexdoc\fR \- find & view documentation in TeX Live
@@ -156,7 +156,7 @@
 Source: \fIhttps://github\.com/TeX\-Live/texdoc\fR
 .
 .SH "COPYRIGHT"
-Copyright 2008\-2021 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
+Copyright 2008\-2022 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
 .
 .br
 License: GNU GPL version 3 or later \fIhttp://gnu\.org/licenses/gpl\.html\fR\.

Modified: trunk/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/texdoc/NEWS
===================================================================
--- trunk/Master/texmf-dist/doc/support/texdoc/NEWS	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/doc/support/texdoc/NEWS	2022-03-03 21:09:20 UTC (rev 62379)
@@ -2,6 +2,12 @@
 ===============
 (This file public domain.)
 
+Version 3.4 (TeX Live 2022)
+===========================
+- Make Data.tlpdb.lua reproducible
+- Better locale handling in scoring
+- Alias adjustments
+
 Version 3.3.1
 -------------
 - Support non-ascii username on Windows (patch by A. Kakuto)

Modified: trunk/Master/texmf-dist/doc/support/texdoc/texdoc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/texdoc/texdoc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/texdoc/texdoc.tex	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/doc/support/texdoc/texdoc.tex	2022-03-03 21:09:20 UTC (rev 62379)
@@ -1,6 +1,6 @@
 %#!xelatex
 % Texdoc user manual
-% Copyright 2008-2021 Manuel Pégourié-Gonnard and Takuto Asakura
+% Copyright 2008-2022 Manuel Pégourié-Gonnard and Takuto Asakura
 % distributed under the terms of GPL v3 or later
 \documentclass{texdoc-doc}
 
@@ -8,7 +8,7 @@
 \subtitle{Find \& view documentation in \TL}
 \pkgurl{https://tug.org/texdoc/}
 \author{Manuel Pégourié-Gonnard\and Takuto Asakura}
-\date{v3.3.1\quad \today}
+\date{v3.4\quad \today}
 
 \begin{document}
 
@@ -731,7 +731,7 @@
 \label{sec:licence}
 
 The current version of Texdoc program and its documentation are copyright
-2008--2021 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
+2008--2022 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
 
 They are free software: you can redistribute it and/or modify it under the
 terms of the GNU General Public License as published by the Free Software

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -1,4 +1,4 @@
--- texdoclib-cli.tlu: command line interfaces for texdoc
+-- texdoclib-cli.tlu: command-line interfaces for texdoc
 --
 -- The TeX Live Team, GPLv3, see texdoclib.tlu for details
 
@@ -200,7 +200,7 @@
 --------------------------   the main function   --------------------------
 
 function M.exec()
-    -- parsing command line options
+    -- parsing command-line options
     local ok, action, cl_config = parse_options()
 
     if not ok then

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -50,7 +50,7 @@
 local function context_to_string(context)
     if not context then return '(no context)' end
     if context.src == 'cl' then
-        return 'from command line option "' .. context.name .. '"'
+        return 'from command-line option "' .. context.name .. '"'
     elseif context.src == 'env' then
         return 'from environment variable "' .. context.name .. '"'
     elseif context.src == 'loc' then
@@ -169,9 +169,9 @@
     end
 end
 
-------------------------   config from command line   ------------------------
+------------------------   config from command-line   ------------------------
 
--- set config from the command line
+-- set config from the command-line
 -- Note: Make sure to set a default value in setup_config_from_defaults()
 --       if relevant.
 local function setup_config_from_cl(cl_config)
@@ -450,7 +450,7 @@
             -- Use 'start' to get file associations.
             -- We need to quote the filenames, but the first quoted argument
             -- is considered as the title by start, so we provide a dummy title.
-            -- Also, since the command line parser removes quotes if there
+            -- Also, since the command-line parser removes quotes if there
             -- is no space inside, the dummy title must contain spaces.
             viewer_dvi = 'start "texdoc dvi viewer"',
             viewer_html = 'start "texdoc html viewer"',

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -22,8 +22,8 @@
 -- progname and version
 fullname = kpse.find_file('texdoc/texdoclib', 'lua')
 progname = 'Texdoc'
-version = '3.3.1'
-release_date = '2021-05-20'
+version = '3.4'
+release_date = '2022-03-03'
 
 -- make sure to update setup_config_from_cl() accordingly
 -- and set a default value in setup_config_from_defaults() if relevant
@@ -64,7 +64,7 @@
 Please email bugs to <texdoc at tug.org>.]]
 
 copyright_msg = [[
-Copyright 2008-2021 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2022 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.]]
 
@@ -104,7 +104,7 @@
 
 -- exit codes
 exit_ok = 0
-exit_error = 1 -- apparently hard-coded in Lua
+exit_error = 1  -- apparently hard-coded in Lua
 exit_usage = 2
 exit_notfound = 3
 
@@ -129,14 +129,35 @@
 }
 
 -- various cache or non-cache files
-cache_name = 'texdoc/cache-tlpdb.lua' -- relative to TEXMFVAR
+cache_name = 'texdoc/cache-tlpdb.lua'  -- relative to TEXMFVAR
 data_tlpdb_name = 'texdoc/Data.tlpdb.lua'
 
-place_holder = '%%s' -- used for viewer commands
+place_holder = '%%s'  -- used for viewer commands
 
 -- kpse path separator
 kpse_sep = (os.type == 'windows') and ';' or ':'
 
+-- language codes
+-- Note: corrected with `find $TEXMFDIST/doc/ | awk 'match(
+--       $0, /(.*)-(\w{2}).pdf/, a){print a[2]}'`
+lang_codes = {
+    cn = 'zh',  -- Chinese (alias)
+    cz = 'cz',  -- Chech/Slovak
+    de = 'de',  -- German
+    ee = 'et',  -- Estonian
+    en = 'en',  -- English
+    es = 'es',  -- Spanish
+    fr = 'fr',  -- French
+    it = 'it',  -- Italian
+    ja = 'ja',  -- Japanese
+    nl = 'nl',  -- Dutch
+    pl = 'pl',  -- Polish
+    ro = 'ro',  -- Romanian
+    ru = 'ru',  -- Russian
+    sr = 'sr',  -- Serbian
+    zh = 'zh',  -- Chinese
+}
+
 -- END constants
 
 -- get our previous environment back

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -5,6 +5,7 @@
 -- dependencies
 local md5 = require 'md5'
 local texdoc = {
+    const = require 'texdoclib-const',
     util = require 'texdoclib-util',
     config = require 'texdoclib-config',
 }
@@ -49,6 +50,26 @@
 
 ----------------------------   score computation   -----------------------------
 
+-- parse filename into <base>, <lang>, <ext>
+local function parse(filename)
+    local base, lang, ext
+    ext = texdoc.util.get_ext(filename)
+    if ext ~= nil and ext ~= '' then
+        base = filename:sub(1, -#ext - 2)
+    else
+        base = filename
+    end
+
+    for lc, _ in pairs(texdoc.const.lang_codes) do
+        local hyph_lc = '-' .. lc
+        if base:sub(-#hyph_lc) == hyph_lc then
+            return base:sub(1, -#hyph_lc - 1), lc, ext
+        end
+    end
+
+    return base, lang, ext
+end
+
 -- says if pat is a "subword" of str
 local function is_subword(str, pat)
     local function is_delim(str, i)
@@ -72,8 +93,8 @@
     return false
 end
 
--- compute a heuristic score -10 <= s < 10
-local function heuristic_score(file, pat, dbg_score)
+-- compute a pattern score -10 <= s < 10
+local function pattern_score(name, pat, dbg_score)
     dbg_score('Start heuristic scoring with pattern: ' .. pat)
 
     -- score management
@@ -84,24 +105,22 @@
             dbg_score('New heuristic score: %.1f. Reason: %s', s, reason)
         end
     end
-    local slash = not not string.find(pat, '/', 1, true)
 
     -- look for exact or subword match
-    if M.is_exact_locale(file, pat) then
-        upscore(5, 'exact match with correct locale')
-    elseif M.is_exact(file, pat) then
+    if M.is_exact(name, pat) then
         upscore(4, 'exact match')
-    elseif is_subword(file, pat) then
+    elseif is_subword(name, pat) then
         upscore(1, 'subword match')
     end
 
     -- try derivatives unless pat contains a slash
+    local slash = not not string.find(pat, '/', 1, true)
     if not slash then
         for _, suffix in ipairs(texdoc.config.get_value('suffix_list')) do
             local deriv = pat .. suffix
-            if M.is_exact(file, deriv) then
+            if M.is_exact(name, deriv) then
                 upscore(4.5, 'exact match for derived pattern: ' .. deriv)
-            elseif is_subword(file, deriv) then
+            elseif is_subword(name, deriv) then
                 upscore(3.5, 'subword match for derived pattern: ' .. deriv)
             end
         end
@@ -108,18 +127,18 @@
     end
 
     -- if extension is bad, score becomes an epsilon
-    local ext = texdoc.config.get_value('ext_list')[M.ext_pos(file)]
+    local ext = texdoc.config.get_value('ext_list')[M.ext_pos(name)]
     if ext and texdoc.config.get_value('badext_list_inv')[ext] and score > 0 then
         upscore(0.1, 'bad extension', true)
     end
 
     -- if basename is bad, score becomes an epsilon
-    if has_bad_basename(file) and score > 0 then
+    if has_bad_basename(name) and score > 0 then
         upscore(0.1, 'bad basename', true)
     end
 
     -- bonus for being in the right directory
-    if string.find('/' .. file, '/' .. pat .. '/', 1, true) and not slash then
+    if string.find('/' .. name, '/' .. pat .. '/', 1, true) and not slash then
         upscore(score + 1.5, 'directory bonus')
     end
 
@@ -146,12 +165,18 @@
 
     -- get score from patterns
     local score = -10
+    local is_alias = false
     for _, pat in ipairs(df.matches) do
         local s = -10
         local p = string.lower(pat.name)
         if pat.original then  -- non-alias
-            s = df.tree > -1 and heuristic_score(name, p, dbg_score) or 1
+            if df.tree > -1 then
+                s = pattern_score(name, p, dbg_score)
+            else
+                s = 1
+            end
         elseif M.is_exact(name, p) then  -- alias
+            is_alias = true
             local bonus, note = 0, ''
             if pat.locale then
                 bonus, note = 5, ', (language-based)'
@@ -185,6 +210,22 @@
         end
     end
 
+    -- bonus for locale
+    if not is_alias then
+        local config_lang = texdoc.config.get_value('lang')
+        local file_lang = df.lang
+
+        if not file_lang then
+            _, file_lang, _ = parse(name)
+            file_lang = texdoc.const.lang_codes[file_lang]
+        end
+
+        if config_lang == file_lang then
+            score = score + 1
+            dbg_score('Locale match bonus: +1.0')
+        end
+    end
+
     -- adjust from keyword-specific tables
     if df.tree > -1 and spec_adjscore[original_kw] then
         for pat, val in pairs(spec_adjscore[original_kw]) do
@@ -218,33 +259,29 @@
     end
 end
 
--- says if file is an exact match for pat
-function M.is_exact(file, pat)
-    file = texdoc.util.parse_zip(file)
-    local slashes = string.gsub(pat, '[^/]+', '[^/]+')
-    basename = string.match(file, slashes .. '$')
-    if not basename then return nil end
-    if basename == pat then return true end
-    for _, ext in ipairs(texdoc.config.get_value('ext_list')) do
-        if ext ~= '' and ext ~= '*' and basename == pat .. '.' .. ext then
-            return true
-        end
+-- says if filename is an exact match for pat
+function M.is_exact(filename, pattern)
+    local f_base, f_lang, f_ext = parse(filename)
+    local p_base, p_lang, p_ext = parse(pattern)
+
+    -- if the pattern contains lang, check if identical
+    if p_lang ~= nil and f_lang ~= p_lang then
+        return false
     end
-    return false
-end
 
--- says if file is an exact match for pat and the current locale
-function M.is_exact_locale(file, pat)
-    if string.match(pat, '%-%l%l%l?$') then
-        -- don't match if the pattern appears to include a language code
+    -- if the pattern contains ext, check if identical
+    if p_ext ~= nil and p_ext ~= '' and f_ext ~= p_ext then
         return false
     end
-    local lang = texdoc.config.get_value('lang')
-    if lang then
-        return M.is_exact(file, pat .. '-' .. lang)
-            or M.is_exact(file, lang .. '-' .. pat)
+
+    -- finally check the bases
+    if (f_base == p_base
+        or (f_base:sub(-#p_base) == p_base
+            and f_base:sub(-#p_base - 1, -#p_base - 1) == '/')) then
+        return true
+    else
+        return false
     end
-    return false
 end
 
 -- compare two docfile's: (see texdoclib-search.tlu for structure)

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -39,22 +39,9 @@
 -- (or known basename according to basename_list)
 local function check_ext(file)
     file = file:lower()
-    -- remove zipext if applicable
-    file = texdoc.util.parse_zip(file)
-    -- then do the normal thing
-    for _, e in ipairs(texdoc.config.get_value('ext_list')) do
-        if e == '*' then
-            return true
-        elseif (e == '') then
-            if not file:find('.', 1, true) then
-                return true
-            end
-        else
-            local dot_e = '.' .. e
-            if file:sub(-#dot_e) == dot_e then
-                return true
-            end
-        end
+    -- has a known extention?
+    if texdoc.util.get_ext(file) ~= nil then
+        return true
     end
     -- is the basename good?
     for _, b in ipairs(texdoc.config.get_value('basename_list')) do
@@ -443,6 +430,33 @@
 
 -- tlpdb means TeX Live Package DataBase and tlp means TeX Live Package
 
+-- return an iterator that ouputs the keys in order
+local function opairs(t)
+    local tkeys = {}
+
+    -- use the counter len to avoid the cost of table.insert and to save the
+    -- length of tkeys for later use in the iterator
+    local len = 0
+    for k, _ in pairs(t) do
+        len = len + 1
+        tkeys[len] = k
+    end
+
+    table.sort(tkeys)
+
+    local i = 0
+    local function iterator()
+        i = i + 1
+        if i > len then
+           return nil
+        else
+           return tkeys[i], t[tkeys[i]]
+        end
+    end
+
+    return iterator
+end
+
 -- return true if cache exists and is newer than original, false otherwise
 local function good_cache(cache, ori)
     local cache_date = lfs.attributes(cache, 'modification')
@@ -556,9 +570,9 @@
 
     -- s_meta
     printf('local s_meta = {\n')
-    for k, v in pairs(s_meta) do
+    for k, v in opairs(s_meta) do
         printf('  [%q] = {', k)
-        for i, j in pairs(v) do printf('[%q] = %q, ', i, j) end
+        for i, j in opairs(v) do printf('[%q] = %q, ', i, j) end
         printf('},\n')
     end
     printf('}\n')
@@ -565,9 +579,9 @@
 
     -- tlp_from_runfile
     printf('local tlp_from_runfile = {\n')
-    for k, v in pairs(tlp_from_runfile) do
+    for k, v in opairs(tlp_from_runfile) do
         printf('  [%q] = {', k)
-        for f in pairs(v) do printf('[%q]=true,', f) end
+        for f in opairs(v) do printf('[%q]=true,', f) end
         printf('},\n')
     end
     printf('}\n')
@@ -574,7 +588,7 @@
 
     -- tlp_doclist
     printf('local tlp_doclist = {\n')
-    for k, v in pairs(tlp_doclist) do
+    for k, v in opairs(tlp_doclist) do
         printf('  [%q] = {\n', k)
         for _, f in ipairs(v) do printf('    %q,\n', f) end
         printf('  },\n')

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -4,8 +4,8 @@
 
 -- dependencies
 local texdoc = {
-    const = require('texdoclib-const'),
-    config = require('texdoclib-config'),
+    const = require 'texdoclib-const',
+    config = require 'texdoclib-config',
 }
 
 -- shortcuts
@@ -103,18 +103,42 @@
 
 end -- end scope of active_debugs
 
--- if file is base .. '.' .. zip with zip in zipext_list, return: base, zip
--- otherwise, return: file, nil
-function M.parse_zip(file)
+-- if filename is base .. '.' .. zip with zip in zipext_list, return: base, zip
+-- otherwise, return: filename, nil
+function M.parse_zip(filename)
     local zip
     for _, zip in ipairs(texdoc.config.get_value('zipext_list')) do
         local l = #zip + 1
-        if string.sub(file, -l, -1) == '.' .. zip then
-            return string.sub(file, 1, -l - 1), zip
+        if string.sub(filename, -l, -1) == '.' .. zip then
+            return string.sub(filename, 1, -l - 1), zip
         end
     end
+    return filename, nil
+end
 
-    return file, nil
+-- take a known extension according to ext_list
+function M.get_ext(filename)
+    filename = M.parse_zip(filename)
+
+    for _, e in ipairs(texdoc.config.get_value('ext_list')) do
+        if e == '*' then
+            local dot = filename:find('.', 1, true)
+            if not dot then
+                return ''
+            else
+                return filename:sub(-dot + 1)
+            end
+        elseif (e == '') then
+            if not filename:find('.', 1, true) then
+                return ''
+            end
+        else
+            local dot_e = '.' .. e
+            if filename:sub(-#dot_e) == dot_e then
+                return dot_e:sub(2)
+            end
+        end
+    end
 end
 
 -- print a usage message

Modified: trunk/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
===================================================================
--- trunk/Master/texmf-dist/scripts/texdoc/texdoclib.tlu	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/scripts/texdoc/texdoclib.tlu	2022-03-03 21:09:20 UTC (rev 62379)
@@ -1,7 +1,7 @@
 -- texdoclib.tlu: the texdoc library
 
 --[[
-Copyright 2008-2021 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2022 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
 
 This program is free software: you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software

Modified: trunk/Master/texmf-dist/texdoc/texdoc.cnf
===================================================================
--- trunk/Master/texmf-dist/texdoc/texdoc.cnf	2022-03-03 21:08:55 UTC (rev 62378)
+++ trunk/Master/texmf-dist/texdoc/texdoc.cnf	2022-03-03 21:09:20 UTC (rev 62379)
@@ -84,6 +84,9 @@
 # basename_list = readme, 00readme
 # badbasename_list = readme, 00readme
 
+# Known suffixes for documentation
+suffix_list = doc, -doc, _doc, .doc, /doc, manual, /manual, -manual, userguide, /user_guide, -guide, -user, man, -man, notes, -info, ref
+
 ## Fuzzy search
 
 # Built-in defaults (for reference):
@@ -90,9 +93,6 @@
 #
 # fuzzy_level = 3
 
-# Known suffixes for documentation
-suffix_list = doc, -doc, _doc, .doc, /doc, manual, /manual, -manual, userguide, /user_guide, -guide, -user, -man, notes, -info, ref
-
 # Score adjustments
 # =================
 
@@ -183,6 +183,7 @@
 adjscore(beamer) beamer-FUBerlin = -3
 adjscore(beamer) beamer-tut-pt = -10
 adjscore(beamer) presentations = -10
+adjscore(beamerarticle) bsp-beamerarticle = -10
 
 # misc
 adjscore(context) circuitikz = -10
@@ -384,10 +385,6 @@
 # tugboat package and classes
 alias tugboat = ltubguid
 
-# caption
-alias caption = caption-eng
-alias caption-dev = caption-eng
-
 # metapost by various names
 alias metapost = mpman
 alias(5) metapost = mpgraph
@@ -444,11 +441,13 @@
 alias cmsuper = cm-super/README
 alias(5) cmsuper = cm-super/FAQ
 alias croatian = babel
-alias cweb = cwebman               # XXX: is in 'cweb' dir, should win
 alias cyrillic = cyrillic/README
 alias dtk = dtk/doc/beispiel.pdf
 alias einfuehrung = einfuehrung/README # tl should get "readme" tag
 alias elsarticle = elsdoc
+alias feynmp = fmfman
+alias flowfram = ffuserguide
+alias flowfram-dev = flowfram.pdf
 alias(0.1) fontinst = fontinstallationguide
 alias hyperref-dev = hyperref.pdf
 alias iso = isoman
@@ -499,7 +498,6 @@
 alias akletter = akletter/lettereng
 alias arydshln = arydshln-man
 alias cv = curve/curve
-alias datenumber-de = datenumber/docgerman
 alias labels(1) = envlab/elguide
 alias expressg = expeg
 alias flcards = flashcards



More information about the tex-live-commits mailing list.