mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] scripts: genenv: remove empty files from tempdir
Date: Tue, 28 May 2013 10:11:11 +0200	[thread overview]
Message-ID: <20130528081111.GJ11166@pengutronix.de> (raw)
In-Reply-To: <1369727146-15275-1-git-send-email-jlu@pengutronix.de>

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@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/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-05-28  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28  7:45 Jan Luebbe
2013-05-28  8:11 ` Uwe Kleine-König [this message]
2013-05-28 10:55 ` [SPAM] " Jean-Christophe PLAGNIOL-VILLARD
2013-05-28 16:34   ` Jan Lübbe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130528081111.GJ11166@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jlu@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox