From b4605b42c037c946ed6a5701ea2f9c80ec680197 Mon Sep 17 00:00:00 2001 From: Paul Drews Date: Thu, 11 Oct 2012 23:10:43 -0700 Subject: [PATCH] enter_chroot: Link subversion configuration upon entry The process of bootstrapping the chroot from sources was failing for several reasons when run from behind a firewall with proxies. The llvm build was failing due to inability to checkout sources through subversion using the subversion.eclass wrapper (the "normal" way to do this in the ebuild environment). This was because the user's subversion configuration (including proxy settings) was not inherited from $HOME/.subversion into the in-chroot sandbox used by subversion.eclass. This change creates symbolic links in the subversion.eclass sandboxes for host and target builds in the chroot to fix any build that uses the normal subversion.eclass for checkouts. The operation is done at enter_chroot time so that it applies to both ordinary builds and chroot creation (via early_enter_chroot). BUG=none TEST='cros_sdk --replace --enter' behind proxied firewall Change-Id: I0af2128866bb95799dc07c728c75cf3f2a0af7a3 Reviewed-on: https://gerrit.chromium.org/gerrit/34291 Reviewed-by: Mike Frysinger Commit-Ready: paul drews Tested-by: paul drews --- sdk_lib/enter_chroot.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index ee57fff007..76b387adf8 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -399,6 +399,22 @@ setup_env() { TARGET="/home/${USER}/.subversion" mkdir -p "${FLAGS_chroot}${TARGET}" queue_mount "${HOME}/.subversion" "--bind" "${TARGET}" + # Symbolic-link the .subversion directory so sandboxed subversion.class + # clients can use it. + local cmds=() + for d in \ + "${FLAGS_cache_dir}"/distfiles/{host,target}/svn-src/"${USER}"; do + if [[ ! -L "${d}/.subversion" ]]; then + cmds+=( + "mkdir -p '${d}'" + "ln -sf /home/${USER}/.subversion '${d}/.subversion'" + "chown -R ${USER}:250 '${d%/*}'" + ) + fi + done + if [[ ${#cmds[@]} -gt 0 ]]; then + sudo_multi "${cmds[@]}" + fi fi if DEPOT_TOOLS=$(type -P gclient) ; then