openbsd-ports/textproc/gonzui/patches/patch-gonzui_extractor_rb

32 lines
811 B
Plaintext

$OpenBSD: patch-gonzui_extractor_rb,v 1.1 2011/04/08 08:14:16 jasper Exp $
Add support for dealing with (.tar).xz
--- gonzui/extractor.rb.orig Fri Apr 8 09:59:36 2011
+++ gonzui/extractor.rb Fri Apr 8 10:05:58 2011
@@ -251,6 +251,24 @@ module Gonzui
Extractor.register(self)
end
+ class XZExtractor < AbstractExtractor
+ def self.commands
+ ["tar", "xz"]
+ end
+
+ def self.extnames
+ [".tar.xz", ".xz"]
+ end
+
+ def do_extract
+ command_line = sprintf("xz --decompress --stdout %s | tar xf -",
+ shell_escape(File.expand_path(@file_name)))
+ run_extract_command(command_line, @file_name)
+ end
+
+ Extractor.register(self)
+ end
+
class SRPMExtractor < AbstractExtractor
def self.commands
["rpm", "rpmbuild"]