From d1f01e93686bb7ff33d480ac08add6728e39a860 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 26 Oct 2015 13:56:04 -0200 Subject: Init: use superproject repo --- share/hydra/init | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'share') diff --git a/share/hydra/init b/share/hydra/init index 138c5bd..4a6d0c1 100755 --- a/share/hydra/init +++ b/share/hydra/init @@ -36,21 +36,23 @@ elif [ -d "$BASEDIR" ]; then exit 1 fi -# Create base -mkdir -p $BASEDIR - -# Reparse basedir to force absolute folder -BASEDIR="`cd $BASEDIR && pwd`" - -# Add entry -echo "Registering hydra $HYDRA..." -chmod 700 $BASEDIR -echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG - # Clone configuration repository or setup a new hydra if [ ! -z "$REMOTE" ]; then - git clone $REMOTE $BASEDIR/config + git clone $REMOTE $BASEDIR + + ( + cd $BASEDIR + + # Initialize only the required repositories + for repo in $BASEREPOS; do + git submodule update --init $repo + done + ) else + # Create the superproject + mkdir -p $BASEDIR + hydra_git_init $BASEDIR + # Create config repository if [ ! -d "$BASEDIR/config" ]; then # Setup repository from template @@ -82,6 +84,14 @@ else fi fi +# Reparse basedir to force absolute folder +BASEDIR="`cd $BASEDIR && pwd`" + +# Add entry +echo "Registering hydra $HYDRA..." +chmod 700 $BASEDIR +echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG + cat<<-EOF Hydra suite relies heavilly in the address in the form of "admin.example.org" as the repository server which hosts configuration. -- cgit v1.2.3