2019-12-31 14:28:42 -01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
[[ "${EXECUTED_IN_CHROOT}" != true ]] \
|
|
|
|
&& { echo "This script must not be executed directly!" >&2; exit 1; }
|
|
|
|
|
2020-01-02 21:28:16 -01:00
|
|
|
# Source the systems profile
|
2019-12-31 14:28:42 -01:00
|
|
|
source /etc/profile
|
|
|
|
|
2020-01-02 22:29:17 -01:00
|
|
|
# Set safe umask
|
|
|
|
umask 0077
|
|
|
|
|
2020-01-02 21:28:16 -01:00
|
|
|
# Export nproc variables
|
|
|
|
export NPROC="$(nproc || echo 2)"
|
|
|
|
export NPROC_ONE="$(($NPROC + 1))"
|
2019-12-31 14:28:42 -01:00
|
|
|
|
2020-01-02 21:28:16 -01:00
|
|
|
# Set default makeflags and emerge flags for parallel emerges
|
|
|
|
export MAKEFLAGS="-j$NPROC"
|
|
|
|
export EMERGE_DEFAULT_OPTS="--jobs=$NPROC_ONE --load-average=$NPROC"
|
|
|
|
|
|
|
|
# Execute the requested command
|
2019-12-31 14:28:42 -01:00
|
|
|
exec "$@"
|