FS#27780 - PKGBUILD where exists a '++' couldn't be parsed

Attached to Project: Pacman
Opened by DaNiMoTh (DaNiMoTh) - Saturday, 31 December 2011, 11:50 GMT
Last edited by Dan McGee (toofishes) - Saturday, 11 February 2012, 22:04 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Dan McGee (toofishes)
Allan McRae (Allan)
Dave Reisner (falconindy)
Architecture All
Severity High
Priority Normal
Reported Version 4.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
makepkg in pacman 4.0.1, package_libxml++() isn't recognized as function. With makepkg 3.5.4 everything is fine.

Steps to Reproduce:

Download PKGBUILD of libxml++
[danimoth@jim trunk]$ makepkg
/home/danimoth/archlinuxppc/svn/libxml++/trunk/PKGBUILD: line 22: package_libxml++(): command not found

==> ERROR: An unknown error has occurred. Exiting...
This task depends upon

Closed by  Dan McGee (toofishes)
Saturday, 11 February 2012, 22:04 GMT
Reason for closing:  Fixed
Additional comments about closing:  commit 31432edcbe4
Comment by Allan McRae (Allan) - Saturday, 31 December 2011, 12:43 GMT
I do not really understand what is causing this...

The line that is failing is "source $BUILDSCRIPT". Manually doing that from the bash shell works fine.

Also, changing "package_libxml++() {" to "package_libxml++ () {" works.
Comment by Allan McRae (Allan) - Saturday, 31 December 2011, 12:49 GMT
0e79802c0ac8453376d8c0f99629f5a3b499f571 is the first bad commit
commit 0e79802c0ac8453376d8c0f99629f5a3b499f571
Author: Dave Reisner <dreisner@archlinux.org>
Date: Sat Sep 3 22:24:27 2011 -0400

makepkg: use globs in place of regex

We seem to enjoy using bash regex capabilities, but never referencing
the result with BASH_REMATCH. Replace almost all regexes with equivalent
globs which are faster and functionally equivalent in these cases.

This enables the extglob shopt.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Comment by DaNiMoTh (DaNiMoTh) - Saturday, 31 December 2011, 13:00 GMT
Comment by Dave Reisner (falconindy) - Saturday, 31 December 2011, 15:36 GMT
Note that the function name package_libxml++ isn't valid bash. No idea offhand why it crashes in makepkg but not on the command line.
Comment by Dave Reisner (falconindy) - Saturday, 31 December 2011, 16:46 GMT
Seems to be an upstream bug with bash. extglob changes the behavior of the parser, and it fails in this select case. I can recreate this in a very small number of lines of code. Download the attached and run 'foo'.

It's not clear upstream will care about this since the name of the function isn't really considered valid.
   foo (0 KiB)
   bar (0.1 KiB)

Loading...