Skip to content

Make xargs invocation BSD safe

Kristian Larsson requested to merge 113-bsd-compatibility-xargs into master

The default behavior of BSD xargs is to not run when the input is empty. GNU xargs, somewhat stupidly? doesn't have this default and instead requires the use of the --no-run-if-empty argument to run with the same behavior.

We determine if we are using GNU or BSD xargs by running xargs --version and grepping for GNU. BSD xargs doesn't even have a --version and will error out. Any invocation in our makefiles should now use the XARGS variable wherever xargs is required as this will make us compatible across GNU and BSD tools.

Part of #113 (closed)

Merge request reports