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

Dan McGee dpmcgee at gmail.com
Tue Jun 15 11:07:44 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
> Error: /var/abs/core/acl/PKGBUILD is not a valid PKGBUILD
> Error: /var/abs/core/ar9170-fw/PKGBUILD is not a valid PKGBUILD
> Error: /var/abs/core/attr/PKGBUILD is not a valid PKGBUILD
> Error: /var/abs/core/b43-fwcutter/PKGBUILD is not a valid PKGBUILD
> PKGBUILD: line 27: seq: command not found
> PKGBUILD (bash) E: Too many md5sums: 5 needed
> Error: /var/abs/core/bin86/PKGBUILD is not a valid PKGBUILD
> Error: /var/abs/core/bridge-utils/PKGBUILD is not a valid PKGBUILD
> Error: /var/abs/core/bzip2/PKGBUILD is not a valid PKGBUILD
> ...
> PKGBUILD (db) W: Description should not contain the package name.
> ...
> PKGBUILD (filesystem) W: Description should not contain the package name.
>
>
> As you can see, some PKGBUILD appear to work... although I have no idea why.

They have never worked quite right, we've just exposed the B.S.
failure (return code of 1 for some reason) from before:
(namcap 2.6 version)

dmcgee at galway ~/projects/arch-repos/acl/trunk
$ parsepkgbuild PKGBUILD >/dev/null; echo $?
1

dmcgee at galway ~/projects/arch-repos/filesystem/trunk
$ parsepkgbuild PKGBUILD >/dev/null; echo $?
0

What is interesting is both of these do spit out the full .PKGINFO-like stuff.

-Dan


More information about the arch-dev-public mailing list