summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-22 23:31:12 +0000
committerKarl Berry <karl@freefriends.org>2023-02-22 23:31:12 +0000
commit1863e55087cca74572536871f48124f088e11111 (patch)
tree501011adc46206edbf4c252422dbc30f8045e986 /Build
parent5dc59437b77b53e04eb78d59547631134db52f5c (diff)
ctanbib (23feb23)
git-svn-id: svn://tug.org/texlive/trunk@66068 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/ctanbib/ctanbib21
1 files changed, 14 insertions, 7 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib b/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
index 70b31badbac..0242c235de4 100755
--- a/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
+++ b/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
@@ -34,7 +34,7 @@ if args.help then
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 @@ version = {$version},
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 @@ end
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 @@ end
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)