summaryrefslogtreecommitdiff
path: root/tex/context/base/data-sch.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/data-sch.lua')
-rw-r--r--tex/context/base/data-sch.lua18
1 files changed, 14 insertions, 4 deletions
diff --git a/tex/context/base/data-sch.lua b/tex/context/base/data-sch.lua
index 41b941c5a..d79e0c7ef 100644
--- a/tex/context/base/data-sch.lua
+++ b/tex/context/base/data-sch.lua
@@ -31,8 +31,18 @@ function cleaners.none(specification)
return specification.original
end
-function cleaners.strip(specification)
- return (gsub(specification.original,"[^%a%d%.]+","-")) -- so we keep periods
+-- function cleaners.strip(specification)
+-- -- todo: only keep suffix periods, so after the last
+-- return (gsub(specification.original,"[^%a%d%.]+","-")) -- so we keep periods
+-- end
+
+function cleaners.strip(specification) -- keep suffixes
+ local path, name = file.splitbase(specification.original)
+ if path == "" then
+ return (gsub(name,"[^%a%d%.]+","-"))
+ else
+ return (gsub((gsub(path,"%.","-") .. "-" .. name),"[^%a%d%.]+","-"))
+ end
end
function cleaners.md5(specification)
@@ -54,8 +64,8 @@ end
local cached, loaded, reused, thresholds, handlers = { }, { }, { }, { }, { }
local function runcurl(name,cachename) -- we use sockets instead or the curl library when possible
- local command = "curl --silent --create-dirs --output " .. cachename .. " " .. name
- os.spawn(command)
+ local command = "curl --silent --insecure --create-dirs --output " .. cachename .. " " .. name
+ os.execute(command)
end
local function fetch(specification)