Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] unpacker.eclass
Date: Thu, 02 Feb 2012 00:34:25
Message-Id: 201202011933.55289.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] unpacker.eclass by "Michał Górny"
1 On Wednesday 01 February 2012 18:12:02 Michał Górny wrote:
2 > On Wed, 1 Feb 2012 15:55:46 -0500 Mike Frysinger wrote:
3 > > On Wednesday 01 February 2012 15:51:52 Michał Górny wrote:
4 > > > On Wed, 1 Feb 2012 15:44:14 -0500 Mike Frysinger wrote:
5 > > > > > > # @USAGE: [archives that we will unpack]
6 > > > > > > # @RETURN: Dependencies needed to unpack all the archives
7 > > > > > > # @DESCRIPTION:
8 > > > > > > # Walk all the specified files (defaults to $SRC_URI) and
9 > > > > > > figure out the # dependencies that are needed to unpack
10 > > > > > > things. #
11 > > > > > > # Note: USE flags are not yet handled.
12 > > > > > > unpacker_src_uri_depends() {
13 > > > > > >
14 > > > > > > local uri deps d
15 > > > > > >
16 > > > > > > [[ $# -eq 0 ]] && set -- ${SRC_URI}
17 > > > > > >
18 > > > > > > for uri in "$@" ; do
19 > > > > > >
20 > > > > > > case ${uri} in
21 > > > > > > *.rar|*.RAR)
22 > > > > > >
23 > > > > > > d="app-arch/unrar" ;;
24 > > > > > >
25 > > > > > > *.7z)
26 > > > > > >
27 > > > > > > d="app-arch/p7zip" ;;
28 > > > > >
29 > > > > > Where are those file formats handled? You don't seem to
30 > > > > > fallback to 'unpack' anywhere too.
31 > > > >
32 > > > > eh ? this func doesn't do unpacking, just ${SRC_URI}<->${DEPEND}
33 > > > > matching.
34 > > >
35 > > > Sooo.. it's intended to generate an useless DEPEND
36 > >
37 > > the ebuild does:
38 > > DEPEND+=" $(unpacker_src_uri_depends)"
39 > >
40 > > > or you have to reset src_unpack() to default to make the archives
41 > > > actually extractable.
42 > >
43 > > this func has nothing to do with extraction. look at the rest of the
44 > > code to see how the default src_unpack is handled via standard
45 > > EXPORT_FUNC means.
46 >
47 > Yes, and can that exported default src_unpack() extract either .rar
48 > or .7z?
49
50 there are no plans for that since portage handles it from EAPI=0 onwards. i
51 can have _unpacker() automatically tail off into `unpack` if it finds a file it
52 doesn't recognize.
53 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] unpacker.eclass "Michał Górny" <mgorny@g.o>