[aur-general] mksrcinfo bug: PKGBUILD stdout appears in mksrcinfo

Ido Rosen ido at kernel.org
Sat Aug 15 09:56:51 UTC 2015


mksrcinfo will include anything the PKGBUILD writes to stdout in the body
of the PKGBUILD (i.e. not in any prepare/build/package/etc. functions when
being sourced, for example:

pkgname=example
pkgver=1
echo "Hello world."
prepare() {}
build() {}
package() {}


... which will generate an .SRCINFO file with "Hello world." as the first
line.  This .SRCINFO file is then not parseable by AUR4 when trying to push
it to the package's git repository, which will end up with an error that
looks like this:

$ git push -u origin master:master
Counting objects: 4, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 4.38 KiB | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: Traceback (most recent call last):
remote:   File "/srv/http/vhosts/
aur.archlinux.org/public/git-interface/aurinfo.py", line 127, in
ParseAurinfoFromIterable
remote:     key, value = map(str.strip, line.split('=', 1))
remote: ValueError: need more than 1 value to unpack
remote:
remote: During handling of the above exception, another exception occurred:
remote:
remote: Traceback (most recent call last):
remote:   File "hooks/update", line 239, in <module>
remote:     srcinfo = aurinfo.ParseAurinfoFromIterable(srcinfo_raw,
ecatcher)
remote:   File "/srv/http/vhosts/
aur.archlinux.org/public/git-interface/aurinfo.py", line 130, in
ParseAurinfoFromIterable
remote:     current_package['pkgname']))
remote: TypeError: 'NoneType' object is not subscriptable
remote: error: hook declined to update refs/heads/master
To ^aur:/matlab.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '^aur:/matlab.git'

The fix should prevent the PKGBUILD's stdout output from appearing in the
.SRCINFO that mksrcinfo generates.


More information about the aur-general mailing list