Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdenv: default unpack can unpack bzip2 as well #79127

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pkgs/stdenv/generic/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -806,20 +806,17 @@ _defaultUnpack() {
local fn="$1"

if [ -d "$fn" ]; then

# We can't preserve hardlinks because they may have been
# introduced by store optimization, which might break things
# in the build.
cp -pr --reflink=auto -- "$fn" "$(stripHash "$fn")"

else

case "$fn" in
*.tar.xz | *.tar.lzma | *.txz)
# Don't rely on tar knowing about .xz.
xz -d < "$fn" | tar xf -
;;
*.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
*.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz | *.bz2)
Copy link
Contributor Author

@bhipple bhipple Feb 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other lines are just stylistically updating for consistency while we're here rebuilding the world; most other functions in stdenv's setup.sh don't have padding whitespace.

A local run for me of tar xf out.bz2 works just fine for me on NixOS, using tar v1.32. Not sure if there's a reason we're excluding bz2? It seems to be used for distribution of a bunch of the bootstrap binaries, alongside xz, so it seems reasonable to support it.
https://nixos.org/releases/nix/nix-2.3.2/

# GNU tar can automatically select the decompression method
# (info "(tar) gzip").
tar xf "$fn"
Expand All @@ -828,7 +825,6 @@ _defaultUnpack() {
return 1
;;
esac

fi
}

Expand Down