From a1f5ee388dfeac9dad2509d2cc59a63701f50fb6 Mon Sep 17 00:00:00 2001 From: Marc MERLIN Date: Thu, 7 Mar 2013 14:34:43 -0800 Subject: [PATCH] Remove a warning when $HOME is on NFS If ~/.subversion doesn't exist, the code didn't run, but if it existed there is no reason to re-create it, nor is it necessary to change its permissions since they are inherited by the bind mount source. However user_mkdir was trying to run chown as root which does not work over NFS with root_squash or krb-nfs. Therefore, the un-needed call to user_mkdir is removed. (this is an issue because cros_sdk --replace does call this code path multiple times). BUG=None TEST=Built the chroot, and the permission denied on 'install' went away. Change-Id: I01e9a7baf51a99a96d790c9613e26e652379e6df Reviewed-on: https://gerrit.chromium.org/gerrit/44880 Reviewed-by: Mike Frysinger Commit-Queue: Marc MERLIN Tested-by: Marc MERLIN --- common.sh | 2 +- sdk_lib/enter_chroot.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common.sh b/common.sh index e945b6ec10..b5b743d4ac 100644 --- a/common.sh +++ b/common.sh @@ -474,7 +474,7 @@ is_nfs() { warn_if_nfs() { if is_nfs "$1"; then - warn "$1 is on NFS. This is unsupported." + warn "$1 is on NFS. This is untested. You can send patches if it's broken." fi } diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh index 3bb46733ea..3f332910dd 100755 --- a/sdk_lib/enter_chroot.sh +++ b/sdk_lib/enter_chroot.sh @@ -316,9 +316,8 @@ setup_env() { fi fi - if [ -d "$SUDO_HOME/.subversion" ]; then + if [[ -d "$SUDO_HOME/.subversion" ]]; then TARGET="/home/${SUDO_USER}/.subversion" - user_mkdir "${FLAGS_chroot}${TARGET}" setup_mount "${SUDO_HOME}/.subversion" "--bind" "${TARGET}" # Symbolic-link the .subversion directory so sandboxed subversion.class # clients can use it.