Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-12 Thread Xyne
Indeed. Perhaps Allan would be interested on this for his makepkg test suite, although maybe more in the concept since the test suite us in python. It would be trivial to conver this to Python. I will probably do that myself if there seems to be enough interest in it.

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-11 Thread Jim Pryor
On Sat, Jan 09, 2010 at 09:23:56PM +0100, Xyne wrote: I first check the PKGBUILD with /bin/bash -n PKGBUILD. If this command exits without error then the PKGBUILD contains valid syntax, most importantly it does not contain extra closing brackets (}). This lets me wrap the entire PKGBUILD in

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-09 Thread Sebastian Nowicki
On 09/01/2010, at 2:50 AM, Xyne wrote: What was the problem with that from Sebastian which was discussed earlier on the mailing lists, IRCs ? How does it know more ? I don't know. I wrote this because I needed a PKGBUILD parser in Perl for Bauerbill. Maybe it's better, maybe it's worse. I

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-09 Thread Xyne
It is quite a clever idea. I haven't seen this approach before. I haven't looked at it thoroughly, but it looks like you're simply sourcing the PKGBUILD with some trickery not to execute the code. Why then the need for further parsing? Does `set` produce raw bash, e.g.

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-09 Thread Loui Chang
On Sat 09 Jan 2010 21:23 +0100, Xyne wrote: You haven't fully understood how it works so I hope you don't mind if I try to explain it again. I first check the PKGBUILD with /bin/bash -n PKGBUILD. If this command exits without error then the PKGBUILD contains valid syntax, most importantly

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-09 Thread Xyne
Loui Chang wrote: Wow this is quite clever. It definitely would make the job of parsing much easier. Thanks for the explanation. :) I intend to flesh out the parser as special cases pop up. As already mentioned, there will be limits to what it can do depending on whether the packager uses

[aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-08 Thread Xyne
Hi, There was no response on the pacman-dev list but someone here might find this potentially useful: http://mailman.archlinux.org/pipermail/pacman-dev/2010-January/010322.html It's written in Perl but it could easily be adapted to Python. It handles Bash variable interpolation and string

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-08 Thread Laszlo Papp
On Fri, Jan 8, 2010 at 6:06 PM, Xyne x...@archlinux.ca wrote: Hi, There was no response on the pacman-dev list but someone here might find this potentially useful: http://mailman.archlinux.org/pipermail/pacman-dev/2010-January/010322.html It's written in Perl but it could easily be adapted

Re: [aur-dev] Safe and relatively reliable PKGBUILD parser.

2010-01-08 Thread Xyne
What was the problem with that from Sebastian which was discussed earlier on the mailing lists, IRCs ? How does it know more ? I don't know. I wrote this because I needed a PKGBUILD parser in Perl for Bauerbill. Maybe it's better, maybe it's worse. I posted it here in case someone finds it