[aur-dev] PKGBUILD parsing on the AUR

Gergely Imreh imrehg at gmail.com
Sun Aug 2 05:46:07 EDT 2009


Hi,

2009/8/2 Xyne <xyne at archlinux.ca>:
> Hi,
>
> I'm hoping someone could answer these questions:
>
> How does the AUR parse uploaded PKGBUILDs?
> How does it handle PKGBUILDs with if-then-else statements? E.g.
>
> depends=('foo' 'baz')
> [ "$(uname -m)" == 'x86_64' ] && depends=('lib32-foo' 'lib32-baz')
>
> How could I help implement this?:
> http://bugs.archlinux.org/task/15728
>
>
>
> Thanks,
>
> Xyne
>

As I worked on most of the parsing code at the moment: we don't have
any "if-then-else" statements. AUR can (currently) handle only static
assignments and bash arrays (or how are they called) and evals.

This is because we don't evaluate the "bash" part of the script just
the variable assignments. Would be nice to have a whole bash
interpreter or similar, but I don't have an idea how to get that done
securely at the moment.... Any suggestions?
E.g. that example on the top would not get through...

As for the linked feature request: the "depends" should be
straightforward (I didn't look into it much, yet, but we should have
all the required data). The "makedepends" is not stored for the web
interface, so should be added there first. Would be quite valuable, I
think... Even optdepends could be useful if we would add it one day,
the only problem is, that it does not seem to have a standard format
across packages.

So, on a related note, making such upgrades: patches for the pages
(php or html...) are straightforward. How does someone send a patch
which would need a change in the SQL database in the back?

Cheers,
    Greg


More information about the aur-dev mailing list