From: Silvio Rhatto Date: Tue, 24 Mar 2015 18:49:52 +0000 (-0300) Subject: Fixes for module-{update,verify} X-Git-Tag: 0.2.4~340 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=eccfe05e99a17b1a8e38dc0cfc0ad79632b5e4ac;p=hydra.git Fixes for module-{update,verify} --- diff --git a/share/hydra/module-update b/share/hydra/module-update index f8a7ce3..f4c70c7 100755 --- a/share/hydra/module-update +++ b/share/hydra/module-update @@ -34,7 +34,7 @@ function hydra_module_update { fi # Update the module - ( cd $PUPPET/modules/$MODULE; git pull origin `git branch` ) + ( cd $PUPPET/modules/$MODULE; git pull ) # Verify the module if ! hydra $HYDRA module-verify $MODULE; then diff --git a/share/hydra/module-verify b/share/hydra/module-verify index aa84c4d..29e9930 100755 --- a/share/hydra/module-verify +++ b/share/hydra/module-verify @@ -35,13 +35,12 @@ HASH_SUBMODULE="`git submodule | grep -E "modules/$MODULE( |$)" | awk '{ print $ cd $HYDRA_FOLDER/modules/$MODULE -HASH_MODULE="`git log -1 "commit" | awk '{ print $2 }' | sed -e 's/\+//'`" +HASH_MODULE="`git log -1 "$HASH_SUBMODULE" | head -n 1 | awk '{ print $2 }' | sed -e 's/\+//'`" if [ "$HASH_MODULE" != "$HASH_SUBMODULE" ]; then - echo "Module $MODULE: hash differ!!:" - echo "Module: $HASH_MODULE" - echo "Submodule: $HASH_SUBMODULE" + echo "Module $MODULE: commit not found!:" + echo "Commit: $HASH_SUBMODULE" exit 1 fi -echo "Latest commit hash match." +echo "Commit check successful for $MODULE module."