Skip to content

Commit

Permalink
gentoo: Add support for .xz tarballs
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
stgraber committed Jan 3, 2018
1 parent acd546a commit 71ac47a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion templates/lxc-gentoo.in
Expand Up @@ -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
Expand Down

0 comments on commit 71ac47a

Please sign in to comment.