Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: slong@××××××××××××××××××.uk
Subject: Re: [gentoo-dev] Re: [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use.
Date: Wed, 30 May 2012 17:16:00
Message-Id: 20120530191615.1f84d791@pomiocik.lan
In Reply to: [gentoo-dev] Re: [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use. by Steven J Long
On Tue, 29 May 2012 14:50:19 +0100
Steven J Long <slong@××××××××××××××××××.uk> wrote:

> Michał Górny wrote: > > > + find "${D}" -type f -name '*.la' -print0 | while read -r -d '' > > f; > .. > > + rm -f "${f}" || die > .. > > + done > > Don't pipe to read like that; it means the final command is in a > subshell and "die is /not/ guaranteed to work correctly if called > from a subshell environment."[1]
Didn't we actually change that in the past? I think I'm recalling something like that...
> More seriously, the script doesn't actually get the correct > filenames, despite being written to handle any filename. > eg: > $ touch $' foo bar \n\t ' > $ while read -r -d '' f; do echo "'$f'"; done < <(find . -type f > -print0) './ foo bar' > > You do it like this: > > while read -rd ''; do > f=$REPLY; > .. > done < <(find "$D" -type f -name '*.la' -print0)
Thanks. -- Best regards, Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature