[aur-general] [AUR4] Single binary package for different architectures

Patrick Burroughs (Celti) celti at celti.name
Thu Jun 25 12:45:33 UTC 2015


On Thu, 25 Jun 2015 13:17:49 +0100 Mauro Santos
<registo.mailling at gmail.com> wrote:

> On 25-06-2015 12:26, Martti Kühne wrote:
> > Do this:
> > 
> > source_i686=("http://example.com/release-${pkgver}-i386.tar.gz")
> > md5sums_i686=('ffeeddccbbaa99887766554433221100')
> > source_x86_64=("http://example.com/release-${pkgver}-x86_64.tar.gz")
> > md5sums_x86_64=('00112233445566778899aabbccddeeff')
> > 
> > package() {
> >   local tarball="${source_i686[0]}"
> >   [ "$CARCH" == x86_64 ] && tarball="${source_x86_64[0]}"
> >   tar xzf "$tarball" "$pkgdir"
> > }
> 
> Wouldn't just
> 
> local tarball="${source_$CARCH[0]}"
> 
> or something very similar do the job?

I believe you need:

local tarball=$(eval "echo \${source_${CARCH}[0]}")

...which is complicated enough (and invokes a nice scary eval) that you
may as well stick with the conditional.

-- 
Patrick Burroughs (Celti) <celti at celti.name>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20150625/b060331a/attachment-0001.asc>


More information about the aur-general mailing list