archivers/zstd: workaround for missing LESSOPEN support in zstdless

The `zstdless` script, which is part of the zstd package, relies on the
LESSOPEN mechanism, which was removed from OpenBSD over a year ago. As a
result, `zstdless` is currently broken. Work around this by replacing
`zstdless` with a script using `zstdcat` and `less`.

Issue reported and workaround suggested by Tom Szilagyi <tom DOT
szilagyi AT altmail DOT se>.
This commit is contained in:
bket
2025-05-17 17:14:13 +00:00
parent 34b53a9a8c
commit e0de33a7a4
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -1,6 +1,7 @@
COMMENT = zstandard fast real-time compression algorithm
V = 1.5.7
REVISION = 0
DISTNAME = zstd-${V}
SHARED_LIBS = zstd 7.0 # 1.5.7
@@ -0,0 +1,13 @@
Index: programs/zstdless
--- programs/zstdless.orig
+++ programs/zstdless
@@ -1,8 +1,3 @@
#!/bin/sh
-zstd=${ZSTD:-zstd}
-
-# TODO: Address quirks and bugs tied to old versions of less, provide a mechanism to pass flags directly to zstd
-
-export LESSOPEN="|-${zstd} -cdfq %s"
-exec less "$@"
+zstdcat "$@" | less