core/pkgs/by-name/un/unzip/setup-hook.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
462 B
Bash
Raw Normal View History

2024-05-02 00:46:19 +00:00
unpackCmdHooks+=(_tryUnzip)
_tryUnzip() {
if ! [[ "$curSrc" =~ \.zip$ ]]; then return 1; fi
# UTF-8 locale is needed for unzip on glibc to handle UTF-8 symbols:
# https://github.com/NixOS/nixpkgs/issues/176225#issuecomment-1146617263
# Otherwise unzip unpacks escaped file names as if '-U' options was in effect.
#
# Pick en_US.UTF-8 as most possible to be present on glibc, musl and darwin.
LANG=en_US.UTF-8 unzip -qq "$curSrc"
}