From fc49d8dd19c8b5d8a10a4b8dc5d710bf22df68c9 Mon Sep 17 00:00:00 2001 From: David James Date: Thu, 17 Jan 2013 13:47:14 -0800 Subject: [PATCH] Fix broken boto file handling. After CL:39921, I get the following warning every time I enter the chroot: ln: failed to create symbolic link `.../chroot/root/.boto': File exists All bots get this error as well. This is caused because CL:39921, causes ~/trunk to no longer resolve outside the chroot, so it's invalid for processes outside the chroot to try to resolve paths inside there. Fix cases where we do this inside enter_chroot.sh. BUG=chromium-os:37347 TEST=cros_sdk doesn't print warnings anymore. Change-Id: Iaeb9b7407e12397bce1600bd51559be20f998fdf Reviewed-on: https://gerrit.chromium.org/gerrit/41571 Reviewed-by: Mike Frysinger Commit-Queue: David James Tested-by: David James --- sdk_lib/enter_chroot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index a16da3ad3c..49e3e5bde3 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -437,11 +437,11 @@ setup_env() { # We're also installing credentials for use by sudoed invocations. boto='src/private-overlays/chromeos-overlay/googlestorage_account.boto' if [ -s "${FLAGS_trunk}/${boto}" ]; then - if [ ! -e "${FLAGS_chroot}/home/${SUDO_USER}/.boto" ]; then + if [ ! -L "${FLAGS_chroot}/home/${SUDO_USER}/.boto" ]; then user_symlink "trunk/${boto}" "${FLAGS_chroot}/home/${SUDO_USER}/.boto" fi - if [ ! -e "${FLAGS_chroot}/root/.boto" ]; then - ln -s "../home/${SUDO_USER}/trunk/${boto}" "${FLAGS_chroot}/root/.boto" + if [ ! -L "${FLAGS_chroot}/root/.boto" ]; then + ln -sf "${CHROOT_TRUNK_DIR}/${boto}" "${FLAGS_chroot}/root/.boto" fi fi