#!/bin/sh # This file is in the public domain. # Used by the checker-builder to get the latest code. # First argument is the base URL from where to clone the Gits. # Subsequent arguments must be the names of the Git repositories to clone. # All repositories are either freshly cloned or updated to the latest 'master' branch BASE_URL=$1 shift 1 mkdir -p $HOME/sources/ for n in "$@" do P=$HOME/sources/$n echo "Updating $P" if test -x "$P" then git -C $P clean -fdx git -C $P fetch git -C $P reset --hard origin/master git submodule update --init else cd $HOME/sources git clone ${BASE_URL}$n git submodule update --init cd - fi done