summaryrefslogtreecommitdiff
path: root/tex/context/base/data-sch.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-05-16 00:15:04 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-05-16 00:15:04 +0200
commitb55577d0998160c0174e250b542016ecd6ca9056 (patch)
tree27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/data-sch.lua
parent624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff)
downloadcontext-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz
2015-05-15 23:06:00
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)