Package: less
Version: 551-2
Severity: wishlist
Tags: patch

Hi!
zstd is a newish compression algorithm, which thoroughly beats most of
competing compressors for a good part of the ratio:time envelope.
It would be good teach lesspipe how to handle it transparently.

Here's a patch for .zst and .tar.zst/.tzst


Meow!
-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'stable'), 
(150, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0-rc2-umbar-00104-ge9e0d2dbf706 (SMP w/6 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages less depends on:
ii  libc6      2.30-8
ii  libtinfo6  6.2-1

less recommends no packages.

less suggests no packages.

-- no debconf information
>From 7cc42d7b82b1caef7294e00c3ed19f29292954a8 Mon Sep 17 00:00:00 2001
From: Adam Borowski <kilob...@angband.pl>
Date: Sun, 12 Jul 2020 20:02:52 +0200
Subject: [PATCH] lesspipe: support zstd-compressed files

---
 debian/lesspipe | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/debian/lesspipe b/debian/lesspipe
index 98224b0..0818538 100644
--- a/debian/lesspipe
+++ b/debian/lesspipe
@@ -222,6 +222,14 @@ if [ $# -eq 1 ] ; then
                                fi
                                ;;
 
+                       *.tar.zst|*.tzst)
+                               if [ -x "`which zstd`" ]; then
+                                       zstd -qdc "$1" | tar tfvv -
+                               else
+                                       echo "No zstd available"
+                               fi
+                               ;;
+
                        *.whl)
                                if [ -x "`which unzip`" ]; then
                                        unzip -p "$1" '*.dist-info/METADATA' | 
sed '/^$/q'
@@ -239,6 +247,14 @@ if [ $# -eq 1 ] ; then
                                fi
                                ;;
 
+                       *.zst)
+                               if [ -x "`which zstd`" ]; then
+                                       zstd -qdc "$1"
+                               else
+                                       echo "No zstd available"
+                               fi
+                               ;;
+
                        # Note that this is out of alpha order so that we don't 
catch
                        # the gzipped tar files.
                        *.gz|*.z|*.dz)
-- 
2.27.0

Reply via email to