summaryrefslogtreecommitdiff
path: root/tex/context/base/core-uti.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-11-09 21:40:13 +0200
committerMarius <mariausol@gmail.com>2013-11-09 21:40:13 +0200
commitb061ca19f9a8721105957f51448400425adaf7e8 (patch)
tree30f629679b112339410a2b17a4bbc33ddcb7d408 /tex/context/base/core-uti.lua
parentef273426ef4cecf5804a6fc9cf0e627f2edec7fd (diff)
downloadcontext-b061ca19f9a8721105957f51448400425adaf7e8.tar.gz
beta 2013.11.09 20:21
Diffstat (limited to 'tex/context/base/core-uti.lua')
-rw-r--r--tex/context/base/core-uti.lua34
1 files changed, 28 insertions, 6 deletions
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua
index cbbdeff23..d626fa67b 100644
--- a/tex/context/base/core-uti.lua
+++ b/tex/context/base/core-uti.lua
@@ -36,8 +36,8 @@ local report_passes = logs.reporter("job","passes")
job = job or { }
local job = job
-job.version = 1.22 -- make sure we don't have old lua 5.1 hash leftovers
-job.packversion = 1.02 -- make sure we don't have old lua 5.1 hash leftovers
+job.version = 1.23
+job.packversion = 1.02
-- some day we will implement loading of other jobs and then we need
-- job.jobs
@@ -87,12 +87,16 @@ local jobvariables = {
checksums = checksums,
}
+-- if not checksums.old then checksums.old = md5.HEX("old") end -- used in experiment
+-- if not checksums.new then checksums.new = md5.HEX("new") end -- used in experiment
+
job.variables = jobvariables
-if not checksums.old then checksums.old = md5.HEX("old") end -- used in experiment
-if not checksums.new then checksums.new = md5.HEX("new") end -- used in experiment
+local function initializer()
+ checksums = jobvariables.checksums
+end
-job.register('job.variables.checksums', checksums)
+job.register('job.variables.checksums', 'job.variables.checksums', initializer)
local rmethod, rvalue
@@ -101,7 +105,6 @@ local setxvalue = context.setxvalue
local function initializer()
tobesaved = jobvariables.tobesaved
collected = jobvariables.collected
- checksums = jobvariables.checksums
rvalue = collected.randomseed
if not rvalue then
rvalue = math.random()
@@ -123,6 +126,22 @@ function jobvariables.save(cs,value)
tobesaved[cs] = value
end
+-- checksums
+
+function jobvariables.getchecksum(tag)
+ return checksums[tag] -- no default
+end
+
+function jobvariables.makechecksum(data)
+ return data and md5.HEX(data) -- no default
+end
+
+function jobvariables.setchecksum(tag,checksum)
+ checksums[tag] = checksum
+end
+
+--
+
local packlist = {
"numbers",
"metadata",
@@ -156,6 +175,9 @@ function job.save(filename) -- we could return a table but it can get pretty lar
local target = format("utilitydata.%s",list[1])
local data = list[2]
local finalizer = list[4]
+ if type(data) == "string" then
+ data = utilities.tables.accesstable(data)
+ end
if type(finalizer) == "function" then
finalizer()
end