bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] PATCH: Lzo compression support


From: Kevin Day
Subject: [Bug-tar] PATCH: Lzo compression support
Date: Sat, 30 Dec 2006 18:18:30 -0000

I found LZO to be as useful and open-source friendly as gzip and bzip2.
For those wondering: http://www.lzop.org/ and
http://www.oberhumer.com/opensource/lzo/

Here is the patch (tested and working) to make this a possible addition to tar
To my surprise, there were still letters available, i picked 'q'.

--- tar-1.16.1/src/buffer.c.orig        2006-12-30 10:40:59.000000000 -0600
+++ tar-1.16.1/src/buffer.c     2006-12-30 11:54:33.000000000 -0600
@@ -196,7 +196,8 @@
  ct_none,
  ct_compress,
  ct_gzip,
-  ct_bzip2
+  ct_bzip2,
+  ct_lzop
};

struct zip_magic
@@ -213,6 +214,7 @@
  { ct_compress, 2, "\037\235", "compress", "-Z" },
  { ct_gzip,     2, "\037\213", "gzip", "-z"  },
  { ct_bzip2,    3, "BZh",      "bzip2", "-j" },
+  { ct_lzop,     4, "\211LZO",  "lzop", "-q" },
};

#define NMAGIC (sizeof(magic)/sizeof(magic[0]))
--- tar-1.16.1/src/tar.c.orig   2006-12-30 10:41:04.000000000 -0600
+++ tar-1.16.1/src/tar.c        2006-12-30 12:06:10.000000000 -0600
@@ -572,6 +572,8 @@
   N_("create archive with volume name TEXT; at list/extract time,
use TEXT as a globbing pattern for volume name"), GRID+8 },
  {"bzip2", 'j', 0, 0,
   N_("filter the archive through bzip2"), GRID+8 },
+  {"lzop", 'q', 0, 0,
+   N_("filter the archive through lzop"), GRID+8 },
  {"gzip", 'z', 0, 0,
   N_("filter the archive through gzip"), GRID+8 },
  {"gunzip", 0, 0, OPTION_ALIAS, NULL, GRID+8 },
@@ -1340,6 +1342,10 @@
      absolute_names_option = true;
      break;

+    case 'q':
+      set_use_compress_program_option ("lzop");
+      break;
+
    case 'r':
      set_subcommand_option (APPEND_SUBCOMMAND);
      break;

--
Kevin Day




reply via email to

[Prev in Thread] Current Thread [Next in Thread]