summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2012-08-22 01:41:12 +0000
committerChristoph Junghans <ottxor@gentoo.org>2012-08-22 01:41:12 +0000
commit80a5fefccd82a769ca9ca7f0dcff77dc789b29cf (patch)
treeb59d9f0075c2fe6eb17412141b72f969415c8863
parentFix building with automake 1.12 (bug #426484); fix building with forced --as-... (diff)
downloadhistorical-80a5fefccd82a769ca9ca7f0dcff77dc789b29cf.tar.gz
historical-80a5fefccd82a769ca9ca7f0dcff77dc789b29cf.tar.bz2
historical-80a5fefccd82a769ca9ca7f0dcff77dc789b29cf.zip
added support for cpio archives
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/unpacker.eclass25
2 files changed, 28 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 84cba83a0381..1eccc2304bf6 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.377 2012/08/19 11:12:35 johu Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.378 2012/08/22 01:41:12 ottxor Exp $
+
+ 22 Aug 2012; Christoph Junghans <ottxor@gentoo.org> unpacker.eclass:
+ added support for cpio archives
19 Aug 2012; Johannes Huber <johu@gentoo.org> kde4-base.eclass,
kde4-functions.eclass, kde4-meta.eclass:
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
index 0ec63b1f7492..dcf026d7d9d8 100644
--- a/eclass/unpacker.eclass
+++ b/eclass/unpacker.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.9 2012/05/11 07:46:44 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.10 2012/08/22 01:41:12 ottxor Exp $
# @ECLASS: unpacker.eclass
# @MAINTAINER:
@@ -276,6 +276,25 @@ unpack_deb() {
unpacker ./data.tar*
}
+# @FUNCTION: unpack_cpio
+# @USAGE: <one cpio to unpack>
+# @DESCRIPTION:
+# Unpack a cpio archive, file "-" means stdin.
+unpack_cpio() {
+ [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
+
+ # needed as cpio always reads from stdin
+ local cpio_cmd=( cpio --make-directories --extract --preserve-modification-time )
+ if [[ $1 == "-" ]] ; then
+ unpack_banner "stdin"
+ "${cpio_cmd[@]}"
+ else
+ local cpio=$(find_unpackable_file "$1")
+ unpack_banner "${cpio}"
+ "${cpio_cmd[@]}" <"${cpio}"
+ fi
+}
+
# @FUNCTION: _unpacker
# @USAGE: <one archive to unpack>
# @INTERNAL
@@ -309,6 +328,8 @@ _unpacker() {
case ${m} in
*.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar)
arch="tar --no-same-owner -xof" ;;
+ *.cpio.*|*.cpio)
+ arch="unpack_cpio" ;;
*.deb)
arch="unpack_deb" ;;
*.run)
@@ -381,6 +402,8 @@ unpacker_src_uri_depends() {
for uri in "$@" ; do
case ${uri} in
+ *.cpio.*|*.cpio)
+ d="app-arch/cpio" ;;
*.rar|*.RAR)
d="app-arch/unrar" ;;
*.7z)