Gentoo Archives: gentoo-commits

From: "Christoph Junghans (ottxor)" <ottxor@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog unpacker.eclass
Date: Wed, 22 Aug 2012 01:41:27
Message-Id: 20120822014112.EC49B202BB@flycatcher.gentoo.org
1 ottxor 12/08/22 01:41:12
2
3 Modified: ChangeLog unpacker.eclass
4 Log:
5 added support for cpio archives
6
7 Revision Changes Path
8 1.378 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.378&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.378&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.377&r2=1.378
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.377
18 retrieving revision 1.378
19 diff -u -r1.377 -r1.378
20 --- ChangeLog 19 Aug 2012 11:12:35 -0000 1.377
21 +++ ChangeLog 22 Aug 2012 01:41:12 -0000 1.378
22 @@ -1,6 +1,9 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.377 2012/08/19 11:12:35 johu Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.378 2012/08/22 01:41:12 ottxor Exp $
27 +
28 + 22 Aug 2012; Christoph Junghans <ottxor@g.o> unpacker.eclass:
29 + added support for cpio archives
30
31 19 Aug 2012; Johannes Huber <johu@g.o> kde4-base.eclass,
32 kde4-functions.eclass, kde4-meta.eclass:
33
34
35
36 1.10 eclass/unpacker.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/unpacker.eclass?rev=1.10&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/unpacker.eclass?rev=1.10&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/unpacker.eclass?r1=1.9&r2=1.10
41
42 Index: unpacker.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v
45 retrieving revision 1.9
46 retrieving revision 1.10
47 diff -u -r1.9 -r1.10
48 --- unpacker.eclass 11 May 2012 07:46:44 -0000 1.9
49 +++ unpacker.eclass 22 Aug 2012 01:41:12 -0000 1.10
50 @@ -1,6 +1,6 @@
51 # Copyright 1999-2012 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 -# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.9 2012/05/11 07:46:44 vapier Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/unpacker.eclass,v 1.10 2012/08/22 01:41:12 ottxor Exp $
55
56 # @ECLASS: unpacker.eclass
57 # @MAINTAINER:
58 @@ -276,6 +276,25 @@
59 unpacker ./data.tar*
60 }
61
62 +# @FUNCTION: unpack_cpio
63 +# @USAGE: <one cpio to unpack>
64 +# @DESCRIPTION:
65 +# Unpack a cpio archive, file "-" means stdin.
66 +unpack_cpio() {
67 + [[ $# -eq 1 ]] || die "Usage: ${FUNCNAME} <file>"
68 +
69 + # needed as cpio always reads from stdin
70 + local cpio_cmd=( cpio --make-directories --extract --preserve-modification-time )
71 + if [[ $1 == "-" ]] ; then
72 + unpack_banner "stdin"
73 + "${cpio_cmd[@]}"
74 + else
75 + local cpio=$(find_unpackable_file "$1")
76 + unpack_banner "${cpio}"
77 + "${cpio_cmd[@]}" <"${cpio}"
78 + fi
79 +}
80 +
81 # @FUNCTION: _unpacker
82 # @USAGE: <one archive to unpack>
83 # @INTERNAL
84 @@ -309,6 +328,8 @@
85 case ${m} in
86 *.tgz|*.tbz|*.tbz2|*.txz|*.tar.*|*.tar)
87 arch="tar --no-same-owner -xof" ;;
88 + *.cpio.*|*.cpio)
89 + arch="unpack_cpio" ;;
90 *.deb)
91 arch="unpack_deb" ;;
92 *.run)
93 @@ -381,6 +402,8 @@
94
95 for uri in "$@" ; do
96 case ${uri} in
97 + *.cpio.*|*.cpio)
98 + d="app-arch/cpio" ;;
99 *.rar|*.RAR)
100 d="app-arch/unrar" ;;
101 *.7z)