]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
package: make APK embedded help gzip reproducible 23736/head
authorPaul Spooren <mail@aparcar.org>
Wed, 10 Jun 2026 15:18:37 +0000 (17:18 +0200)
committerPaul Spooren <mail@aparcar.org>
Wed, 10 Jun 2026 18:15:15 +0000 (20:15 +0200)
APK compresses it's helptext using LUA and require `zlib`, which isn't
available on the Buildbots. It thens falls back to `gzip`, which embeds the
MTIME, making the binary itself unreproducible.

This commits adds a downstream patch to run `gzip` with `-n`, setting the time
to 0.

Link: https://github.com/openwrt/openwrt/pull/23736
Signed-off-by: Paul Spooren <mail@aparcar.org>
package/system/apk/patches/0011-genhelp-reproducible-gzip.patch [new file with mode: 0644]

diff --git a/package/system/apk/patches/0011-genhelp-reproducible-gzip.patch b/package/system/apk/patches/0011-genhelp-reproducible-gzip.patch
new file mode 100644 (file)
index 0000000..f6684f2
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/genhelp.lua
++++ b/src/genhelp.lua
+@@ -168,7 +168,7 @@ function scapp:compress(data)
+               f:write(data)
+               f:close()
+
+-              local p = io.popen(('gzip -%d < %s'):format(level, tmp), 'r')
++              local p = io.popen(('gzip -n%d < %s'):format(level, tmp), 'r')
+               if p ~= nil then
+                       ret = p:read("*all")
+                       p:close()