1 |
On Tue, 15 Jul 2008 22:34:33 +0100 |
2 |
Ciaran McCreesh <ciaran.mccreesh@××××××××××.com> wrote: |
3 |
|
4 |
> On Tue, 15 Jul 2008 23:23:26 +0200 |
5 |
> Marius Mauch <genone@g.o> wrote: |
6 |
> > Right, just I'd expect the parsing of SRC_URI (with conditionals) to |
7 |
> > be a bit tricky in bash, not something I'm going to work on. An |
8 |
> > eclass-based solution would have a few benefits though wrt the |
9 |
> > metadata cache. |
10 |
> |
11 |
> Well... You don't really have to parse it. |
12 |
> |
13 |
> for p in $SRC_URI ; do |
14 |
> if [[ "${p}" == "(" ]] || [[ "${p}" == ")" ]] || \ |
15 |
> [[ "${p%\?}" != "${p}" ]] ; then |
16 |
> UNPACK_DEPENDS="${UNPACK_DEPENDS} $p " |
17 |
> elif [[ "${p%.zip}" != "${p}" ]] ; then |
18 |
> UNPACK_DEPENDS="${UNPACK_DEPENDS} app-arch/unzip " |
19 |
> elif [[ "${p%.bz2}" != "${p}" ]] ; then |
20 |
> UNPACK_DEPENDS="${UNPACK_DEPENDS} app-arch/bzip2 " |
21 |
> fi |
22 |
> done |
23 |
> |
24 |
> Granted, it'll generate invalid output if SRC_URI is invalid (for |
25 |
> example, if SRC_URI has mismatched parens, the output will too), but I |
26 |
> can't think of any situation where breaking DEPEND if SRC_URI is |
27 |
> already broken is a problem. |
28 |
|
29 |
Interesting idea. Unfortunately our depstring parser doesn't like empty |
30 |
parentheses (as they are usually problem indicators), so it doesn't |
31 |
work out. |
32 |
|
33 |
Marius |
34 |
-- |
35 |
gentoo-dev@l.g.o mailing list |