#! /bin/sh CONF_URL=${CONF_URL:=https://github.com/rock-core/buildconf-all.git} RUBY=ruby AUTOPROJ_BOOTSTRAP_URL=http://rock-robotics.org/autoproj_bootstrap if test -n "$1" && test "$1" != "dev" && test "$1" != "localdev"; then RUBY=$1 shift 1 RUBY_USER_SELECTED=1 fi set -e if ! which $RUBY > /dev/null 2>&1; then echo "cannot find the ruby executable. On ubuntu, you should run" echo " sudo apt-get install ruby1.9.1" exit 1 fi if ! $RUBY --version | grep -q "1\.9\.3"; then if test "$RUBY_USER_SELECTED" = "1"; then cat < /dev/null 2>&1; then cat < /dev/null; then DOWNLOADER=wget elif which curl > /dev/null; then DOWNLOADER=curl else echo "I can find neither curl nor wget, either install one of these or" echo "download the following script yourself, and re-run this script" exit 1 fi $DOWNLOADER $AUTOPROJ_BOOTSTRAP_URL fi CONF_URL=${CONF_URL#*//} CONF_SITE=${CONF_URL%%/*} CONF_REPO=${CONF_URL#*/} PUSH_TO=git@$CONF_SITE:$CONF_REPO until [ -n "$GET_REPO" ] do echo -n "Which protocol do you want to use to access $CONF_REPO on $CONF_SITE? [git|ssh|http] (default: http) " read ANSWER ANSWER=`echo $ANSWER | tr "[:upper:]" "[:lower:]"` case "$ANSWER" in "ssh") GET_REPO=git@$CONF_SITE:$CONF_REPO ;; "http"|"") GET_REPO=https://$CONF_SITE/$CONF_REPO ;; "git") GET_REPO=git://$CONF_SITE/$CONF_REPO ;; esac done $RUBY autoproj_bootstrap $@ git $GET_REPO push_to=$PUSH_TO branch=master if test "x$@" != "xlocaldev"; then $SHELL -c '. $PWD/env.sh; autoproj update; autoproj osdeps; autoproj fast-build' fi