lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Use find ... | xargs rm -f instead of find ... -delete


From: Graham Percival
Subject: Re: [PATCH] Use find ... | xargs rm -f instead of find ... -delete
Date: Tue, 29 Dec 2009 20:19:57 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Dec 29, 2009 at 08:00:46PM +0100, Matthias Kilian wrote:
> On Tue, Dec 29, 2009 at 08:16:37AM +0100, David Kastrup wrote:
> > > - find $(outdir)/offline-root -type l -delete
> > > + find $(outdir)/offline-root -type l | xargs rm -f
> > >  endif # ifeq ($(out),www)
> > 
> > What's the rationale? 
> 
> The `-delete' primary isn't very portable, it's a GNU extension.

IMHO, that's all we need to hear.  -delete must be removed.

> > and less secure
> > (if somebody places files with spaces or newlines into the latter
> > directory, things may get ugly).

That's a fairly esoteric concern; I can't imagine anybody having
the lilypond build tree in a world-writeable location unless they
also had the source tree in a world-writeable location.  If they
did that (say, a shared computer where the users trusted each
other), then there's many other ways to do nasty stuff (like
changing the makefiles themselves).

> Then change it to something like this:
> 
>       find $(outdir)/offline-root -type l -print0 | xargs -0 rm -f --
> 
> Or even this (completely POSIX compliant):
> 
>       find $(outdir)/offline-root -type -l -exec rm -f -- '{}' +
> 
> (but then I've to patch it again, since find(1) on OpenBSD doesn't yet
> support the `-exec command {} +' primary).

Well, if that's part of POSIX, then adding it can't be a bad
thing.  :)   But for the purposes of the lilypond build scripts, I
don't think it's necessary.  The first version of the patch should
be fine.

(I'm not totally certain, though, so I'm not applying it)

Cheers,
- Graham




reply via email to

[Prev in Thread] Current Thread [Next in Thread]