Compare commits

..

3 Commits

Author SHA1 Message Date
Sebastian Lohff 30738981f4 Document lzma/xz support in manpage 2019-02-14 23:25:36 +01:00
Sebastian Lohff 53d803626d
Merge pull request #2 from bitwave/tar-lzma-support
added compression method lzma for tar files
2019-02-14 23:22:58 +01:00
bitwave aeb8588198 added compression method lzma for tar files 2018-04-25 19:08:58 +02:00
2 changed files with 6 additions and 2 deletions

View File

@ -227,7 +227,7 @@ class FileHandler(FileBaseHandler):
class TarFileHandler(FileBaseHandler): class TarFileHandler(FileBaseHandler):
target = None target = None
compression = "none" compression = "none"
compressionMethods = ("none", "gzip", "bzip2") compressionMethods = ("none", "gzip", "bzip2", "xz")
def do_HEAD(self): def do_HEAD(self):
if self.checkAndDoRedirect(): if self.checkAndDoRedirect():
@ -269,6 +269,8 @@ class TarFileHandler(FileBaseHandler):
cmd = ["tar", "-cz"] cmd = ["tar", "-cz"]
elif self.compression == "bzip2": elif self.compression == "bzip2":
cmd = ["tar", "-cj"] cmd = ["tar", "-cj"]
elif self.compression == "xz":
cmd = ["tar", "-cJ"]
else: else:
raise ValueError("Unknown compression mode '%s'." % self.compression) raise ValueError("Unknown compression mode '%s'." % self.compression)
@ -287,6 +289,8 @@ class TarFileHandler(FileBaseHandler):
return ".tar.gz" return ".tar.gz"
elif TarFileHandler.compression == "bzip2": elif TarFileHandler.compression == "bzip2":
return ".tar.bz2" return ".tar.bz2"
elif TarFileHandler.compression == "xz":
return ".tar.xz"
raise ValueError("Unknown compression mode '%s'." % TarFileHandler.compression) raise ValueError("Unknown compression mode '%s'." % TarFileHandler.compression)

View File

@ -94,7 +94,7 @@ available.
.TP .TP
\fB\-c\fR method, \fB\-\-compression\fR method \fB\-c\fR method, \fB\-\-compression\fR method
Set compression method, only in combination with Set compression method, only in combination with
\fB\-\-tar\fR. Can be one of none, gzip, bzip2. \fB\-\-tar\fR. Can be one of none, gzip, bzip2, xz.
.TP .TP
\fB\-4\fR, \fB\-\-ipv4\-only\fR \fB\-4\fR, \fB\-\-ipv4\-only\fR
Listen on IPv4 only Listen on IPv4 only