Use sudo -i to simulate root environment while building; fix mistaken use of command substitution when checking repo