Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk: eclipse-sdk-3.2.1-r2.ebuild ChangeLog eclipse-sdk-3.3.1.1.ebuild
On Wed, Jan 23, 2008 at 05:31:13PM -0500, Mike Frysinger wrote: > On Wednesday 23 January 2008, Steve Long wrote: > > Or even: find blah -exec sed 'blah "blah"' + > > we specifically discourage `find -exec` in favor of `find -print0 | xargs -0` > because it sucks. In what way? I'm not aware of any problems with find -exec ... {} + that are handled any better by find -print0 | xargs -0. It's too bad that you can only add {} + at the very end of the command, but that's just as much a problem with xargs -0. Your reply didn't make it clear, but you're aware of the difference between -exec {} ; and -exec {} +, right? The former executes a single command for every file, while the latter builds one long argument list when possible, the same way xargs does. -- gentoo-dev@lists.gentoo.org mailing list
Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk: eclipse-sdk-3.2.1-r2.ebuild ChangeLog eclipse-sdk-3.3.1.1.ebuild
On Wednesday 23 January 2008, Steve Long wrote: > Ryan Hill wrote: > > Donnie Berkholz wrote: > >> On 12:15 Mon 21 Jan , Jean-Noel Rivasseau (elvanor) wrote: > >>> # No warnings / Java 5 / all output should be directed to stdout > >>> find "${S}" -type f -name '*.xml' -exec \ > >>> sed -r -e "s:(-encoding ISO-8859-1):\1 -nowarn:g" -e > >>> "s:(\"compilerArg\" value=\"):\1-nowarn :g" \ -e "s:( >>> name=\"javacSource\" value=)\".*\":\1\"1.5\":g" \ -e "s:( >>> name=\"javacTarget\" value=)\".*\":\1\"1.5\":g" -e > >>> "s:output=\".*(txt|log).*\"::g" -i {} \; > >> > >> I think this will end up calling sed a large number of times, since > >> -exec runs per file found instead of once on all files. If you instead > >> pipe find output to xargs sed, that might work better. Depending on how > >> many files are involved, this could be a significant difference. > > > > Better yet, use > > > >find [...] -print0 | xargs -0 sed -r -e [...] -e [...] -i > > > > This handles files with special characters like spaces in their names. > > Or even: find blah -exec sed 'blah "blah"' + > It's POSIX[1] and it's in GNU too (after a long delay). The quoting there > is a bit yuck. > http://wooledge.org/mywiki/UsingFind we specifically discourage `find -exec` in favor of `find -print0 | xargs -0` because it sucks. if your system doesnt support `find -print0` or `xargs -0`, then you need to install GNU findutils. or install a real OS. -mike signature.asc Description: This is a digitally signed message part.
[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk: eclipse-sdk-3.2.1-r2.ebuild ChangeLog eclipse-sdk-3.3.1.1.ebuild
Ryan Hill wrote: > Donnie Berkholz wrote: >> On 12:15 Mon 21 Jan , Jean-Noel Rivasseau (elvanor) wrote: >>> # No warnings / Java 5 / all output should be directed to stdout >>> find "${S}" -type f -name '*.xml' -exec \ >>> sed -r -e "s:(-encoding ISO-8859-1):\1 -nowarn:g" -e "s:(\"compilerArg\" >>> value=\"):\1-nowarn :g" \ -e "s:(>> value=)\".*\":\1\"1.5\":g" \ -e "s:(>> value=)\".*\":\1\"1.5\":g" -e "s:output=\".*(txt|log).*\"::g" -i {} \; >> >> I think this will end up calling sed a large number of times, since >> -exec runs per file found instead of once on all files. If you instead >> pipe find output to xargs sed, that might work better. Depending on how >> many files are involved, this could be a significant difference. > > Better yet, use > >find [...] -print0 | xargs -0 sed -r -e [...] -e [...] -i > > This handles files with special characters like spaces in their names. > Or even: find blah -exec sed 'blah "blah"' + It's POSIX[1] and it's in GNU too (after a long delay). The quoting there is a bit yuck. http://wooledge.org/mywiki/UsingFind [1] http://www.opengroup.org/onlinepubs/009695399/utilities/find.html -- gentoo-dev@lists.gentoo.org mailing list
[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk: eclipse-sdk-3.2.1-r2.ebuild ChangeLog eclipse-sdk-3.3.1.1.ebuild
Donnie Berkholz wrote: On 12:15 Mon 21 Jan , Jean-Noel Rivasseau (elvanor) wrote: 1.1 dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild?rev=1.1&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild?rev=1.1&content-type=text/plain src_unpack() { unpack "${A}" patch-apply remove-bundled-stuff # No warnings / Java 5 / all output should be directed to stdout find "${S}" -type f -name '*.xml' -exec \ sed -r -e "s:(-encoding ISO-8859-1):\1 -nowarn:g" -e "s:(\"compilerArg\" value=\"):\1-nowarn :g" \ -e "s:( I think this will end up calling sed a large number of times, since -exec runs per file found instead of once on all files. If you instead pipe find output to xargs sed, that might work better. Depending on how many files are involved, this could be a significant difference. Better yet, use find [...] -print0 | xargs -0 sed -r -e [...] -e [...] -i This handles files with special characters like spaces in their names. -- fonts,by design, by neglect gcc-porting, for a fact or just for effect wxwindows @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 signature.asc Description: OpenPGP digital signature
[gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in dev-util/eclipse-sdk: eclipse-sdk-3.2.1-r2.ebuild ChangeLog eclipse-sdk-3.3.1.1.ebuild
On 12:15 Mon 21 Jan , Jean-Noel Rivasseau (elvanor) wrote: > 1.1 dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild > > file : > http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild?rev=1.1&view=markup > plain: > http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/eclipse-sdk/eclipse-sdk-3.3.1.1.ebuild?rev=1.1&content-type=text/plain > src_unpack() { > unpack "${A}" > patch-apply > remove-bundled-stuff > > # No warnings / Java 5 / all output should be directed to stdout > find "${S}" -type f -name '*.xml' -exec \ > sed -r -e "s:(-encoding ISO-8859-1):\1 -nowarn:g" -e > "s:(\"compilerArg\" value=\"):\1-nowarn :g" \ > -e "s:( value=)\".*\":\1\"1.5\":g" \ > -e "s:( value=)\".*\":\1\"1.5\":g" -e "s:output=\".*(txt|log).*\"::g" -i {} \; I think this will end up calling sed a large number of times, since -exec runs per file found instead of once on all files. If you instead pipe find output to xargs sed, that might work better. Depending on how many files are involved, this could be a significant difference. Thanks, Donnie -- gentoo-dev@lists.gentoo.org mailing list