summaryrefslogtreecommitdiff
path: root/mkfilelist
diff options
context:
space:
mode:
Diffstat (limited to 'mkfilelist')
-rw-r--r--mkfilelist34
1 files changed, 33 insertions, 1 deletions
diff --git a/mkfilelist b/mkfilelist
index 756bfe0..72dd59f 100644
--- a/mkfilelist
+++ b/mkfilelist
@@ -23,6 +23,7 @@ local stringformat = string.format
local md5sumhexa = md5.sumhexa
local ioloaddata = io.loaddata
local iosavedata = io.savedata
+local iopopen = io.popen
-----------------------------------------------------------------------
-- settings
@@ -70,6 +71,35 @@ local die = function (...)
os.exit (1)
end
+local gitcmd = "git log -1 \z
+ --format=\"return {\z
+ %n revision = [[%H]],\z
+ %n timestamp = [[%cd]],\z
+ %n committer = [[%cn <%ce>]],\z
+ %n}\" \z
+ --date=iso"
+
+local git_info = function ()
+ --io.write (gitcmd)
+ --io.write "\n"
+ local chan = iopopen (gitcmd)
+ if not chan then
+ die ("this script needs to be run inside \z
+ the luaotfload git repository")
+ end
+
+ local data = chan:read "*all"
+ chan:close ()
+ if data and type (data) == "string" and data ~= "" then
+ data = load (data)
+ if not data then
+ die "cannot parse git information"
+ end
+ return data ()
+ end
+ die "cannot read from pipe"
+end
+
-----------------------------------------------------------------------
-- functionality
-----------------------------------------------------------------------
@@ -103,7 +133,9 @@ end
local main = function ()
local hashes = hash_all ()
- local serialized = table.serialize (hashes, true)
+ local notes = git_info ()
+ local serialized = table.serialize ({ notes = notes,
+ hashes = hashes }, true)
local success = io.savedata (filelist, serialized)
if success == false then
die ("could not write to %s.", filelist)