[PATCH] scripts: genenv: remove empty files from tempdir
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue May 28 04:11:11 EDT 2013
Hello,
On Tue, May 28, 2013 at 09:45:46AM +0200, Jan Luebbe wrote:
> This allows leaving out default files from the environment by overriding
> them with empty files in the board or BSP.
>
> Signed-off-by: Jan Luebbe <jlu at pengutronix.de>
> ---
> scripts/genenv | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/genenv b/scripts/genenv
> index 374db6d..3e91062 100755
> --- a/scripts/genenv
> +++ b/scripts/genenv
> @@ -24,7 +24,7 @@ for i in $*; do
> done
> )
>
> -find $tempdir -name '.svn' -o -name '*~' | xargs --no-run-if-empty rm -r
> +find $tempdir -name '.svn' -o -name '*~' -o -size 0 | xargs --no-run-if-empty rm -r
Maybe use -empty instead of -size 0?
Other than that this is broken for funny filenames.
find "$tempdir" -name '.svn' -o -name '*~' -o -size 0 -print0 | xargs --no-run-if-empty --null rm -r
would work, but depends on GNU find and xargs. I don't know if that is a
problem. Alternatively use:
find "$tempdir" -depth -name '.svn' -o -name '*~' -o -size 0 -execdir rm -r {} +
(Obviously this doesn't make your patch worse, I'm just pointing out
another possible improvement.) And note my suggestions are untested.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
More information about the barebox
mailing list