enter_chroot: drop LANG=C hardcode

The source of this LANG=C seems to date back to when apt was used as
the package manager [1].  It was further migrated to enter_chroot to
keep noise in the logs buildbot down to a minimal [2].  I've seen the
excess spam apt can spew in a default deb chroot when the active env
locale is not available (in reality it is perl that complains) because
the locale data has not yet been generated.

None of this should apply to Gentoo though as we don't execute perl
anywhere during the build.  So hopefully we can simply drop this now
as an artifact of days gone by.

The reason for not hardcoding this in the first place is that it can
easily wreck havoc when the host locale is multibyte (e.g. en_US.UTF8)
but the chroot is forced to narrow (e.g. C).  Attempts to use multibyte
chars will usually render correctly, but the apps in the chroot will
just get immensely confused as they will be using narrow functions to
process input.

[1] the code says "Warn less when apt-get installing packqages"
[2] http://codereview.chromium.org/521053

BUG=None
TEST=entered chroot and saw LANG preserved from host env, and ran cbuildbot

Change-Id: I0490b992d5e2d7bfba945f787e65a59943b8d35c
Reviewed-on: http://gerrit.chromium.org/gerrit/5767
Reviewed-by: Anush Elangovan <anush@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Mike Frysinger 2011-08-11 15:39:24 -04:00
parent dfd369431d
commit 5df0eab4fa

View File

@ -445,7 +445,7 @@ done
# the source trunk for scripts that may need to print it (e.g.
# build_image.sh).
sudo -- chroot "$FLAGS_chroot" sudo -i -u $USER $CHROOT_PASSTHRU \
EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" LANG=C SSH_AGENT_PID="${SSH_AGENT_PID}" \
EXTERNAL_TRUNK_PATH="${FLAGS_trunk}" SSH_AGENT_PID="${SSH_AGENT_PID}" \
SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" "$@"
# Remove trap and explicitly unmount