Closed stevenhoneyman closed 8 years ago
What customizations are you applying for qemu (just want to reproduce the issue)?
Any change should trigger it, but here's my slightly out-of-date config anyway:
remove#makedepends#libpulse
remove#makedepends#libcacard
##remove#makedepends#libseccomp
remove#makedepends#seabios
remove#makedepends#bluez-libs
remove#makedepends#spice
remove#makedepends#spice-protocol
remove#global#'libpulse'
remove#global#'seabios'
remove#global#'bluez-libs'
remove#global#'spice'
remove#global#'libcacard'
##remove#global#'libseccomp'
replace#global#!strip#strip
replace#global#--audio-drv-list='pa alsa sdl'#--audio-drv-list='alsa sdl'
replace#global#--enable-docs#--disable-docs
##replace#global#--enable-seccomp#--disable-seccomp
replace#global#--enable-spice#--disable-spice
replace#global#--enable-tpm #&--enable-{pie,curses,user,sdl,vnc} --disable-{werror,libnfs,smartcard-nss,guest-agent,libssh2,vhdx,quorum,bluez,xen,debug-info} --target-list="i386-softmmu x86_64-softmmu arm-softmmu arm-linux-user"
replace#global#rm -r "${pkgdir}\/var"#rm -rf "${pkgdir}\/var"
removeline#global#rm....pkgdir.\/usr\/share\/qemu
I think the solution is going to involve changing that grep command to a small awk script, but maybe we can get away with using a PCRE instead.
August... wow, that's gone quickly!
How do you like the look of this as a fix for this issue? My PCRE skills are incredibly rusty (and basic to begin with) but this seems to do the job and hasn't broken anything else yet. Maybe test for a couple of weeks before merging?
--- /bin/customizepkg 2015-12-27 21:42:26.000000000 +0000
+++ ./customizepkg 2015-12-27 21:37:33.538483104 +0000
@@ -167 +167 @@
-eval $(grep -Po '^[[:blank:]]*_?(pkg.*|name)=[^#]*(?= *#|$)' ./PKGBUILD | grep -Ev '\$\(|`')
+eval $(grep -Pzo '^[[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= *#|$))' ./PKGBUILD | grep -Ev '\$\(|`')
I tried new varian on my cistomizations - looks like it works good. Regarding PCRE, my skills are also very limited, but we can always revert the change if it breaks something for somebody. Merging the fix.
Actual again: due to changes in grep behavior fix with "-Pz" options won't work anymore.
How about
--- customizepkg 2016-04-03 15:53:58.904323720 +0100
+++ /bin/customizepkg 2016-04-03 15:54:34.274324246 +0100
@@ -167 +167 @@
-eval $(grep -Pzo '^[[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= *#|$))' ./PKGBUILD | grep -Ev '\$\(|`')
+eval $(grep -Pzo '[^[:print:]][[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= *#|\x0a))' ./PKGBUILD | grep -Ev '\$\(|`')
Please note that it requires an upstream bugfix to work: http://git.savannah.gnu.org/cgit/grep.git/commit/?id=d97cfd43d091662065482a8b72f17e25e296d15b
Tiny addition needed (ascii files), other than this, no problems in the past month:
--- customizepkg 2016-04-28 17:59:51.025211419 +0100
+++ /bin/customizepkg 2016-04-28 18:01:42.078546397 +0100
@@ -167 +167 @@
-eval $(grep -Po '^[[:blank:]]*_?(pkg.*|name)=[^#]*(?= *#|$)' ./PKGBUILD | grep -Ev '\$\(|`')
+eval $(grep -Pazo '[^[:print:]][[:blank:]]*_?(pkg.*|name)=(\((.|\n)*?\)|[^#]*?(?= *#|\x0a))' ./PKGBUILD | grep -Eva '\$\(|`')
@stevenhoneyman Did the bugix for grep you mentioned already released?
Yes, it's included in v2.25, released 9 days ago.
Merged the fix. Thanks, @stevenhoneyman!
I'll try and get something in place to fix as soon as I can, but I've had very little time to spend on open source stuff lately. My current broken package is qemu. this breaks the script at line 149: