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