From 9d30ce80fa7b98fdd5b86009a11240bcd4bd1f54 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Mon, 14 Mar 2011 15:00:46 -0700 Subject: [PATCH] Ignore git config errors that may occur in enter_chroot. git config doesn't behave well if there are multiple callers calling it at the same time. Since this is best effort anyway, I'm adding an || true so that multithreads calls to this don't fail. I removed my previous work around to this since it wasn't generic enough. Change-Id: I12f2d3faaa745c1ff675a297bb09c567a88aa185 BUG=chromium-os:13070 TEST=Ran it a lot Review URL: http://codereview.chromium.org/6693001 --- bin/au_test_harness/cros_au_test_harness.py | 1 - enter_chroot.sh | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/au_test_harness/cros_au_test_harness.py b/bin/au_test_harness/cros_au_test_harness.py index 56648688d6..8cb83b23fb 100755 --- a/bin/au_test_harness/cros_au_test_harness.py +++ b/bin/au_test_harness/cros_au_test_harness.py @@ -53,7 +53,6 @@ def _PregenerateUpdates(options): def _GenerateVMUpdate(target, src, private_key_path): """Generates an update using the devserver.""" command = ['./enter_chroot.sh', - '--nogit_config', '--', 'sudo', 'start_devserver', diff --git a/enter_chroot.sh b/enter_chroot.sh index 973d198049..b3da25f34d 100755 --- a/enter_chroot.sh +++ b/enter_chroot.sh @@ -44,8 +44,6 @@ DEFINE_string chrome_root "" \ DEFINE_string chrome_root_mount "/home/$USER/chrome_root" \ "The mount point of the chrome broswer source in the chroot." -DEFINE_boolean git_config $FLAGS_TRUE \ - "Config git to work with your user/pass in the chroot." DEFINE_boolean official_build $FLAGS_FALSE \ "Set CHROMEOS_OFFICIAL=1 for release builds." DEFINE_boolean mount $FLAGS_FALSE "Only set up mounts." @@ -362,13 +360,13 @@ if [ -d "$HOME/.subversion" ]; then fi # Configure committer username and email in chroot .gitconfig -if [ $FLAGS_git_config -eq $FLAGS_TRUE ]; then - git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ - user.name "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')" - git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ - user.email "$(cd /tmp; git var GIT_COMMITTER_IDENT | \ - sed -e 's/.*<\([^>]*\)>.*/\1/')" -fi +git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ + user.name "$(cd /tmp; git var GIT_COMMITTER_IDENT | sed -e 's/ *<.*//')" || + true +git config -f ${FLAGS_chroot}/home/${USER}/.gitconfig --replace-all \ + user.email "$(cd /tmp; git var GIT_COMMITTER_IDENT | \ + sed -e 's/.*<\([^>]*\)>.*/\1/')" || + true # Run command or interactive shell. Also include the non-chrooted path to # the source trunk for scripts that may need to print it (e.g.