aboutsummaryrefslogtreecommitdiff
path: root/share/hydra
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-24 15:12:17 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-24 15:12:17 -0300
commitcbc1885cf22182952d0a1b31779c89cff26decd4 (patch)
treea41659187dfb60643e157a36bbb189ea6c6d36cd /share/hydra
parent30529ff43974ce04ddbe6cc801564b79e75bcc1d (diff)
downloadhydra-cbc1885cf22182952d0a1b31779c89cff26decd4.tar.gz
hydra-cbc1885cf22182952d0a1b31779c89cff26decd4.tar.bz2
Support networks both with and without superprojects
Diffstat (limited to 'share/hydra')
-rwxr-xr-xshare/hydra/init15
-rwxr-xr-xshare/hydra/sync2
2 files changed, 13 insertions, 4 deletions
diff --git a/share/hydra/init b/share/hydra/init
index 4a6d0c1..a69e885 100755
--- a/share/hydra/init
+++ b/share/hydra/init
@@ -38,20 +38,29 @@ fi
# Clone configuration repository or setup a new hydra
if [ ! -z "$REMOTE" ]; then
- git clone $REMOTE $BASEDIR
+ mkdir -p $BASEDIR
+
+ # Try to clone the superproject first
+ git clone $REMOTE $BASEDIR 2> /dev/null
(
cd $BASEDIR
# Initialize only the required repositories
for repo in $BASEREPOS; do
- git submodule update --init $repo
+ if [ -e '.gitmodules' ] && grep -q \"config\" .gitmodules; then
+ git submodule update --init $repo
+ else
+ git clone ${REMOTE}$repo `basename $repo .git`
+ fi
done
)
else
# Create the superproject
mkdir -p $BASEDIR
- hydra_git_init $BASEDIR
+
+ # Optional: version control in the superproject
+ #hydra_git_init $BASEDIR
# Create config repository
if [ ! -d "$BASEDIR/config" ]; then
diff --git a/share/hydra/sync b/share/hydra/sync
index 9b1d097..f062c98 100755
--- a/share/hydra/sync
+++ b/share/hydra/sync
@@ -67,7 +67,7 @@ function hydra_sync {
# Basic parameters.
if [ -z "$1" ]; then
- REPOSITORIES="config doc bootless dns git/public git/private puppet"
+ REPOSITORIES="$BASEREPOS"
else
REPOSITORIES="$*"
UPDATE_KEYRINGER="no"