apk: fix long package description handling
authorPetr Štetiar <ynezz@true.cz>
Thu, 14 Nov 2024 09:07:20 +0000 (09:07 +0000)
committerPetr Štetiar <ynezz@true.cz>
Fri, 15 Nov 2024 08:52:54 +0000 (08:52 +0000)
commita6c248e8ad75971ccfedebf2a172ef3e2696fa18
treef70259d0907c5149eef35b9e03256fe8c6e1e577
parent1e8505ac4e88212106fe78486cfcbe9cae7660f9
apk: fix long package description handling

Currently its not possible to generate apk package.adb package index if
the package has longer description field, which leads to following
failure:

 (2352/2353) Installing zoneinfo-all (2024b-r1)
 (2353/2353) Installing zstd (1.5.6-r1)
 ERROR: System state may be inconsistent: failed to write database: No buffer space available
 1 error; 2704 MiB in 2353 packages

The code to read/write installeddb does not really handle long
description well. Until the database is converted to apkv3 format,
truncate the apkv3 descriptions to allow existing code to work.

APKv3 index and packages still contain the original long description
unmodified, so no package rebuild will be needed.

Fixing the issue by backporting the single upstream fix as its not
possible to to upstep apk to the latest Git HEAD due to some
regressions, see commit 692052cdc0e7 ("Revert "apk: update to Git
417a93ceae540444fdbd3f76d1dadf0e15621fdc (2024-11-13)"") for more
details.

Fixes: #16929
References: https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/11038
Upstream-Status: Backport [https://gitlab.alpinelinux.org/alpine/apk-tools/-/commit/417a93ceae540444fdbd3f76d1dadf0e15621fdc]
Link: https://github.com/openwrt/openwrt/pull/16951
Signed-off-by: Petr Štetiar <ynezz@true.cz>
package/system/apk/Makefile
package/system/apk/patches/0020-pkg-truncate-apkv3-description-to-256-bytes.patch [new file with mode: 0644]