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 | |
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')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/unpacker.eclass | 25 |
2 files changed, 27 insertions, 3 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 8d138fe5138b..69f8cedd1217 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.751 2013/03/23 10:24:41 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.752 2013/03/23 21:18:25 hasufell Exp $ + + 23 Mar 2013; Julian Ospald <hasufell@gentoo.org> unpacker.eclass: + add unpack_zip function to unpacker.eclass wrt #462612 23 Mar 2013; Tomáš Chvátal <scarabeus@gentoo.org> office-ext-r1.eclass: Do not use-default here as we enable it by profile variable. 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 |