]> gitweb.fluxo.info Git - hydra.git/commitdiff
Check git-annex and keyringer installation
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 23 Oct 2013 01:12:45 +0000 (23:12 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 23 Oct 2013 01:12:45 +0000 (23:12 -0200)
share/hydra/sync

index 6fd8d1991b50a26e36b741993c9e51e8c2d1fd95..873694e5bbc94600697c5bb448c3a59497442ffe 100755 (executable)
@@ -26,6 +26,11 @@ else
   UPDATE_KEYRINGER="no"
 fi
 
+# Check for requirements.
+for req in git-annex; do
+  hydra_install_package $req
+done
+
 # Sync each repository.
 # TODO: split between public and private repositories
 for repository in $REPOSITORIES; do
@@ -37,8 +42,9 @@ for repository in $REPOSITORIES; do
   if [ ! -d "$HYDRA_FOLDER/$repository/.git" ]; then
     git clone $PRIVATE_REPOS/$repository $HYDRA_FOLDER/$repository
 
-    # TODO: check if keyringer is installed
-    if [ ! -e "$HOME/.keyringer/$HYDRA" ]; then
+    if ! which keyringer &> /dev/null; then
+      echo "Please install keyringer for a full hydra experience."
+    elif [ ! -e "$HOME/.keyringer/$HYDRA" ]; then
       echo "Initializing keyring for $HYDRA..."
       keyringer $HYDRA init $HYDRA_FOLDER/$repository
     fi
@@ -47,7 +53,6 @@ for repository in $REPOSITORIES; do
   if [ -d "$HYDRA_FOLDER/$repository/.git" ]; then
     echo "Syncing $repository..."
 
-    # TODO: check if git-annex is installed
     if [ "$repository" == "bootless" ]; then
       ( cd $HYDRA_FOLDER/$repository && git annex sync )
     else