stdenv: Move unzip support to unzip's setup hook

This commit is contained in:
Eelco Dolstra
2014-08-09 12:44:50 +02:00
parent f97ee61255
commit d7b356f73b
3 changed files with 11 additions and 7 deletions
+4 -7
View File
@@ -489,23 +489,20 @@ addHook unpackCmd _defaultUnpack
_defaultUnpack() {
if [ -d "$curSrc" ]; then
stripHash $curSrc
cp -prd --no-preserve=timestamps $curSrc $strippedName
stripHash "$curSrc"
cp -prd --no-preserve=timestamps "$curSrc" $strippedName
else
case "$curSrc" in
*.tar.xz | *.tar.lzma)
# Don't rely on tar knowing about .xz.
xz -d < $curSrc | tar xf -
xz -d < "$curSrc" | tar xf -
;;
*.tar | *.tar.* | *.tgz | *.tbz2)
# GNU tar can automatically select the decompression method
# (info "(tar) gzip").
tar xf $curSrc
;;
*.zip)
unzip -qq $curSrc
tar xf "$curSrc"
;;
*)
return 1