From df5df188204b159b5e9840da3050308a0de99bd7 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Wed, 15 Oct 2014 12:22:48 -0400 Subject: [PATCH] fixes for bootstrap.sh for upgrading * `git fetch` wasn't done right for shallow clones * the test for whether mailinabox has already been cloned wasn't looking at the right directory if the script was not run from $HOME --- setup/bootstrap.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/bootstrap.sh b/setup/bootstrap.sh index 6343b585..c8506a18 100644 --- a/setup/bootstrap.sh +++ b/setup/bootstrap.sh @@ -17,12 +17,12 @@ if [[ $EUID -ne 0 ]]; then fi # Clone the Mail-in-a-Box repository if it doesn't exist. -if [ ! -d mailinabox ]; then +if [ ! -d $HOME/mailinabox ]; then echo Installing git . . . DEBIAN_FRONTEND=noninteractive apt-get -q -q install -y git < /dev/null echo - echo Downloading Mail-in-a-Box . . . + echo Downloading Mail-in-a-Box $TAG. . . git clone \ -b $TAG --depth 1 \ https://github.com/mail-in-a-box/mailinabox \ @@ -38,7 +38,7 @@ cd $HOME/mailinabox # Update it. if [ "$TAG" != `git describe` ]; then echo Updating Mail-in-a-Box to $TAG . . . - git fetch + git fetch --depth 1 --force --prune origin tag $TAG if ! git checkout -q $TAG; then echo "Update failed. Did you modify something in `pwd`?" exit