]> gitweb.fluxo.info Git - hydra.git/commitdiff
Doing module-verify on module-update
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 10 Aug 2011 16:20:35 +0000 (13:20 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 10 Aug 2011 16:20:35 +0000 (13:20 -0300)
share/hydra/module-update
share/hydra/module-verify

index 3887bd2efdf4169f7491af551b541d9227b8d740..ac19b57e832b235f43800c943ddb85ea26f2f505 100755 (executable)
@@ -21,4 +21,12 @@ fi
 
 # Update the module
 ( cd $PUPPET/modules/$MODULE; git pull origin master )
+
+# Verify the module
+if ! hydra $HYDRA module-verify $MODULE; then
+  echo "ERROR: Updated module doesn't match hash, please verify and update manually."
+  exit 1
+fi
+
+# Commit
 ( cd $PUPPET; git commit -a -m "Updating module $MODULE"; git push )
index 81afbfe9e3a6f0b42e28a3ec864754edafc1eb21..5a4d164fbcfd3d7170fe16956f78c21325c97f6d 100755 (executable)
@@ -17,11 +17,11 @@ elif [ -z "$HYDRA_FOLDER" ] || [ ! -e "$HYDRA_FOLDER/modules" ]; then
 fi
 
 cd $PUPPET
-HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }'`"
+HASH_SUBMODULE="`git submodule | grep "modules/$MODULE " | awk '{ print $1 }' | sed -e 's/\+//'`"
 
 cd $HYDRA_FOLDER/modules/$MODULE
 
-HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }'`"
+HASH_MODULE="`git log -1 | grep "^commit" | awk '{ print $2 }' | sed -e 's/\+//'`"
 
 if [ "$HASH_MODULE" != "$HASH_SUBMODULE" ]; then
   echo "Module $MODULE: hash differ!!:"