On Monday 02 March 2009 08:24:35 Torsten Veller wrote: > > > find "${D}/${VENDOR_LIB}" -type f -a \( -name .packlist \ > > > -o \( -name '*.bs' -a -empty \) \) -delete > > > find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete > > > > I'm curious how portable the find () construct is. Do you know?
It was established well over a year ago that find in the ebuild environment must be GNU find. Using portable find is not worth the pain. [...] > > Could you just use dosed here? dosed needs to die. [...] > BTW: After I looked up the devmanual part about "find" above, I wonder: > | find "${S}" -type f | while read f ; do > | [...] > | for f in $(find "${S}" -type f) ; do > | [...] > | Warning > | In both cases, files with weird characters or spaces in their names may > | cause serious problems. The while loop breaks with leading or trailing spaces in the path. If the spaces are anywhere else in the path it works. The for loop breaks with spaces regardless of where they are. And you can of course come up with weird characters that break them both. If you really want to do better use: find "${S}" -print0 | while read -rd '' f; do if file "${f}" ... done You also really should provide proper die messages. -- Bo Andresen