summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-20 19:57:54 +0000
committerKarl Berry <karl@freefriends.org>2021-06-20 19:57:54 +0000
commit1fd83a5e467e9bc72220664c2ced44600eae89de (patch)
tree873d107911ea6e1c14fc5e05f8cdf5b0b3ee9095
parent6586e04e3d94e8f8f6e7459fd81b8b45937deaef (diff)
ctanbib (20jun21)
git-svn-id: svn://tug.org/texlive/trunk@59659 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/ctanbib/ctanbib27
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl29
-rw-r--r--Master/texmf-dist/doc/man/man1/ctanbib.12
-rw-r--r--Master/texmf-dist/doc/man/man1/ctanbib.man1.pdfbin20186 -> 21346 bytes
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/README.md2
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdfbin34681 -> 35575 bytes
-rw-r--r--Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex6
-rwxr-xr-xMaster/texmf-dist/scripts/ctanbib/ctanbib27
8 files changed, 64 insertions, 29 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib b/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
index 21adfd46792..a16976acdc4 100755
--- a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
+++ b/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
@@ -16,26 +16,38 @@ kpse.set_program_name("luatex")
-- The Current Maintainer of this work is Michal Hoftich
local bibtype = "manual"
+local pkgurl = false
if #arg < 1 or arg[1]=="--help" or arg[1]=="-h" then
print([[ctanbib - convert ctan package information to bibtex format
Usage:
ctanbib [options] <package name>
Available options:
- -c,--ctan Use @ctan type instead of @manual
+ -c,--ctan Use @ctan type instead of @manual and long url
+ -C,--CTAN Use @ctan type and short ... /pkg/url
-h,--help Print this message
-v,--version Print version info
]])
- os.exit(1)
+ os.exit(0)
elseif arg[1]=="--version" or arg[1]=="-v" then
- print "ctanbib version 0.1d"
- os.exit(1)
+ print "ctanbib version 0.1e"
+ os.exit(0)
elseif arg[1]=="--ctan" or arg[1]=="-c" then
table.remove(arg, 1)
bibtype = "ctan"
+elseif arg[1]=="--CTAN" or arg[1]=="-C" then
+ table.remove(arg, 1)
+ bibtype = "ctan"
+ pkgurl = true
end
local pkgname = arg[1]
-local url = "https://www.ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
+
+if not pkgname then
+ print "[ctanbib] Error: missing package name"
+ os.exit(1)
+end
+
+local url = "https://ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
local authors_url = "https://ctan.org/xml/2.0/authors"
-- change that for different title scheme
@@ -55,7 +67,6 @@ version = {$version}
local dom = require('luaxml-domobject')
-
local load_xml = function(url)
-- local command = io.popen("wget -qO- ".. url,"r")
local command = io.popen("curl -sS ".. url,"r")
@@ -142,7 +153,7 @@ end
local get_url = function(record)
local home = record:query_selector("home")[1]
if home then return home:get_attribute("href") end
- return "http://www.ctan.org/pkg/"..pkgname
+ return "https://ctan.org/pkg/"..pkgname
end
local get_caption = function(record)
@@ -191,7 +202,7 @@ e.title = get_title(record)
e.subtitle = get_caption(record)
e.url = get_url(record)
-- use the CTAN path as url for the CTAN type
-if bibtype == "ctan" then
+if (bibtype == "ctan") and not pkgurl then
e.url = ctan_url(record)
end
e.version, e.date = get_version(record)
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 9e19aa3b432..7f05bde595e 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,12 +1,12 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 59568 2021-06-12 22:02:32Z karl $
+# $Id: tlmgr.pl 59637 2021-06-19 15:17:38Z karl $
#
# Copyright 2008-2021 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-my $svnrev = '$Revision: 59568 $';
-my $datrev = '$Date: 2021-06-13 00:02:32 +0200 (Sun, 13 Jun 2021) $';
+my $svnrev = '$Revision: 59637 $';
+my $datrev = '$Date: 2021-06-19 17:17:38 +0200 (Sat, 19 Jun 2021) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
@@ -2574,7 +2574,8 @@ sub auto_remove_install_force_packages {
next if $removals_full{$p};
my $remotetlp = $remotetlpdb->get_package($p);
if (!defined($remotetlp)) {
- tlwarn("$prg: Strange, $p mentioned but not found anywhere!\n");
+ tlwarn("$prg:auto_remove_install_force_packages: strange, package "
+ . "mentioned but not found anywhere: $p\n");
next;
}
next if ($remotetlp->category ne "Collection");
@@ -4109,7 +4110,8 @@ sub show_one_package_list {
if (@cand) {
my $first = shift @cand;
if (defined($first)) {
- tlwarn("$prg: strange, we have a first candidate but no tlp: $p\n");
+ tlwarn("$prg:show_one_package_list: strange, have first "
+ . "candidate but no tlp: $p\n");
return($F_WARNING);
}
# already shifted away the first element
@@ -4122,19 +4124,23 @@ sub show_one_package_list {
my ($t,$r) = split(/\//, $a, 2);
my $tlp = $remotetlpdb->get_package($p, $t);
my $foo = $tlp->shortdesc;
- print " $t: ", defined($foo) ? $foo : "(shortdesc missing)" , "\n";
+ print " $t: ",
+ defined($foo) ? $foo : "(shortdesc missing)" , "\n";
}
return($F_WARNING);
} else {
- tlwarn("$prg: strange, package listed but no residual candidates: $p\n");
+ tlwarn("$prg:show_one_package_list: strange, package listed "
+ . "but no residual candidates: $p\n");
return($F_WARNING);
}
} else {
- tlwarn("$prg: strange, package listed but no candidates: $p\n");
+ tlwarn("$prg:show_one_package_list: strange, package listed but "
+ . "no candidates: $p\n");
return($F_WARNING);
}
} else {
- tlwarn("$prg: strange, package cannot be found in remote tlpdb: $p\n");
+ tlwarn("$prg:show_one_package_list: strange, package not found in "
+ . "remote tlpdb: $p\n");
return($F_WARNING);
}
}
@@ -4189,7 +4195,8 @@ sub show_one_package_detail {
# useless test, @cand will always be defined because $remotetlpdb is virtual
my $first = shift @cand;
if (defined($first)) {
- tlwarn("$prg: strange, we have a first candidate but no tlp: $pkg\n");
+ tlwarn("$prg:show_one_package_detail: strange, have first candidate "
+ . "but no tlp: $pkg\n");
return($F_WARNING);
}
# already shifted away the first element
@@ -10224,7 +10231,7 @@ This script and its documentation were written for the TeX Live
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 59568 2021-06-12 22:02:32Z karl $
+$Id: tlmgr.pl 59637 2021-06-19 15:17:38Z karl $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.1 b/Master/texmf-dist/doc/man/man1/ctanbib.1
index baa40b1190a..54544054c89 100644
--- a/Master/texmf-dist/doc/man/man1/ctanbib.1
+++ b/Master/texmf-dist/doc/man/man1/ctanbib.1
@@ -13,6 +13,8 @@ CTAN in the BibTeX format.
.IP -c,--ctan
use @ctan type instead of @manual. The difference between the two is that the
url field contains package CTAN path, instead of link to the package.
+.IP -C,--CTAN
+like --ctan option, but use original url instead of CTAN path.
.IP -h,--help
print the help message.
.IP -v,--version
diff --git a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
index 975df448c6f..7741af220b5 100644
--- a/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ctanbib/README.md b/Master/texmf-dist/doc/support/ctanbib/README.md
index edd016e5619..263cd82a1a1 100644
--- a/Master/texmf-dist/doc/support/ctanbib/README.md
+++ b/Master/texmf-dist/doc/support/ctanbib/README.md
@@ -10,7 +10,7 @@ This script can generate BibTeX records for LaTeX packages hosted on CTAN.
More details can be found on [TeX.sx](https://tex.stackexchange.com/a/200856/2891)
-Copyright: 2018 Michal Hoftich
+Copyright: 2019 Michal Hoftich
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
index b665ab7762e..ec58084d270 100644
--- a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
+++ b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
index 651d0058e6c..89b99279b51 100644
--- a/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
+++ b/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
@@ -36,6 +36,7 @@ The \texttt{curl} utility needs to be installed on the user's system in order to
\item[-c,-\/-ctan] use the \texttt{@ctan} type instead of \texttt{@manual}.
The difference between the two is that the url field contains packages CTAN
path, instead of a link to the package.
+ \item[-C,-\/-CTAN] like \verb|--ctan| option, but use original url instead of CTAN path.
\item[-h,-\/-help] print the help message.
\item[-v,-\/-version] print the version info.
\end{description}
@@ -93,12 +94,15 @@ under the terms of the \LaTeX\ Project Public License, version 1.3.
This package was created thanks to TeX.sx user
Daniel\footnote{\url{https://tex.stackexchange.com/users/3751/daniel}}. Lukas
C.~Bossert had useful comments which led to update of the original script and
-it's eventual release on CTAN.
+it's eventual release on CTAN. Herbert Voss added the \verb|--CTAN| option.
\newpage
\section{Changelog}
\begin{changelog}
+ \change{2021-06-20}{Added \verb|--CTAN| option, thanks to Herbert Voss}
+ \change{2019-12-23}{Don't return non-zero exit codes for non-error runs}
+ \change{2019-12-23}{Test for the packagename with the \texttt{-c} option}
\change{2019-09-21}{Try to find the author in full CTAN author list if the author cannot be found in the package info}
\change{2019-09-16}{Use the CTAN API 2.0 to fetch the package info}
\change{2019-05-04}{Version 0.1c released}
diff --git a/Master/texmf-dist/scripts/ctanbib/ctanbib b/Master/texmf-dist/scripts/ctanbib/ctanbib
index 21adfd46792..a16976acdc4 100755
--- a/Master/texmf-dist/scripts/ctanbib/ctanbib
+++ b/Master/texmf-dist/scripts/ctanbib/ctanbib
@@ -16,26 +16,38 @@ kpse.set_program_name("luatex")
-- The Current Maintainer of this work is Michal Hoftich
local bibtype = "manual"
+local pkgurl = false
if #arg < 1 or arg[1]=="--help" or arg[1]=="-h" then
print([[ctanbib - convert ctan package information to bibtex format
Usage:
ctanbib [options] <package name>
Available options:
- -c,--ctan Use @ctan type instead of @manual
+ -c,--ctan Use @ctan type instead of @manual and long url
+ -C,--CTAN Use @ctan type and short ... /pkg/url
-h,--help Print this message
-v,--version Print version info
]])
- os.exit(1)
+ os.exit(0)
elseif arg[1]=="--version" or arg[1]=="-v" then
- print "ctanbib version 0.1d"
- os.exit(1)
+ print "ctanbib version 0.1e"
+ os.exit(0)
elseif arg[1]=="--ctan" or arg[1]=="-c" then
table.remove(arg, 1)
bibtype = "ctan"
+elseif arg[1]=="--CTAN" or arg[1]=="-C" then
+ table.remove(arg, 1)
+ bibtype = "ctan"
+ pkgurl = true
end
local pkgname = arg[1]
-local url = "https://www.ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
+
+if not pkgname then
+ print "[ctanbib] Error: missing package name"
+ os.exit(1)
+end
+
+local url = "https://ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
local authors_url = "https://ctan.org/xml/2.0/authors"
-- change that for different title scheme
@@ -55,7 +67,6 @@ version = {$version}
local dom = require('luaxml-domobject')
-
local load_xml = function(url)
-- local command = io.popen("wget -qO- ".. url,"r")
local command = io.popen("curl -sS ".. url,"r")
@@ -142,7 +153,7 @@ end
local get_url = function(record)
local home = record:query_selector("home")[1]
if home then return home:get_attribute("href") end
- return "http://www.ctan.org/pkg/"..pkgname
+ return "https://ctan.org/pkg/"..pkgname
end
local get_caption = function(record)
@@ -191,7 +202,7 @@ e.title = get_title(record)
e.subtitle = get_caption(record)
e.url = get_url(record)
-- use the CTAN path as url for the CTAN type
-if bibtype == "ctan" then
+if (bibtype == "ctan") and not pkgurl then
e.url = ctan_url(record)
end
e.version, e.date = get_version(record)