summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-package.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/context/lua/mtx-package.lua b/scripts/context/lua/mtx-package.lua
index 23da30bf2..c4487faec 100644
--- a/scripts/context/lua/mtx-package.lua
+++ b/scripts/context/lua/mtx-package.lua
@@ -69,8 +69,19 @@ function scripts.package.merge_luatex_files(name)
end
end
end
- report("saving %q",newname)
- io.savedata(newname,table.concat(collected))
+ collected = table.concat(collected)
+ if environment.argument("stripcontext") then
+ local n = 0
+ collected = string.gsub(collected,"\nif context then.-\nend",function(s)
+ n = n + #s
+ return ""
+ end)
+ if n > 0 then
+ report("%i context specific bytes stripped",n)
+ end
+ end
+ report("saving %q (%i bytes)",newname,#collected)
+ io.savedata(newname,collected)
end
end
end