scripts: eliminate use of find -print0 | xargs -0
commit92357ffa160b5fe0b4a94a624c7f13a16f83b722
authorKyle J. McKay <mackyle@gmail.com>
Mon, 20 Nov 2017 19:45:58 +0000 (20 11:45 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 20 Nov 2017 19:45:58 +0000 (20 11:45 -0800)
tree9513404e67281ee280912d7bae6986d5160446a4
parent73d552074ea7c520ca7bf3f57bc9251251b26142
scripts: eliminate use of find -print0 | xargs -0

There are a couple of problems with use of something
like "find ... -print0 | xargs -0 ...":

1. Neither the "-print0" find primary nor the "-0"
   xargs option are specified by POSIX.

2. Without use of the "-0" option, handling arbitrary
   input path names with xargs becomes very awkward.

Eliminate this non-POSIX usage by switching to find's
`-exec ... {} +` syntax instead like this:

    find ... -exec ... '{}' +

This IS specified by POSIX, spawns one less process
(the `xargs` utility) and reduces workload on the
shell (no pipeline need be set up).

Although these changes do not eliminate all uses
of xargs, the remaining uses do not employ the "-0"
option and only provide "well-known" pathnames that
do not fall into the awkward xargs escaping category.

These changes are, however, sufficient to remove
the need for the xargs utility to be installed into
the chroot jail (provided, of course, that the hooks
are updated before the jail is).

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/pre-receive
install.sh
jailsetup.sh
jobd/combine-packs.sh
jobd/gc.sh
jobd/update.sh
toolbox/perform-pre-gc-linking.sh