[Slackbuilds-users] find/chmod revisited

Robby Workman rworkman at slackbuilds.org
Sun Jan 10 20:35:37 UTC 2016


On Thu, 12 Nov 2015 02:37:15 -0500
B Watson <yalhcru at gmail.com> wrote:

> I've always known the template code that sanitizes the source
> permissions is a bit slow... for mame, it takes a full minute to
> execute (using tmpfs for TMP), since there are over 18 thousand
> files/dirs in the mame src.
> 
> find -L . \
>  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
>   -o -perm 511 \) -exec chmod 755 {} \; -o \
>  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
>   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
> 
> ...executes one chmod process for each file/dir it finds. For mame:
> 
> $ find /tmp/mame-mame0167/|wc -l
> 18664
> 
> That's a lot of child processes! So I thought "maybe I can use xargs
> and cut the time down some". Result is this:
> 
> find -L . \
>  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
>   -o -perm 511 \) -print0 | \
>   xargs -0 chmod 755
> find -L . \
>  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
>   -o -perm 440 -o -perm 400 \) -print0 | \
>   xargs -0 chmod 644
> 
> ...which (on tmpfs) executes so fast I can't measure it accurately.
> 
> Maybe the template code could be updated? mame isn't the only build
> that is affected by this. Anything with lots of files will be
> noticeably faster with this change.


I didn't see any opposition to this, and I don't have any, so if you
want to make a user branch within the template repo and ping me 
about it, I'll be more than happy to merge it for 14.2.

Once that's done, and once the current-wip branch gets merged to 
master (after 14.2 beta/rc announcement) and we get moving a bit
heavier there, if you'd like to work up a branch to make the
changes in there, we'll definitely consider it.

It will probably be worth touching base with us first on that one,
because you'll want to minimize the merge conflicts that we are
creating while you're doing the changes there :-)

-RW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20160110/cd170682/attachment.asc>


More information about the SlackBuilds-users mailing list