From d352c619dd4e8bd36e8459e1916310af686d3d8f Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Sun, 19 Feb 2012 14:02:32 +0000 Subject: [PATCH] Add support for xz compression to FileWriter --- daklib/filewriter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daklib/filewriter.py b/daklib/filewriter.py index c010fb5d..3b816ee9 100755 --- a/daklib/filewriter.py +++ b/daklib/filewriter.py @@ -47,6 +47,7 @@ class BaseFileWriter(object): self.uncompressed = 'none' in compression self.gzip = 'gzip' in compression self.bzip2 = 'bzip2' in compression + self.xz = 'xz' in compression root_dir = Config()['Dir::Root'] relative_dir = template % keywords self.path = os.path.join(root_dir, relative_dir) @@ -81,6 +82,9 @@ class BaseFileWriter(object): if self.bzip2: check_call('bzip2 -9 <%s.new >%s.bz2.new' % (self.path, self.path), shell = True) self.rename('%s.bz2' % self.path) + if self.xz: + check_call('xz -c <{0}.new >{0}.xz.new'.format(self.path), shell=True) + self.rename('{0}.xz'.format(self.path)) if self.uncompressed: self.rename(self.path) else: -- 2.39.5