texlive[66068] trunk: ctanbib (23feb23)

commits+karl at tug.org commits+karl at tug.org
Thu Feb 23 00:31:12 CET 2023


Revision: 66068
          http://tug.org/svn/texlive?view=revision&revision=66068
Author:   karl
Date:     2023-02-23 00:31:12 +0100 (Thu, 23 Feb 2023)
Log Message:
-----------
ctanbib (23feb23)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
    trunk/Master/texmf-dist/doc/man/man1/ctanbib.1
    trunk/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
    trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
    trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
    trunk/Master/texmf-dist/scripts/ctanbib/ctanbib

Modified: trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib	2023-02-22 23:30:40 UTC (rev 66067)
+++ trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib	2023-02-22 23:31:12 UTC (rev 66068)
@@ -34,7 +34,7 @@
   print(msg)
   os.exit(0)
 elseif args.version then
-  print "ctanbib version 0.2a"
+  print "ctanbib version 0.2b"
   os.exit(0)
 elseif args.ctan then
   pkgurl = true
@@ -76,15 +76,18 @@
 
 local dom = require('luaxml-domobject')
 
-local load_xml =  function(url)
+local load_xml =  function(url, verification)
   -- local command = io.popen("wget -qO- ".. url,"r")
-  local command = io.popen("curl -sS ".. url,"r")
+  local command = io.popen("curl --ssl-no-revoke -sS ".. url,"r")
+  local verification = verification or ""
 
+  if not command then return nil, "Cannot open Curl" end
+
   local info = command:read("*all")
   command:close()
 
-  if string.len(info) == 0 then
-    return false
+  if not info or string.len(info) == 0 or not info:match(verification) then
+    return nil, "Cannot load XML", info 
   end
   return dom.parse(info ), info
 end
@@ -102,7 +105,11 @@
 local author_list
 local fetch_author_list = function()
   if author_list then return author_list end
-  local authors = load_xml(authors_url)
+  local authors, msg = load_xml(authors_url, "<authors")
+  if not authors then 
+    print(msg)
+    os.exit()
+  end
   author_list = {}
   for _, author in ipairs(authors:query_selector("author")) do
     -- save all authors under they ID 
@@ -204,7 +211,7 @@
 
 for _, pkgname in ipairs(args) do
   local url = "https://ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
-  local record, info = load_xml(url)
+  local record, info = load_xml(url, "%<entry")
 
   if not verify_record(record) then
     print("% Cannot find entry for package "..pkgname)

Modified: trunk/Master/texmf-dist/doc/man/man1/ctanbib.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/ctanbib.1	2023-02-22 23:30:40 UTC (rev 66067)
+++ trunk/Master/texmf-dist/doc/man/man1/ctanbib.1	2023-02-22 23:31:12 UTC (rev 66068)
@@ -1,6 +1,6 @@
 .\" Manpage for ctanbib.
 .\" Contact michal.h21 at gmail.com to correct errors or typos.
-.TH ctanbib 1 "28 aug 2018" "0.1" "ctanbib man page"
+.TH ctanbib 1 "20 feb 2023" "0.2b" "ctanbib man page"
 .SH NAME
 ctanbib
 \- retrieve bibliographic information for packages hosted on CTAN.

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

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

Modified: trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex	2023-02-22 23:30:40 UTC (rev 66067)
+++ trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex	2023-02-22 23:31:12 UTC (rev 66068)
@@ -5,7 +5,7 @@
 \newenvironment{changelog}{\longtable{@{} l p{30em}}}{\endlongtable}
 \newcommand\change[2]{#1 & #2\\}
 \title{The \texttt{ctanbib} package}
-\author{Michal Hoftich\\\url{michal.h21 at gmail.com}}
+\author{Michal Hoftich\\\href{mailto:michal.h21 at gmail.com}{michal.h21 at gmail.com}}
 \date{\gitdate, version \gitversion}
 \usepackage{hyperref}
 \usepackage{fontspec}
@@ -134,6 +134,10 @@
 \section{Changelog}
 
 \begin{changelog}
+  \change{2023-02-20}{Verson 0.2b released}
+  \change{2023-02-20}{Use \verb|--ssl-no-revoke| option for Curl, to prevent SSL certificate errors}
+  \change{2023-02-20}{Better handling of errors in package info downloading}
+  \change{2023-02-20}{Fixed link to the author mail address}
   \change{2021-06-29}{Version 0.2a released}
   \change{2021-06-29}{Added the \verb|--ctanpath| option.}
   \change{2021-06-26}{Version 0.2 released}

Modified: trunk/Master/texmf-dist/scripts/ctanbib/ctanbib
===================================================================
--- trunk/Master/texmf-dist/scripts/ctanbib/ctanbib	2023-02-22 23:30:40 UTC (rev 66067)
+++ trunk/Master/texmf-dist/scripts/ctanbib/ctanbib	2023-02-22 23:31:12 UTC (rev 66068)
@@ -34,7 +34,7 @@
   print(msg)
   os.exit(0)
 elseif args.version then
-  print "ctanbib version 0.2a"
+  print "ctanbib version 0.2b"
   os.exit(0)
 elseif args.ctan then
   pkgurl = true
@@ -76,15 +76,18 @@
 
 local dom = require('luaxml-domobject')
 
-local load_xml =  function(url)
+local load_xml =  function(url, verification)
   -- local command = io.popen("wget -qO- ".. url,"r")
-  local command = io.popen("curl -sS ".. url,"r")
+  local command = io.popen("curl --ssl-no-revoke -sS ".. url,"r")
+  local verification = verification or ""
 
+  if not command then return nil, "Cannot open Curl" end
+
   local info = command:read("*all")
   command:close()
 
-  if string.len(info) == 0 then
-    return false
+  if not info or string.len(info) == 0 or not info:match(verification) then
+    return nil, "Cannot load XML", info 
   end
   return dom.parse(info ), info
 end
@@ -102,7 +105,11 @@
 local author_list
 local fetch_author_list = function()
   if author_list then return author_list end
-  local authors = load_xml(authors_url)
+  local authors, msg = load_xml(authors_url, "<authors")
+  if not authors then 
+    print(msg)
+    os.exit()
+  end
   author_list = {}
   for _, author in ipairs(authors:query_selector("author")) do
     -- save all authors under they ID 
@@ -204,7 +211,7 @@
 
 for _, pkgname in ipairs(args) do
   local url = "https://ctan.org/xml/2.0/pkg/" .. pkgname .. "?author-name=true"
-  local record, info = load_xml(url)
+  local record, info = load_xml(url, "%<entry")
 
   if not verify_record(record) then
     print("% Cannot find entry for package "..pkgname)



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