]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
mkosi: use pxz instead of xz if it's installed 238/head
authorLennart Poettering <lennart@poettering.net>
Mon, 12 Feb 2018 12:59:55 +0000 (13:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 12 Feb 2018 12:59:55 +0000 (13:59 +0100)
Fixes: #227
mkosi

diff --git a/mkosi b/mkosi
index ea2514d49df0cf3dd91bb29e449e418d21969c2d..8d906d0bbdae5efe30774bcc973c75db215aaf47 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -2140,9 +2140,11 @@ def xz_output(args, raw):
     if not args.xz:
         return raw
 
+    xz_binary = "pxz" if shutil.which("pxz") else "xz"
+
     with complete_step('Compressing image file'):
         f = tempfile.NamedTemporaryFile(prefix=".mkosi-", dir=os.path.dirname(args.output))
-        run(["xz", "-c", raw.name], stdout=f, check=True)
+        run([xz_binary, "-c", raw.name], stdout=f, check=True)
 
     return f