[arch-dev-public] [PATCH 1/4] Handle error case of parsepkgbuild correctly

Dan McGee dpmcgee at gmail.com
Tue Jun 15 11:25:04 EDT 2010


On Tue, Jun 15, 2010 at 6:24 AM, Allan McRae <allan at archlinux.org> wrote:
> On 15/06/10 15:29, Dan McGee wrote:
>>
>> We were never checking the return code of parsepkgbuild so would try to
>> parse the error message it printed out as a package definition rather than
>> erroring and returning None. Look at the return code, and as a bonus, use
>> the more correct communicate() rather than stdout.read().
>>
>> Signed-off-by: Dan McGee<dan at archlinux.org>
>
> Something is changed here...  After applying this commit:
>
>> PATH=$(pwd):$PATH
>> PYTHONPATH=$(pwd)
>> for i in /var/abs/core/*; do ./namcap -t namcap-tags $i/PKGBUILD; done

And on a related note, something like this is probably a lot faster
since namcap is great at (and a lot faster at) processing multiple
files at once:
$ time find /var/abs/core/ -name PKGBUILD | xargs ./namcap -t namcap-tags
...
real	0m4.053s
user	0m2.630s
sys	0m0.867s

vs.

$ time for i in /var/abs/core/*; do ./namcap -t namcap-tags $i/PKGBUILD; done
...
real	0m14.161s
user	0m9.816s
sys	0m3.066s

-Dan


More information about the arch-dev-public mailing list