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

Bruno Pagani bruno.pagani at ens-lyon.org
Sat Aug 15 10:53:25 UTC 2015


Maybe that’s a stupid question, but why do you need printing something to stdout in a PKGBUILD, especially outside of any function ?

Bruno

Le 15 août 2015 11:56:51 GMT+02:00, Ido Rosen <ido at kernel.org> a écrit :
>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