cvs commit: src Makefile.inc1

Alexander Leidinger Alexander at Leidinger.net
Wed May 16 09:31:09 UTC 2007


Quoting Dag-Erling Smørgrav <des at des.no> (from Wed, 16 May 2007  
10:18:40 +0200):

> Alexander Leidinger <Alexander at Leidinger.net> writes:
>> What about another idea: removing the chflags all together and let the
>> removal fail (with a message that the file may be protected with schg
>> and it should be removed with chglags). This way only a message
>> appears when the rm fails (saying no to the removal question of rm is
>> not a failure/exit!=0).
>
> OK with me.
>
> BTW, testing for the schg flag is not straightforward, but doable:
>
>         flags=$(stat -f '%f' ./$${file})
>         if [ $((flags & 131072)) -eq 131072 ] ; then
>                 # schg is set
>         fi

This does not cover the case when the user doesn't want to remove the  
file. So I think removing the chflags is better than testing for the  
flag.

Bye,
Alexander.

-- 
Anyone can hold the helm when the sea is calm.
		-- Publilius Syrus

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the cvs-all mailing list