Commit f859d9a3 by Mislav Marohnić

Fix Rubinius 2.1.x on Linux by supporting bz2 archives

`tar` on OS X auto-detects the type of compression used, so it doesn't
care whether `-z` or `-j` flags were passed to it for extraction.
However, since latest Rubinius archives are compressed with bzip2, we
must handle this distinction explicitly for the sake of other platforms.

fixes #470
parent 7f7cb21d
...@@ -236,7 +236,14 @@ fetch_tarball() { ...@@ -236,7 +236,14 @@ fetch_tarball() {
fi fi
fi fi
local tar_args="xzvf"
local package_filename="${package_name}.tar.gz" local package_filename="${package_name}.tar.gz"
if [ "$package_url" != "${package_url%bz2}" ]; then
package_filename="${package_filename%.gz}.bz2"
tar_args="${tar_args/z/j}"
fi
symlink_tarball_from_cache "$package_filename" "$checksum" || { symlink_tarball_from_cache "$package_filename" "$checksum" || {
echo "Downloading ${package_filename}..." >&2 echo "Downloading ${package_filename}..." >&2
{ http head "$mirror_url" && { http head "$mirror_url" &&
...@@ -245,7 +252,7 @@ fetch_tarball() { ...@@ -245,7 +252,7 @@ fetch_tarball() {
download_tarball "$package_url" "$package_filename" "$checksum" download_tarball "$package_url" "$package_filename" "$checksum"
} }
{ if tar xzvf "$package_filename"; then { if tar $tar_args "$package_filename"; then
if [ -z "$KEEP_BUILD_PATH" ]; then if [ -z "$KEEP_BUILD_PATH" ]; then
rm -f "$package_filename" rm -f "$package_filename"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment