FS#23307 - [makepkg] unexpected EOF error when parenthesis are used in optdepends description

Attached to Project: Pacman
Opened by Eric Belanger (Snowman) - Thursday, 17 March 2011, 05:42 GMT
Last edited by Dan McGee (toofishes) - Sunday, 20 March 2011, 16:59 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 3.5.0
Due in Version 3.5.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

When parenthesis are part of the descriptions accompanying the optdepends, makepkg throws an unexpected EOF error. This error happens with pacman 3.5.0-1 in testing. The pacman from core isn't affected.

To reproduce:
PKGBUILD:
========
pkgname=foo
pkgver=1
pkgrel=1
pkgdesc=""
arch=('i686' 'x86_64')
url=""
license=('GPL')
optdepends=('vdpau-video: VDPAU backend for VA API (for GPU acceleration on Nvidia cards)'
'libpulse: PulseAudio support')
source=()
md5sums=()

package_() {
cd "${srcdir}"
true
}
==============

makepkg output:
==============
$ makepkg -f
/usr/bin/makepkg: eval: line 1279: unexpected EOF while looking for matching `)'
==> Making package: foo 1-1 (Thu Mar 17 01:24:44 EDT 2011)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Entering fakeroot environment...
/usr/bin/makepkg: eval: line 1279: unexpected EOF while looking for matching `)'
==> Creating package...
-> Generating .PKGINFO file...
-> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: foo 1-1 (Thu Mar 17 01:24:45 EDT 2011)
=======================

Note that if vdpau-video is the last item in the arrary there is no error message. The metainfo in .PKGINFO doens't seem to be affected, at least with this test case.
This task depends upon

Closed by  Dan McGee (toofishes)
Sunday, 20 March 2011, 16:59 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit b6cada3eed82
Comment by Allan McRae (Allan) - Friday, 18 March 2011, 05:18 GMT
Attached is a fix for this issue. The awk expression extracts all the optdepends lists in the test file but none of the "foobar" lines in between.

The regex assumes that the final line of the optdepends array ends with a ")" or a ")" followed by a bash comment, both with possible whitespace. That should be quite robust...
Comment by Andreas Radke (AndyRTR) - Friday, 18 March 2011, 12:37 GMT
Can you please test your fix with my LibreOffice PKGBUILD from trunk? Your fix doesn't solve it for me in my chroot.
Comment by Allan McRae (Allan) - Friday, 18 March 2011, 21:41 GMT
Hmm... when we convert the optdepends=() to optdepends_list+=(), then bash does not like comments within arrays. Looks like they need stripped...
Comment by Allan McRae (Allan) - Friday, 18 March 2011, 22:45 GMT
This fixes all known issues.
Comment by Andreas Radke (AndyRTR) - Saturday, 19 March 2011, 08:32 GMT
It is still failing over the #'java-runtime: adds java support' at the beginning of the optdepends array. Removing this makes solves it. Doing so now because I need to rebuild it for poppler in stating.
Comment by Allan McRae (Allan) - Saturday, 19 March 2011, 09:09 GMT
Hmm... works for me with that comment in and the attached patch...
Comment by Andreas Radke (AndyRTR) - Saturday, 19 March 2011, 11:16 GMT
Works for my i686 chroot. Maybe I made a mistake when adding it to my x86_64 chroot. Can you add it our testing pkg as 3.5.0-2 or 3.5.0.1 ?

Loading...