]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
gentoo: Add support for .xz tarballs
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 3 Jan 2018 23:06:33 +0000 (18:06 -0500)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 19 Jan 2018 13:30:28 +0000 (14:30 +0100)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-gentoo.in

index 47f24d0d5e18a380dedacd37e0c058313ff18a06..3f07e31529521ebe26a736fb37b635df0feb0e52 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