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
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
set -- -p "${p_flag}" "$@"
fi
+set -- --cache-dir=~/chromiumos/.cache "$@"
vexec cbuildbot --buildroot=${d} "$@"