#!/bin/bash
set -ex
+ncpus=$(getconf _NPROCESSORS_ONLN)
cd ${1:-~/chromiumos}
chr=${PWD}/chroot
chome=${chr}/home/vapier
[[ -L ${chr}/usr/bin/esearch ]] || pkgs+=( esearch )
[[ -x ${chr}/usr/bin/strace ]] || pkgs+=( strace )
[[ -x ${chr}/usr/bin/time ]] || pkgs+=( time )
+[[ -x ${chr}/usr/bin/gdb ]] || pkgs+=( sys-devel/gdb )
[[ -x ${chr}/usr/bin/diffstat ]] || pkgs+=( diffstat )
-[[ ${#pkgs[@]} -eq 0 ]] || cros_sdk -- sudo emerge -1 ${pkgs[@]}
+[[ ${#pkgs[@]} -eq 0 ]] || cros_sdk -- sudo emerge -1q --jobs ${ncpus} ${pkgs[@]}
sudo sed -i -e '/^# inc/s:^# *::' ${chr}/etc/nanorc