texlive[56466] trunk: texdef (28sep20)

commits+karl at tug.org commits+karl at tug.org
Mon Sep 28 23:01:51 CEST 2020


Revision: 56466
          http://tug.org/svn/texlive?view=revision&revision=56466
Author:   karl
Date:     2020-09-28 23:01:50 +0200 (Mon, 28 Sep 2020)
Log Message:
-----------
texdef (28sep20)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/texdef/texdef.pl
    trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
    trunk/Master/texmf-dist/doc/support/texdef/CHANGELOG
    trunk/Master/texmf-dist/doc/support/texdef/README
    trunk/Master/texmf-dist/doc/support/texdef/texdef.pdf
    trunk/Master/texmf-dist/scripts/texdef/texdef.pl
    trunk/Master/texmf-dist/source/support/texdef/texdef.tex

Modified: trunk/Build/source/texk/texlive/linked_scripts/texdef/texdef.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texdef/texdef.pl	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Build/source/texk/texlive/linked_scripts/texdef/texdef.pl	2020-09-28 21:01:50 UTC (rev 56466)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 ################################################################################
 #  texdef -- Show definitions of TeX commands
-#  Copyright (c) 2011-2012 Martin Scharrer <martin at scharrer-online.de>
+#  Copyright (c) 2011-2020 Martin Scharrer <martin at scharrer-online.de>
 #
 #  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
@@ -116,14 +116,14 @@
 my $BEGINENVSTR = '%s';
 my $ENDENVSTR   = '%s';
 
-my $VERSION = 'Version 1.8a -- 2018/03/28';
+my $VERSION = 'Version 1.9 -- 2020/09/27';
 sub usage {
     my $option = shift;
     my $ret    = ($option) ? 0 : 1;
 print << 'EOT';
 texdef -- Show definitions of TeX commands
-Version 1.8a -- 2019/03/28
-Copyright (C) 2011-2018  Martin Scharrer <martin at scharrer-online.de>
+Version 1.9 -- 2020/09/27
+Copyright (C) 2011-2020  Martin Scharrer <martin at scharrer-online.de>
 This program comes with ABSOLUTELY NO WARRANTY;
 This is free software, and you are welcome to redistribute it under certain conditions;
 
@@ -136,6 +136,7 @@
 Options:
   --tex <format>, -t <format>   : Use given format of TeX: 'tex', 'latex', 'context'.
                                   Variations of 'tex' and 'latex', like 'luatex', 'lualatex', 'xetex', 'xelatex' are supported.
+                                  The postfix '-dev' for develop versions of the format is also supported (e.g. 'latex-dev').
                                   The default is given by the used program name: 'texdef' -> 'tex', 'latexdef' -> 'latex', etc.
   --texoptions <options>        : Call (La)TeX with the given options.
   --source, -s                  : Try to show the original source code of the command definition (L).
@@ -306,23 +307,23 @@
 }
 
 ## Format specific settings
-if ($TEX =~ /latex$/) {
+if ($TEX =~ /latex(?:-dev)?$/) {
   $ISLATEX = 1;
   $BEGINENVSTR = '\begin{%s}' . "\n";
   $ENDENVSTR   = '\end{%s}'   . "\n";
 }
-elsif ($TEX =~ /tex$/) {
+elsif ($TEX =~ /tex(?:-dev)?$/) {
   $ISTEX   = 1;
   $BEGINENVSTR = '\%s' . "\n";
   $ENDENVSTR   = '\end%s' . "\n";
 }
-elsif ($TEX =~ /context$/) {
+elsif ($TEX =~ /context(?:-dev)?$/) {
   $ISCONTEXT = 1;
   $BEGINENVSTR = '\start%s' . "\n";
   $ENDENVSTR   = '\stop%s'  . "\n";
 }
 
-if ($TEX =~ /^dvi((la)?tex)$/) {
+if ($TEX =~ /^dvi((la)?tex)(?:-dev)?$/) {
   $TEX = $1;
   $TEXOPTIONS .= ' -output-format=dvi '
 }
@@ -774,6 +775,16 @@
     return $found;
 }
 
+sub cleanpath {
+    my $path = shift;
+    chomp $path;
+    if ($path =~ /[a-z]:/i) {
+        $path =~ s/\//\\/g;
+    }
+    return $path;
+}
+
+
 open (my $texpipe, '-|', "$TEX $TEXOPTIONS $USERTEXOPTIONS \"$TMPFILE\" ");
 
 my $name = '';
@@ -786,8 +797,7 @@
     my $line = $1;
     if ($FINDDEF == 2) {
         if ($line =~ /first defined in "(.*)"/) {
-            my $path = `kpsewhich "$1"`;
-            chomp $path;
+            my $path = cleanpath(`kpsewhich "$1"`);
             $line =~ s/$1/$path/;
         }
     }
@@ -794,13 +804,13 @@
     if ($PRINTORIGDEF) {
         if ($line =~ /first defined in "(.*)"/) {
             my $file = $1;
-            my $path = `kpsewhich "$file"`;
+            my $path = cleanpath(`kpsewhich "$file"`);
             chomp $path;
             $origdeffound = print_orig_def($cmd, $file, $path);
         }
         elsif ($line =~ /is defined by \(La\)TeX./) {
             my $file = 'latex.ltx';
-            my $path = `kpsewhich "$file"`;
+            my $path = cleanpath(`kpsewhich "$file"`);
             chomp $path;
             $file = $path if $FINDDEF > 1;
             $origdeffound = print_orig_def($cmd, $file, $path);

Modified: trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl	2020-09-28 21:01:50 UTC (rev 56466)
@@ -1,12 +1,12 @@
 #!/usr/bin/env perl
-# $Id: tlmgr.pl 56372 2020-09-18 05:52:26Z preining $
+# $Id: tlmgr.pl 56458 2020-09-27 22:20:18Z preining $
 #
 # Copyright 2008-2020 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
 # or any later version.
 
-my $svnrev = '$Revision: 56372 $';
-my $datrev = '$Date: 2020-09-18 07:52:26 +0200 (Fri, 18 Sep 2020) $';
+my $svnrev = '$Revision: 56458 $';
+my $datrev = '$Date: 2020-09-28 00:20:18 +0200 (Mon, 28 Sep 2020) $';
 my $tlmgrrevision;
 my $tlmgrversion;
 my $prg;
@@ -1603,7 +1603,7 @@
     my $load_remote = 0;
     for my $d (@datafields) {
       $load_remote = 1 if ($d eq "remoterev");
-      if ($d !~ m/^(name|category|localrev|remoterev|shortdesc|longdesc|size|installed|relocatable|depends|cat-version|cat-date|cat-license|cat-contact-.*)$/) {
+      if ($d !~ m/^(name|category|localrev|remoterev|shortdesc|longdesc|size|installed|relocatable|depends|[lr]?cat-version|[lr]?cat-date|[lr]?cat-license|[lr]?cat-contact-.*)$/) {
         tlwarn("unknown data field: $d\n");
         return($F_ERROR);
       }
@@ -3911,6 +3911,7 @@
                           installed => ($is_installed ? TeXLive::TLUtils::True() : TeXLive::TLUtils::False()),
                           lrev      => ($is_installed ? $loctlp->revision : 0),
                           rrev      => ($is_available ? $remtlp->revision : 0),
+                          rcataloguedata => ($is_available ? $remtlp->cataloguedata : {}),
                           revision  => undef);
   print $str;
   return($F_OK);
@@ -3961,12 +3962,28 @@
       push @out, ($tlp->relocated ? 1 : 0);
     } elsif ($d eq "cat-version") {
       push @out, ($tlp->cataloguedata->{'version'} || "");
+    } elsif ($d eq "lcat-version") {
+      push @out, ($is_installed ? ($loctlp->cataloguedata->{'version'} || "") : "");
+    } elsif ($d eq "rcat-version") {
+      push @out, ($is_available ? ($remtlp->cataloguedata->{'version'} || "") : "");
     } elsif ($d eq "cat-date") {
       push @out, ($tlp->cataloguedata->{'date'} || "");
+    } elsif ($d eq "lcat-date") {
+      push @out, ($is_installed ? ($loctlp->cataloguedata->{'date'} || "") : "");
+    } elsif ($d eq "rcat-date") {
+      push @out, ($is_available ? ($remtlp->cataloguedata->{'date'} || "") : "");
     } elsif ($d eq "cat-license") {
       push @out, ($tlp->cataloguedata->{'license'} || "");
+    } elsif ($d eq "lcat-license") {
+      push @out, ($is_installed ? ($loctlp->cataloguedata->{'license'} || "") : "");
+    } elsif ($d eq "rcat-license") {
+      push @out, ($is_available ? ($remtlp->cataloguedata->{'license'} || "") : "");
     } elsif ($d =~ m/^cat-(contact-.*)$/) {
       push @out, ($tlp->cataloguedata->{$1} || "");
+    } elsif ($d =~ m/^lcat-(contact-.*)$/) {
+      push @out, ($is_installed ? ($loctlp->cataloguedata->{$1} || "") : "");
+    } elsif ($d =~ m/^rcat-(contact-.*)$/) {
+      push @out, ($is_available ? ($remtlp->cataloguedata->{$1} || "") : "");
     } elsif ($d eq "localrev") {
       push @out, ($is_installed ? $loctlp->revision : 0);
     } elsif ($d eq "remoterev") {
@@ -8332,11 +8349,16 @@
 If the option C<--data> is given, its argument must be a comma separated
 list of field names from: C<name>, C<category>, C<localrev>, C<remoterev>,
 C<shortdesc>, C<longdesc>, C<installed>, C<size>, C<relocatable>, C<depends>,
-C<cat-version>, C<cat-date>, or C<cat-license>. In this case the requested
-packages' information is listed in CSV format one package per line, and the
-column information is given by the C<itemN>. The C<depends> column contains
-the name of all dependencies separated by C<:>.
+C<cat-version>, C<cat-date>, or C<cat-license>, and various C<cat-contact-*>
+fields. For the C<cat-> fields, there are two more variants with prefix C<l>
+and C<r>, that is C<lcat-version> and C<rcat-version> etc, which indicate
+the local and remote information, respectively. The variants without C<l> and
+C<r> show the most current one, that is normally the remote one.
 
+The requested packages' information is listed in CSV format one package per
+line, and the column information is given by the C<itemN>. The C<depends>
+column contains the name of all dependencies separated by C<:>.
+
 =item B<--json>
 
 In case C<--json> is specified, the output is a
@@ -10065,7 +10087,7 @@
 distribution (L<https://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-$Id: tlmgr.pl 56372 2020-09-18 05:52:26Z preining $
+$Id: tlmgr.pl 56458 2020-09-27 22:20:18Z preining $
 =cut
 
 # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html

Modified: trunk/Master/texmf-dist/doc/support/texdef/CHANGELOG
===================================================================
--- trunk/Master/texmf-dist/doc/support/texdef/CHANGELOG	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Master/texmf-dist/doc/support/texdef/CHANGELOG	2020-09-28 21:01:50 UTC (rev 56466)
@@ -1,5 +1,12 @@
 = Changelog =
 
+== v1.9 from 2020/09/27 ==
+ * Added support for develop versions of formats, e.g. 'latex-dev'.
+
+== v1.8c from 2019/01/15 ==
+ * Changed path printing format to native format of the used OS 
+   (e.g. under Windows file paths now habe `\` instead of `/`)
+
 == v1.8a from 2018/03/28 ==
  * Further fixes of braces in regexs to avoid "Unescaped left brace in regex is deprecated" warnings or errors.
 

Modified: trunk/Master/texmf-dist/doc/support/texdef/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/texdef/README	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Master/texmf-dist/doc/support/texdef/README	2020-09-28 21:01:50 UTC (rev 56466)
@@ -1,6 +1,6 @@
 texdef -- Show definitions of TeX commands
-Version 1.8a -- 2019/03/28
-Copyright (C) 2011-2018  Martin Scharrer <martin at scharrer-online.de>
+Version 1.9 -- 2020/09/27
+Copyright (C) 2011-2020  Martin Scharrer <martin at scharrer-online.de>
 This program comes with ABSOLUTELY NO WARRANTY;
 This is free software, and you are welcome to redistribute it under certain conditions;
 
@@ -13,6 +13,7 @@
 Options:
   --tex <format>, -t <format>   : Use given format of TeX: 'tex', 'latex', 'context'.
                                   Variations of 'tex' and 'latex', like 'luatex', 'lualatex', 'xetex', 'xelatex' are supported.
+                                  The postfix '-dev' for develop versions of the format is also supported (e.g. 'latex-dev').
                                   The default is given by the used program name: 'texdef' -> 'tex', 'latexdef' -> 'latex', etc.
   --texoptions <options>        : Call (La)TeX with the given options.
   --source, -s                  : Try to show the original source code of the command definition (L).

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

Modified: trunk/Master/texmf-dist/scripts/texdef/texdef.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texdef/texdef.pl	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Master/texmf-dist/scripts/texdef/texdef.pl	2020-09-28 21:01:50 UTC (rev 56466)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 ################################################################################
 #  texdef -- Show definitions of TeX commands
-#  Copyright (c) 2011-2012 Martin Scharrer <martin at scharrer-online.de>
+#  Copyright (c) 2011-2020 Martin Scharrer <martin at scharrer-online.de>
 #
 #  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
@@ -116,14 +116,14 @@
 my $BEGINENVSTR = '%s';
 my $ENDENVSTR   = '%s';
 
-my $VERSION = 'Version 1.8a -- 2018/03/28';
+my $VERSION = 'Version 1.9 -- 2020/09/27';
 sub usage {
     my $option = shift;
     my $ret    = ($option) ? 0 : 1;
 print << 'EOT';
 texdef -- Show definitions of TeX commands
-Version 1.8a -- 2019/03/28
-Copyright (C) 2011-2018  Martin Scharrer <martin at scharrer-online.de>
+Version 1.9 -- 2020/09/27
+Copyright (C) 2011-2020  Martin Scharrer <martin at scharrer-online.de>
 This program comes with ABSOLUTELY NO WARRANTY;
 This is free software, and you are welcome to redistribute it under certain conditions;
 
@@ -136,6 +136,7 @@
 Options:
   --tex <format>, -t <format>   : Use given format of TeX: 'tex', 'latex', 'context'.
                                   Variations of 'tex' and 'latex', like 'luatex', 'lualatex', 'xetex', 'xelatex' are supported.
+                                  The postfix '-dev' for develop versions of the format is also supported (e.g. 'latex-dev').
                                   The default is given by the used program name: 'texdef' -> 'tex', 'latexdef' -> 'latex', etc.
   --texoptions <options>        : Call (La)TeX with the given options.
   --source, -s                  : Try to show the original source code of the command definition (L).
@@ -306,23 +307,23 @@
 }
 
 ## Format specific settings
-if ($TEX =~ /latex$/) {
+if ($TEX =~ /latex(?:-dev)?$/) {
   $ISLATEX = 1;
   $BEGINENVSTR = '\begin{%s}' . "\n";
   $ENDENVSTR   = '\end{%s}'   . "\n";
 }
-elsif ($TEX =~ /tex$/) {
+elsif ($TEX =~ /tex(?:-dev)?$/) {
   $ISTEX   = 1;
   $BEGINENVSTR = '\%s' . "\n";
   $ENDENVSTR   = '\end%s' . "\n";
 }
-elsif ($TEX =~ /context$/) {
+elsif ($TEX =~ /context(?:-dev)?$/) {
   $ISCONTEXT = 1;
   $BEGINENVSTR = '\start%s' . "\n";
   $ENDENVSTR   = '\stop%s'  . "\n";
 }
 
-if ($TEX =~ /^dvi((la)?tex)$/) {
+if ($TEX =~ /^dvi((la)?tex)(?:-dev)?$/) {
   $TEX = $1;
   $TEXOPTIONS .= ' -output-format=dvi '
 }
@@ -774,6 +775,16 @@
     return $found;
 }
 
+sub cleanpath {
+    my $path = shift;
+    chomp $path;
+    if ($path =~ /[a-z]:/i) {
+        $path =~ s/\//\\/g;
+    }
+    return $path;
+}
+
+
 open (my $texpipe, '-|', "$TEX $TEXOPTIONS $USERTEXOPTIONS \"$TMPFILE\" ");
 
 my $name = '';
@@ -786,8 +797,7 @@
     my $line = $1;
     if ($FINDDEF == 2) {
         if ($line =~ /first defined in "(.*)"/) {
-            my $path = `kpsewhich "$1"`;
-            chomp $path;
+            my $path = cleanpath(`kpsewhich "$1"`);
             $line =~ s/$1/$path/;
         }
     }
@@ -794,13 +804,13 @@
     if ($PRINTORIGDEF) {
         if ($line =~ /first defined in "(.*)"/) {
             my $file = $1;
-            my $path = `kpsewhich "$file"`;
+            my $path = cleanpath(`kpsewhich "$file"`);
             chomp $path;
             $origdeffound = print_orig_def($cmd, $file, $path);
         }
         elsif ($line =~ /is defined by \(La\)TeX./) {
             my $file = 'latex.ltx';
-            my $path = `kpsewhich "$file"`;
+            my $path = cleanpath(`kpsewhich "$file"`);
             chomp $path;
             $file = $path if $FINDDEF > 1;
             $origdeffound = print_orig_def($cmd, $file, $path);

Modified: trunk/Master/texmf-dist/source/support/texdef/texdef.tex
===================================================================
--- trunk/Master/texmf-dist/source/support/texdef/texdef.tex	2020-09-28 21:00:47 UTC (rev 56465)
+++ trunk/Master/texmf-dist/source/support/texdef/texdef.tex	2020-09-28 21:01:50 UTC (rev 56466)
@@ -4,8 +4,8 @@
 \title{The \textsf{texdef} script}
 \author{Martin Scharrer}
 \email{martin at scharrer-online.de}
-\repository{https://bitbucket.org/martin_scharrer/texdef}
-\date{Version 1.8a -- 2018/03/28}
+\repository{https://sourceforge.net/projects/texdef/}
+\date{Version 1.9 -- 2020/09/27}
 
 \makeatletter
 \DeclareRobustCommand{\LATeX}{%
@@ -53,6 +53,7 @@
 \begin{options}
   --tex \MacroArgs<format>, -t \MacroArgs<format>    \csep Use given format of TeX: 'tex', 'latex', 'context'.
                                                        Variations of 'tex' and 'latex', like 'luatex', 'lualatex', 'xetex', 'xelatex' are supported.
+                                                       The postfix '-dev' for develop versions of the format is also supported (e.g. 'latex-dev').
                                                        The default is given by the used program name: 'texdef' -> 'tex', 'latexdef' -> 'latex', etc.\cend
   --texoptions \MacroArgs<options>                   \csep Call \LaTeX/\TeX{} with the given options.\cend
   --source, -s                                       \csep Try to show the original source code of the command definition (L).\cend
@@ -201,6 +202,17 @@
 
 \section{Changelog}
 
+\subsection*{v1.9 from 2020/09/27}
+\begin{itemize}
+ \item Added support for develop versions of the formats, e.g.\ "latex-dev".
+\end{itemize}
+
+\subsection*{v1.8c from 2010/01/15}
+\begin{itemize}
+ \item Changed path printing format to native format of the used OS 
+      (e.g. under Windows file paths now habe `\textbackslash' instead of `/')
+\end{itemize}
+
 \subsection*{v1.8a from 2018/03/28}
 \begin{itemize}
  \item Further fixes of braces in regexs to avoid ``Unescaped left brace in regex is deprecated'' warnings or errors.



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