ava1ar / customizepkg

A tool for Arch Linux package manager pacman to modify PKGBUILD automatically
GNU General Public License v3.0
49 stars 14 forks source link

Failure when # in quoted string #18

Closed Frans-Willem closed 9 years ago

Frans-Willem commented 9 years ago

Line 158 of customizepkg: eval $(grep -Po '^[[:blank:]]_?(pkg.|name)=[^#](?= #|$)' ./PKGBUILD)

fails on the slic3r-git package: https://aur4.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=slic3r-git

The regular expression is unable to handle the fact that a # appears inside of a quoted string, as in line 118 of the PKGBUILD: _pkgver="$(awk '/#define SLIC3R_VERSION/ {gsub(/"/, "", $3); print $3 }' ./xs/src/libslic3r/libslic3r.h).$(git rev-parse --short HEAD)"

Any chance we can get this sorted?

ava1ar commented 9 years ago

Thanks for the reporting, issue identified and reproduced. Truing to find a solution which won't break existing functionality.

ava1ar commented 9 years ago

Fixed in commit #46