Package: most
Version: 5.0.0a-2.5
Severity: wishlist
Tags: patch

Hey,

Now that the XZ compression format is becoming increasingly common it
would be awesome to add transparent descompression support to most.

Fortunately it seems very easy to do, so I'm attaching the patch.

Regards,

Berto

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages most depends on:
ii  libc6      2.24-5
ii  libslang2  2.3.0-4.1

most recommends no packages.

most suggests no packages.

-- no debconf information
From: Alberto Garcia <be...@igalia.com>
Subject: Add support for XZ-compressed files
Index: most-5.0.0a/src/file.c
===================================================================
--- most-5.0.0a.orig/src/file.c
+++ most-5.0.0a/src/file.c
@@ -120,6 +120,13 @@ static int open_compressed_file(char *fi
 	  {
 	     cmd = MOST_LZMA_POPEN_FORMAT;
 	  }
+	else if ((buf[0] == (char) 0xfd)
+	    && (buf[1] == '7') && (buf[2] == 'z')
+	    && (buf[3] == 'X') && (buf[4] == 'Z')
+	    && (buf[5] == (char) 0x00))
+	  {
+	     cmd = MOST_XZ_POPEN_FORMAT;
+	  }
 	
 	if (cmd != NULL)
 	  {
Index: most-5.0.0a/src/file.h
===================================================================
--- most-5.0.0a.orig/src/file.h
+++ most-5.0.0a/src/file.h
@@ -23,6 +23,7 @@
 #define MOST_GUNZIP_POPEN_FORMAT "gzip -dc \"%s\""
 #define MOST_BZIP2_POPEN_FORMAT "bzip2 -dc \"%s\""
 #define MOST_LZMA_POPEN_FORMAT "lzma -dc '%s'"
+#define MOST_XZ_POPEN_FORMAT "xz -dc '%s'"
 
 extern void most_reread_file (void);
 extern void most_read_to_line (int);

Reply via email to