Add more events: precommit & postcommit

This commit is contained in:
belliash 2012-01-16 13:22:04 +01:00
parent 2202509d87
commit 814b9a406b
1 changed files with 24 additions and 0 deletions

24
ezsync
View File

@ -182,10 +182,34 @@ for OVERLAY in ${MERGED_PORTAGE[*]}; do
fi fi
done done
# Execute all 'precommit' enabled modules
for MODULE in ${MODULES_PRECOMMIT}; do
loadModule ${MODULE} "precommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
printWarn "Trying to load module: ${MODULE}, that is incompatible with event: precommit!"
elif [ ${RESULT} -ne 0 ]; then
fail "EzBuild was unable to execute module: ${MODULE}!"
fi
unloadModule
done
# Regenerate Portage cache # Regenerate Portage cache
printInfo "Updating constructed Portage cache..." printInfo "Updating constructed Portage cache..."
run "FEATURES="metadata-transfer" PORTDIR="${PORTAGESDIR}/${PORTAGE_BUILD[0]}" egencache --update --portdir=${PORTAGESDIR}/${PORTAGE_BUILD[0]} --jobs=${MAXJOBS} --load-average=${LOADAVERAGE} --tolerant" run "FEATURES="metadata-transfer" PORTDIR="${PORTAGESDIR}/${PORTAGE_BUILD[0]}" egencache --update --portdir=${PORTAGESDIR}/${PORTAGE_BUILD[0]} --jobs=${MAXJOBS} --load-average=${LOADAVERAGE} --tolerant"
[ ${?} -ne 0 ] && die "EzBuild was unable to regenerate cache!" [ ${?} -ne 0 ] && die "EzBuild was unable to regenerate cache!"
# Execute all 'postcommit' enabled modules
for MODULE in ${MODULES_POSTCOMMIT}; do
loadModule ${MODULE} "postcommit"
RESULT=${?}
if [ ${RESULT} -eq 255 ]; then
printWarn "Trying to load module: ${MODULE}, that is incompatible with event: postcommit!"
elif [ ${RESULT} -ne 0 ]; then
fail "EzBuild was unable to execute module: ${MODULE}!"
fi
unloadModule
done
# Finally quit the application # Finally quit the application
quit quit