eclass: set default portage user and group

The PORTAGE_USERNAME and PORTAGE_GRPNAME variables are not exported by
default. The SDK uses them to get portage to run builds as the
developer's uid/gid instead of portage:portage. When running outside of
the SDK use the default portage user and group.
This commit is contained in:
Michael Marineau 2014-07-20 16:59:18 -07:00
parent 86ccf944f2
commit a9bcccd3a1

View File

@ -470,8 +470,8 @@ cros-workon_pkg_setup() {
if [[ ${CROS_WORKON_INCREMENTAL_BUILD} == "1" ]]; then if [[ ${CROS_WORKON_INCREMENTAL_BUILD} == "1" ]]; then
local out=$(cros-workon_get_build_dir) local out=$(cros-workon_get_build_dir)
addwrite "${out}" addwrite "${out}"
mkdir -p -m 755 "${out}" mkdir -p -m 755 "${out}" || die
chown ${PORTAGE_USERNAME}:${PORTAGE_GRPNAME} "${out}" "${out%/*}" chown ${PORTAGE_USERNAME:-portage}:${PORTAGE_GRPNAME:-portage} "${out}" "${out%/*}" || die
fi fi
} }