]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
gentoo: Add support for .xz tarballs 2069/head
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 3 Jan 2018 23:06:33 +0000 (18:06 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 3 Jan 2018 23:06:33 +0000 (18:06 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-gentoo.in

index 9b84283e7ad29c45f393bd147c0bfb290e730a59..950f17c734a8f1cf192cfff6938495cecf8fb0a3 100644 (file)
@@ -166,8 +166,14 @@ cache_stage3()
         printf " => Got: %s\n" "${stage3_latest_tarball}"
 
         printf "Downloading/untarring the actual stage3 tarball...\n"
+
+        compressor="j"
+        if echo ${stage3_latest_tarball} | grep ".xz$"; then
+            compressor="J"
+        fi
+
         wget -O - "${stage3_baseurl}/${stage3_latest_tarball}" \
-            | tar -xjpf - --numeric-owner -C "${partialfs}" \
+            | tar -x${compressor}pf - --numeric-owner -C "${partialfs}" \
             || die 6 "Error: unable to fetch or untar\n"
         printf " => extracted to: %s\n" "${partialfs}"
     else