[arch-general] [PATCH 35/48] find has a builtin delete action. Use it instead of exec'ing rm.

Thomas Bächler thomas at archlinux.org
Wed Jun 30 18:32:31 EDT 2010


Am 30.06.2010 23:58, schrieb Daenyth Blank:
> On Wed, Jun 30, 2010 at 17:47, Victor Lowther <victor.lowther at gmail.com> wrote:
>> ---
>>  rc.sysinit |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/rc.sysinit b/rc.sysinit
>> index 319ea60..037a9f2 100755
>> --- a/rc.sysinit
>> +++ b/rc.sysinit
>> @@ -277,7 +277,7 @@ stat_busy "Removing Leftover Files"
>>  /bin/rm -f /var/lock/* &>/dev/null
>>  /bin/rm -rf /tmp/* /tmp/.* &>/dev/null
>>  /bin/rm -f /forcefsck &>/dev/null
>> -(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
>> +(cd /var/run && /usr/bin/find . \! -type d -delete  )
>>  : >| /var/run/utmp
>>  /bin/chmod 0664 /var/run/utmp
>>  # Keep {x,k,g}dm happy with xorg
>> --
>> 1.7.1
>>
>>
> 
> I don't think this is portable though.
> 

Portability is not an issue. The beauty about this is that we can simply
assume we have GNU tools and we do use Linux ... because that is what
Arch is based on.

I have no problem having GNU-specific features in there, as we can rely
on GNU find (or GNU whatever) being present. The only exception is
initramfs - however, no shell script is used in both the system and
initramfs.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20100701/635d37a7/attachment-0001.bin>


More information about the arch-general mailing list