diff options
author | Julian Ospald <hasufell@gentoo.org> | 2013-03-23 21:18:25 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2013-03-23 21:18:25 +0000 |
commit | ee01d8614864962560725b40f0b3d4827f1599a9 (patch) | |
tree | ccd9dc17dde9658d6dd004856af59e5c4b7753a5 /eclass/unpacker.eclass | |
parent | restore python-2.7 support (diff) | |
download | gentoo-2-ee01d8614864962560725b40f0b3d4827f1599a9.tar.gz gentoo-2-ee01d8614864962560725b40f0b3d4827f1599a9.tar.bz2 gentoo-2-ee01d8614864962560725b40f0b3d4827f1599a9.zip |
add unpack_zip function to unpacker.eclass wrt #462612
Diffstat (limited to 'eclass/unpacker.eclass')
-rw-r--r-- | eclass/unpacker.eclass | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass index 4be87ce64d4d..8c141dbed140 100644 --- a/eclass/unpacker.eclass +++ b/eclass/unpacker.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.11 2013/03/23 19:35:59 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.12 2013/03/23 21:18:25 hasufell Exp $ # @ECLASS: unpacker.eclass # @MAINTAINER: @@ -299,6 +299,23 @@ unpack_cpio() { fi } +# @FUNCTION: unpack_zip +# @USAGE: <zip file> +# @DESCRIPTION: +# Unpack zip archives. +# This function ignores all non-fatal errors (i.e. warnings). +# That is useful for zip archives with extra crap attached +# (e.g. self-extracting archives). +unpack_zip() { + [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>" + + local zip=$(find_unpackable_file "$1") + unpack_banner "${zip}" + unzip -qo "${zip}" + + [[ $? -le 1 ]] || die "unpacking ${zip} failed (arch=unpack_zip)" +} + # @FUNCTION: _unpacker # @USAGE: <one archive to unpack> # @INTERNAL @@ -350,6 +367,8 @@ _unpacker() { arch="unpack_makeself" fi ;; + *.zip) + arch="unpack_zip" ;; esac # finally do the unpack @@ -414,6 +433,8 @@ unpacker_src_uri_depends() { d="app-arch/p7zip" ;; *.xz) d="app-arch/xz-utils" ;; + *.zip) + d="app-arch/unzip" ;; esac deps+=" ${d}" done |