quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] [PATCH] Makefile.in: Fix "find -perm" usage


From: Jean Delvare
Subject: Re: [Quilt-dev] [PATCH] Makefile.in: Fix "find -perm" usage
Date: Thu, 23 May 2013 09:19:34 +0200

Hi Dmitry,

Le Wednesday 22 May 2013 à 13:49 +0400, Dmitry V. Levin a écrit :
> On Wed, May 22, 2013 at 01:47:21AM +0200, Martin Quinson wrote:
> > Do you have any information on the portability of this new syntax? In
> > praticular, since when is it in GNU findutils, and what's the support
> > of this syntax on non-GNU systems? BSD ones come to mind.
> > 
> > Thanks for your time, Mt
> 
> Some portability facts about find:
> 1. "-perm /MODE" is a GNU extention, but may be implemented elsewhere,
>   too;
> 2. "-perm +MODE" and "-perm /MODE" have different meaning, .e.g.
>   "-perm +x" means "-perm =x";
> 3. "-perm +OCTAL" is not specified by POSIX and removed from GNU
>   findutils, to avoid confusion.
> 
> For more information about this issue, see
> http://lists.gnu.org/archive/html/bug-findutils/2013-04/msg00017.html

Thanks for reporting, I wasn't aware of this change (nor had I realized
that we were using a deprecated syntax.)

> [...]
> > > -compat_leftover := $(filter-out $(COMPAT),$(shell $(FIND) compat 
> > > -maxdepth 1 -type f -perm +111))
> > > +compat_leftover := $(filter-out $(COMPAT),$(shell $(FIND) compat 
> > > -maxdepth 1 -type f -perm /111))
> 
> If "-perm -0111" would suffice, that would be quite portable.

No, this may fail depending on the builder's umask.

> Or maybe "-perm -0100" would be enough, I haven't seen the code.

Yes, I think this is enough. We only care about the owner permission
flags, the group/other permission flags may or may not be set depending
on the builder's umask.

Alternatively I think \! -name "*.in" would also work, as all template
file names match *.in.

> If not, the portable equivalent of "-perm /111" is
> "( -perm -0100 -o -perm -0010 -o -perm -0001 )"

-- 
Jean Delvare
Suse L3




reply via email to

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