summaryrefslogtreecommitdiff
path: root/src/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-15 21:46:50 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-15 21:46:50 +0200
commit42591e0bc48cad87eae5194cc165b510085fdae8 (patch)
treeed7f8e95e4fb7ce44bd7fc58b8272667d12f51a8 /src/luaotfload-database.lua
parent37a229fdcc8c191ab2603c314cfbcd450a63c6f0 (diff)
downloadluaotfload-42591e0bc48cad87eae5194cc165b510085fdae8.tar.gz
[db] store creation and modification time in meta table
Diffstat (limited to 'src/luaotfload-database.lua')
-rw-r--r--src/luaotfload-database.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 59e2a4d..a290e7d 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -268,8 +268,10 @@ This is a sketch of the luaotfload db:
optical : (int, int) list; // design size -> index entry
}
and metadata = {
- local : bool; (* set if local fonts were added to the db *)
+ created : string // creation time
formats : string list; // { "otf", "ttf", "ttc", "dfont" }
+ local : bool; (* set if local fonts were added to the db *)
+ modified : string // modification time
statistics : TODO; // created when built with "--stats"
version : float; // index version
}
@@ -352,9 +354,10 @@ mtx-fonts has in names.tma:
--doc]]--
---- string list -> dbobj
+--- string list -> string option -> dbobj
-local initialize_namedata = function (formats)
+local initialize_namedata = function (formats, created)
+ local now = os.date "%F %T"
return {
--families = { },
status = { }, -- was: status; map abspath -> mapping
@@ -362,8 +365,10 @@ local initialize_namedata = function (formats)
names = { },
-- files = { }, -- created later
meta = {
- ["local"] = false,
+ created = created or now,
formats = formats,
+ ["local"] = false,
+ modified = now,
statistics = { },
version = names.version,
},
@@ -3139,7 +3144,8 @@ update_names = function (currentnames, force, dry_run)
end
end
- targetnames = initialize_namedata (get_font_filter ())
+ targetnames = initialize_namedata (get_font_filter (),
+ currentnames.meta and currentnames.meta.created)
read_blacklist ()