From a4b98ea9a7a14b75a75698f5039ac51cbb1a54fa Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 25 Feb 2014 12:59:54 -0500 Subject: [PATCH] cros-cbuildbot: update mount handling --- .bin/cros-cbuildbot | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.bin/cros-cbuildbot b/.bin/cros-cbuildbot index 723f5d8..cdc6b43 100755 --- a/.bin/cros-cbuildbot +++ b/.bin/cros-cbuildbot @@ -21,14 +21,19 @@ vexec() { cd ~/chromiumos -# cache the sudo timestamp -sudo echo "" >/dev/null - d=/usr/local/google/home/vapier if [[ ! -d ${d} ]] ; then exit 1 fi +if [[ -z ${UNSHARE} ]] ; then + if type -P unshare >&/dev/null ; then + exec sudo unshare -m -- sudo -u ${USER} \ + UNSHARE=true PATH="${PATH}" "$0" "$@" + fi + unset UNSHARE +fi + d+="/trybot" mkdir -p "${d}" if mount | grep -qs $d ; then @@ -50,17 +55,17 @@ elif [[ " $* " != *" --remote "* ]] ; then pushd "${d}" >/dev/null clean=( built-sdk.tbz2 - chroot +# chroot new-sdk-chroot - #sdks + sdks src/build test_results.tgz trybot_archive ) sudo rm -rf "${clean[@]}" - if [[ -d ${d}/sdks ]] ; then - sudo find "${d}"/sdks -mtime +3 -delete - fi +# [[ -L .cache ]] && rm -f .cache || : +# mkdir -p .cache +# sudo mount --bind -n ~/chromiumos/.cache .cache popd >/dev/null fi @@ -93,5 +98,6 @@ if [[ -n ${repos} ]] ; then set -- -p "${p_flag}" "$@" fi +set -- --cache-dir=~/chromiumos/.cache "$@" vexec cbuildbot --buildroot=${d} "$@" -- 2.39.5