Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: auto-detection of unpack dependencies
Date: Tue, 15 Jul 2008 23:02:15
Message-Id: 20080716000212.7088f92f@snowmobile
In Reply to: Re: [gentoo-dev] RFC: auto-detection of unpack dependencies by Marius Mauch
1 On Wed, 16 Jul 2008 00:43:28 +0200
2 Marius Mauch <genone@g.o> wrote:
3 > Interesting idea. Unfortunately our depstring parser doesn't like
4 > empty parentheses (as they are usually problem indicators), so it
5 > doesn't work out.
6
7 Bleh. You can hack around that using a second (looping) pass then. I
8 think this is right, assuming extglob:
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 while true ; do
22 UNPACK_DEPENDS=" ${UNPACK_DEPENDS} "
23 u="${UNPACK_DEPENDS}"
24 UNPACK_DEPENDS="${UNPACK_DEPENDS//?(+( )+([^ ])\?)+( )(+( ))+( )/ }"
25 [[ "$u" == "${UNPACK_DEPENDS}" ]] && break
26 done
27
28 Although... Allowing ( ) makes much more sense...
29
30 --
31 Ciaran McCreesh

Attachments

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