summaryrefslogtreecommitdiff
path: root/scripts/mkstatus
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-12-12 20:05:25 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2015-12-12 20:05:29 +0100
commit2fdaee0d9a2687e99b1f44be15b6876be22a495b (patch)
treedfa10fcd633209113484df095a191e3f47b0815a /scripts/mkstatus
parentbc387f73c965feaf71a4c0939f46d08a1e4a33b9 (diff)
downloadluaotfload-2.6-fix-2.tar.gz
[mkstatus] include git tag in status tablev2.6-fix-2
Please ignore, the tag is included to accommodate the CTAN workflow.
Diffstat (limited to 'scripts/mkstatus')
-rwxr-xr-xscripts/mkstatus30
1 files changed, 23 insertions, 7 deletions
diff --git a/scripts/mkstatus b/scripts/mkstatus
index 21d5e71..4b36a9d 100755
--- a/scripts/mkstatus
+++ b/scripts/mkstatus
@@ -12,6 +12,12 @@
-- This script generates a list of hashes that serves as the input
-- for the file integrity check (option --diagnose). md5 is all we can
-- assume in Luatex, so it’s really only a superficial test.
+--
+-- Not that this file also incorporates the Git revision information.
+-- Of this, only the actual commit hash is authoritative. The latest
+-- tag is included for reference only. Besides that, it’s meaningless.
+-- Do not rely on it: Two distinct versions of Luaotfload might very
+-- well share the same tag.
kpse.set_program_name "luatex"
@@ -133,31 +139,41 @@ local die = function (...)
os.exit (1)
end
-local gitcmd = "git log -1 \z
+local logcmd = "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 describecmd = "git describe --all"
-local git_info = function ()
- --io.write (gitcmd)
- --io.write "\n"
- local chan = iopopen (gitcmd)
+local readpipe = function (cmd)
+ local chan = iopopen (cmd)
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 ()
+ return data
+end
+
+local git_info = function ()
+ --io.write (logcmd)
+ --io.write "\n"
+ local desc = readpipe (describecmd)
+ if not desc then die "cannot parse git information" end
+ local desc = string.explode (string.fullstrip (desc), "/")[2]
+ local data = readpipe (logcmd)
if data and type (data) == "string" and data ~= "" then
data = load (data)
if not data then
die "cannot parse git information"
end
- return data ()
+ data = data ()
+ data.description = desc
+ return data
end
die "cannot read from pipe"
end