From 42591e0bc48cad87eae5194cc165b510085fdae8 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 15 May 2014 21:46:50 +0200 Subject: [db] store creation and modification time in meta table --- src/luaotfload-database.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/luaotfload-database.lua') 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 () -- cgit v1.2.3